2 ; 2009-07-27, Stefan Haubenthal
3 ; 2009-09-24, Ullrich von Bassewitz
4 ; 2018-08-18, Oliver Schmidt
5 ; 2018-08-19, Greg King
7 ; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp);
14 .import pushax, pusheax, tosmul0ax, steaxspidx, incsp1
15 .import sys_bank, restore_bank
16 .import TM, load_tenth
17 .importzp sreg, tmp1, tmp2
20 ;----------------------------------------------------------------------------
37 @L1: inx ; Get PM flag
61 jsr steaxspidx ; Pops address pushed by 2. pushax
69 ldy #timespec::tv_nsec
70 jsr steaxspidx ; Pops address pushed by 1. pushax
78 ;----------------------------------------------------------------------------
79 ; dec = (((BCD>>4)*10) + (BCD&0xf))