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 .import TM, load_tenth
16 .importzp sreg, tmp1, tmp2
19 ;----------------------------------------------------------------------------
36 @L1: inx ; Get PM flag
56 jsr steaxspidx ; Pops address pushed by 2. pushax
65 ldy #timespec::tv_nsec
66 jsr steaxspidx ; Pops address pushed by 1. pushax
76 ;----------------------------------------------------------------------------
77 ; dec = (((BCD>>4)*10) + (BCD&0xf))