]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm510/gettime.s
Added clock_settime() for some CBMs.
[cc65] / libsrc / cbm510 / gettime.s
index b89b9b16b2a6c9f642fb638adaac0ed4b5a483e7..5a0a172e499a0dbf522594b24a3841470f9d8a71 100644 (file)
@@ -12,6 +12,7 @@
 
         .import         pushax, pusheax, tosmul0ax, steaxspidx, incsp1
         .import         sys_bank, restore_bank
+        .import         TM, load_tenth
         .importzp       sreg, tmp1, tmp2
 
 
         ldy     #timespec::tv_sec
         jsr     steaxspidx      ; Pops address pushed by 2. pushax
 
-        lda     #<(100 * 1000 * 1000 / $10000)
-        ldx     #>(100 * 1000 * 1000 / $10000)
-        sta     sreg
-        stx     sreg+1
-        lda     #<(100 * 1000 * 1000)
-        ldx     #>(100 * 1000 * 1000)
+        jsr     load_tenth
         jsr     pusheax
         ldy     #CIA::TOD10
         lda     (cia2),y
         rts
 
 .endproc
-
-;----------------------------------------------------------------------------
-; TM struct with date set to 1970-01-01
-.data
-
-TM:     .word           0       ; tm_sec
-        .word           0       ; tm_min
-        .word           0       ; tm_hour
-        .word           1       ; tm_mday
-        .word           0       ; tm_mon
-        .word           70      ; tm_year
-        .word           0       ; tm_wday
-        .word           0       ; tm_yday
-        .word           0       ; tm_isdst