2 ; Oliver Schmidt, 15.08.2018
4 ; int __fastcall__ clock_settime (clockid_t clk_id, const struct timespec *tp);
8 .import incsp1, return0
11 .include "zeropage.inc"
18 jsr incsp1 ; Preserves A
24 ; Check for existing minutes or hours
32 .assert timespec::tv_sec = 0, error
41 adc #$01 ; Move [0..11] to [1..12]
53 cmp #100 ; Year since 1900 < 100?
54 bcc :+ ; Yes, leave alone
55 sbc #100 ; Move 20xx to 19xx
56 : plp ; Restore month msb
71 errno: jmp __directerrno