2014-11-29 13:18:48 +00:00
|
|
|
;
|
|
|
|
; clock_t clock (void);
|
|
|
|
;
|
|
|
|
|
2015-07-12 12:27:24 +00:00
|
|
|
.include "pce.inc"
|
2014-11-30 10:20:57 +00:00
|
|
|
|
2015-07-12 12:27:24 +00:00
|
|
|
.export _clock
|
2014-11-30 10:20:57 +00:00
|
|
|
.importzp sreg
|
2015-07-14 17:55:41 +00:00
|
|
|
;; .importzp tickcount
|
2014-11-29 13:18:48 +00:00
|
|
|
|
2015-07-12 12:27:24 +00:00
|
|
|
.proc _clock
|
|
|
|
|
2015-07-14 17:55:41 +00:00
|
|
|
lda tickcount+3
|
2015-07-12 14:40:52 +00:00
|
|
|
sta sreg+1
|
2015-07-14 17:55:41 +00:00
|
|
|
lda tickcount+2
|
2015-07-12 14:40:52 +00:00
|
|
|
sta sreg
|
2015-07-14 17:55:41 +00:00
|
|
|
ldx tickcount+1
|
|
|
|
lda tickcount
|
2014-11-30 10:20:57 +00:00
|
|
|
rts
|
2014-11-29 13:18:48 +00:00
|
|
|
|
|
|
|
.endproc
|