]> git.sur5r.net Git - cc65/blob - libsrc/pce/clock.s
Allow "mode" argument to open() to be passed from 6502 code.
[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         .forceimport    ticktock
10         .importzp       sreg
11         .constructor    initclock
12
13
14 .proc   _clock
15
16         lda     tickcount+3
17         sta     sreg+1
18         lda     tickcount+2
19         sta     sreg
20         ldx     tickcount+1
21         lda     tickcount
22         rts
23
24 .endproc
25
26         .segment        "ONCE"
27 initclock:
28         lda     #0
29         ldx     #3
30 @lp:    sta     tickcount,x
31         dex
32         bpl     @lp
33         rts