Fixed a problem with clock() (Greg King)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2147 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
1cdb90926a
commit
cd4a9e3fb0
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,11 @@
|
||||||
;
|
;
|
||||||
|
; clock.s
|
||||||
|
;
|
||||||
; Written by Groepaz/Hitmen <groepaz@gmx.net>
|
; Written by Groepaz/Hitmen <groepaz@gmx.net>
|
||||||
; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
|
; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
|
||||||
|
; 2003-05-02, Greg King <gngking@erols.com>
|
||||||
|
;
|
||||||
|
; #include <time.h>
|
||||||
;
|
;
|
||||||
; clock_t clock (void);
|
; clock_t clock (void);
|
||||||
;
|
;
|
||||||
|
@ -16,8 +21,10 @@
|
||||||
ldy #0 ; High word is always zero
|
ldy #0 ; High word is always zero
|
||||||
sty sreg+1
|
sty sreg+1
|
||||||
sty sreg
|
sty sreg
|
||||||
ldx tickcount+1 ; ## Problem: Cannot disable ints here
|
L1: ldx tickcount+1
|
||||||
lda tickcount
|
lda tickcount
|
||||||
|
cpx tickcount+1 ; Did tickcount change?
|
||||||
|
bne L1 ; Yes, re-read it
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
Loading…
Add table
Reference in a new issue