2 ; Stefan Haubenthal, 2009-07-27
3 ; Ullrich von Bassewitz, 2009-09-24
4 ; Oliver Schmidt, 2018-08-14
6 ; int clock_gettime (clockid_t clk_id, struct timespec *tp);
13 .import pushax, pusheax, tosmul0ax, steaxspidx, incsp1
14 .import sys_bank, restore_bank
15 .importzp sreg, tmp1, tmp2
18 ;----------------------------------------------------------------------------
50 jsr steaxspidx ; Pops address pushed by 2. pushax
52 lda #<(100 * 1000 * 1000 / $10000)
53 ldx #>(100 * 1000 * 1000 / $10000)
56 lda #<(100 * 1000 * 1000)
57 ldx #>(100 * 1000 * 1000)
64 ldy #timespec::tv_nsec
65 jsr steaxspidx ; Pops address pushed by 1. pushax
75 ;----------------------------------------------------------------------------
76 ; dec = (((BCD>>4)*10) + (BCD&0xf))
95 ;----------------------------------------------------------------------------
96 ; TM struct with date set to 1970-01-01