Add basic support for ORIC Atmos
git-svn-id: svn://svn.cc65.org/cc65/trunk@2046 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
36
libsrc/atmos/clock.s
Normal file
36
libsrc/atmos/clock.s
Normal file
@@ -0,0 +1,36 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 2003-04-13
|
||||
;
|
||||
; clock_t clock (void);
|
||||
;
|
||||
|
||||
.export _clock
|
||||
.import negax
|
||||
.importzp sreg
|
||||
|
||||
.include "atmos.inc"
|
||||
|
||||
|
||||
.proc _clock
|
||||
|
||||
; Clear the timer high 16 bits
|
||||
|
||||
ldy #$00
|
||||
sty sreg
|
||||
sty sreg+1
|
||||
|
||||
; Read the timer
|
||||
|
||||
sei ; Disable interrupts
|
||||
lda TIMER3
|
||||
ldx TIMER3+1
|
||||
cli ; Reenable interrupts
|
||||
|
||||
|
||||
; Since the timer is counting downwards, return the negated value
|
||||
|
||||
jmp negax
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user