]> git.sur5r.net Git - cc65/blob - libsrc/nes/clock.s
Fixed LinuxDoc Tools issues in some verbatim blocks in the Atari document.
[cc65] / libsrc / nes / clock.s
1 ;
2 ; clock.s
3 ;
4 ; Written by Groepaz/Hitmen <groepaz@gmx.net>
5 ; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
6 ; 2003-05-02, Greg King <gngking@erols.com>
7 ;
8 ; #include <time.h>
9 ;
10 ; clock_t clock (void);
11 ;
12
13         .include "nes.inc"
14
15         .export         _clock
16         .importzp       sreg
17
18
19 .proc   _clock
20
21         ldy     #0              ; High word is always zero
22         sty     sreg+1
23         sty     sreg
24 L1:     ldx     tickcount+1
25         lda     tickcount
26         cpx     tickcount+1     ; Did tickcount change?
27         bne     L1              ; Yes, re-read it
28         rts
29
30 .endproc
31