]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm510/tmcommon.s
Added clock_settime() for some CBMs.
[cc65] / libsrc / cbm510 / tmcommon.s
diff --git a/libsrc/cbm510/tmcommon.s b/libsrc/cbm510/tmcommon.s
new file mode 100644 (file)
index 0000000..9f0ed9c
--- /dev/null
@@ -0,0 +1,41 @@
+;
+; Oliver Schmidt, 16.8.2018
+;
+; Common stuff for the clock routines
+;
+
+        .include        "cbm510.inc"
+
+        .export         TM, load_tenth
+
+        .importzp       sreg
+
+
+;----------------------------------------------------------------------------
+.code
+
+.proc   load_tenth
+
+        lda     #<(100 * 1000 * 1000 / $10000)
+        ldx     #>(100 * 1000 * 1000 / $10000)
+        sta     sreg
+        stx     sreg+1
+        lda     #<(100 * 1000 * 1000)
+        ldx     #>(100 * 1000 * 1000)
+        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