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

36 lines
572 B
ArmAsm

;
; 1998-09-21, Ullrich von Bassewitz
; 2019-12-25, Greg King
;
; clock_t clock (void);
;
.constructor initclock
.export _clock
.import SETTIM, RDTIM
.importzp sreg
; clock() counts the amount of time that the process has run.
; Therefore, reset it when the program begins.
.proc initclock
lda #$00
tax
tay
jmp SETTIM
.endproc
.proc _clock
stz sreg + 1 ; Byte 3 always is zero
jsr RDTIM
sty sreg
rts
.endproc