Page 3 of 3
Re: Mini-challenge - fastest 24 bit countdown
Posted: Wed Sep 06, 2023 2:58 am
by IamRob
I guess the routine I posted fails in one respect. If the Accumulator is already at $FF, then gets incremented to $00, then the subtraction at the bottom of the routine will fail as the carry will be cleared in that case.
Re: Mini-challenge - fastest 24 bit countdown
Posted: Wed Sep 06, 2023 7:11 am
by BigEd
oh no!
Re: Mini-challenge - fastest 24 bit countdown
Posted: Fri Dec 15, 2023 10:51 pm
by IamRob
* I just had to revisit this thread as I couldn’t get this out of my head,
* This should be up there for one of the smallest/fastest
* The smallest
INY
INX
INC $0
LOOP EQU * ; 5 cycles per loop
DEY
BNE LOOP
DEX
BNE LOOP
DEC $0
BNE LOOP
RETURN RTS
* The fastest
INY
INX
INC $0 ; or INC for 65c02
LP EQU *
DEY
BNE LP
BEQ DOX
LOOP EQU *
DEY
DEY
DEY
DEY
DEY
DEY
DEY
DEY
DEY
DEY
DOX EQU *
DEX
BNE LOOP
DEC $0 ; or just DEC for 65c02
BNE LOOP
RETURN RTS