]> git.sur5r.net Git - cc65/blob - libsrc/pce/clock.s
fixed more flaws found by greg :)
[cc65] / libsrc / pce / clock.s
1 ;
2 ; clock_t clock (void);
3 ;
4
5         .include        "pce.inc"
6         .include        "extzp.inc"
7
8         .export         _clock
9         .importzp       sreg
10
11 .proc   _clock
12
13         lda     tickcount+3
14         sta     sreg+1
15         lda     tickcount+2
16         sta     sreg
17         ldx     tickcount+1
18         lda     tickcount
19         rts
20
21 .endproc
22
23         .constructor initclock, 24
24
25 initclock:
26         lda     #0
27         ldx     #3
28 @lp:    sta     tickcount,x
29         dex
30         bpl     @lp
31         rts