2000-05-28 13:40:48 +00:00
|
|
|
;
|
2019-12-25 15:56:32 +00:00
|
|
|
; 1998-09-21, Ullrich von Bassewitz
|
|
|
|
; 2019-12-25, Greg King
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; clock_t clock (void);
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _clock
|
|
|
|
.importzp sreg
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2019-12-25 15:56:32 +00:00
|
|
|
.include "cbm.inc"
|
|
|
|
.macpack cpu
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _clock
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2019-12-25 15:56:32 +00:00
|
|
|
; Some accelerator adaptors have CMOS ICs.
|
|
|
|
|
|
|
|
.if (.cpu & ::CPU_ISET_65SC02)
|
|
|
|
stz sreg + 1
|
|
|
|
.else
|
|
|
|
lda #$00 ; Byte 3 always is zero
|
|
|
|
sta sreg + 1
|
|
|
|
.endif
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr RDTIM
|
|
|
|
sty sreg
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
.endproc
|