mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-12 15:30:55 +00:00
entropy: optimize nextx
This commit is contained in:
parent
ed747e349f
commit
6a0aaeb009
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
; Optimization
|
; Optimization
|
||||||
; 144 bytes: first working version (including DOS33 4-byte size/addr)
|
; 144 bytes: first working version (including DOS33 4-byte size/addr)
|
||||||
|
; 141 bytes: optimize "nextx" routine
|
||||||
|
|
||||||
;BLT=BCC, BGE=BCS
|
;BLT=BCC, BGE=BCS
|
||||||
|
|
||||||
@ -171,17 +172,17 @@ nextx: ; NEXT X
|
|||||||
clc ; 1
|
clc ; 1
|
||||||
adc #6 ; x+=6 ; 2
|
adc #6 ; x+=6 ; 2
|
||||||
sta XPOS ; 2
|
sta XPOS ; 2
|
||||||
|
tax ; save in X for later ; 1
|
||||||
|
|
||||||
lda #0 ; inc high bit if we wrap past 256 ; 2
|
lda #0 ; inc high bit if we wrap past 256 ; 2
|
||||||
adc XPOSH ; 2
|
adc XPOSH ; 2
|
||||||
sta XPOSH ; 2
|
sta XPOSH ; 2
|
||||||
|
|
||||||
beq xloop ; if high byte zero, not at end ; 2
|
beq xloop ; if high byte zero, not at end ; 2
|
||||||
lda XPOS ; 2
|
cpx #22 ; see if less than 278 ; 2
|
||||||
cmp #22 ; see if less than 278 ; 2
|
|
||||||
bcc xloop ; if so, loop ; 2
|
bcc xloop ; if so, loop ; 2
|
||||||
;============
|
;============
|
||||||
; 21
|
; 20
|
||||||
nexty: ; NEXT Y
|
nexty: ; NEXT Y
|
||||||
lda YPOS
|
lda YPOS
|
||||||
clc
|
clc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user