]> git.sur5r.net Git - cc65/blob - libsrc/cbm510/tmcommon.s
Atari: clock_gettime() and clock_settime() implementations
[cc65] / libsrc / cbm510 / tmcommon.s
1 ;
2 ; Oliver Schmidt, 16.8.2018
3 ;
4 ; Common stuff for the clock routines
5 ;
6
7         .include        "cbm510.inc"
8
9         .export         TM, load_tenth
10
11         .importzp       sreg
12
13
14 ;----------------------------------------------------------------------------
15 .code
16
17 .proc   load_tenth
18
19         lda     #<(100 * 1000 * 1000 / $10000)
20         ldx     #>(100 * 1000 * 1000 / $10000)
21         sta     sreg
22         stx     sreg+1
23         lda     #<(100 * 1000 * 1000)
24         ldx     #>(100 * 1000 * 1000)
25         rts
26
27 .endproc
28
29 ;----------------------------------------------------------------------------
30 ; TM struct with date set to 1970-01-01
31 .data
32
33 TM:     .word           0       ; tm_sec
34         .word           0       ; tm_min
35         .word           0       ; tm_hour
36         .word           1       ; tm_mday
37         .word           0       ; tm_mon
38         .word           70      ; tm_year
39         .word           0       ; tm_wday
40         .word           0       ; tm_yday
41         .word           0       ; tm_isdst