1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00
cc65/libsrc/gamate/clock.s

34 lines
577 B
ArmAsm
Raw Normal View History

2015-11-29 00:14:59 +00:00
;
; clock_t clock (void);
;
.include "gamate.inc"
.include "extzp.inc"
.export _clock
.forceimport ticktock
.importzp sreg
.constructor initclock
.proc _clock
lda tickcount+3
sta sreg+1
lda tickcount+2
sta sreg
ldx tickcount+1
lda tickcount
rts
.endproc
.segment "INIT"
initclock:
lda #0
ldx #3
@lp: sta tickcount,x
dex
bpl @lp
rts