]> git.sur5r.net Git - cc65/blob - libsrc/atmos/clock.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / atmos / clock.s
1 ;
2 ; Ullrich von Bassewitz, 2003-04-13
3 ;
4 ; clock_t clock (void);
5 ;
6
7         .export         _clock
8         .import         negax
9         .importzp       sreg
10
11         .include        "atmos.inc"
12
13
14 .proc   _clock
15
16 ; Clear the timer high 16 bits
17
18         ldy     #$00
19         sty     sreg
20         sty     sreg+1
21
22 ; Read the timer
23
24         sei                     ; Disable interrupts
25         lda     TIMER3
26         ldx     TIMER3+1
27         cli                     ; Reenable interrupts
28
29
30 ; Since the timer is counting downwards, return the negated value
31
32         jmp     negax
33
34 .endproc
35
36