mirror of
https://github.com/cc65/cc65.git
synced 2024-08-20 09:29:12 +00:00
33 lines
544 B
ArmAsm
33 lines
544 B
ArmAsm
;
|
|
; clock_t clock (void);
|
|
;
|
|
|
|
.include "pce.inc"
|
|
.include "extzp.inc"
|
|
|
|
.forceimport ticktock
|
|
.export _clock
|
|
.importzp sreg
|
|
|
|
.proc _clock
|
|
|
|
lda tickcount+3
|
|
sta sreg+1
|
|
lda tickcount+2
|
|
sta sreg
|
|
ldx tickcount+1
|
|
lda tickcount
|
|
rts
|
|
|
|
.endproc
|
|
|
|
.constructor initclock, 24
|
|
|
|
initclock:
|
|
lda #0
|
|
ldx #3
|
|
@lp: sta tickcount,x
|
|
dex
|
|
bpl @lp
|
|
rts
|