Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BASIC] Replace ldy #0 + (zp),y addressing with (zp) addressing #350

Merged
merged 6 commits into from
Aug 11, 2024
25 changes: 10 additions & 15 deletions basic/code17.s
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ val_str bne @1
bcc val2
inx
val2 stx index2+1
ldy #0
lda (index2),y
lda (index2)
pha
tya ;a=0
sta (index2),y
lda #0
sta (index2)
jsr chrgot
jsr finh
pla
ldy #0
sta (index2),y
sta (index2)
st2txt ldx strng2
ldy strng2+1
stx txtptr
Expand All @@ -45,11 +43,10 @@ getadr0 jsr getadr
sta poker+1
rts
peek jsr getadr0
ldy #0
lda poker+1
cmp #$a0
bcs peek1
lda (poker),y ;Low RAM
lda (poker) ;Low RAM
jmp peek2
peek3 stz ram_bank
ldx crombank
Expand All @@ -59,7 +56,8 @@ peek3 stz ram_bank
peek1 cmp #$c0
bcs peek3
ldx crambank
peek4 lda #poker ;High RAM or ROM
peek4 ldy #0
lda #poker ;High RAM or ROM
jsr fetch
peek2 tay
dosgfl jmp sngflt
Expand All @@ -76,8 +74,7 @@ poke jsr frmadr
cmp #$a0
bcs pokefr
txa
ldy #0
sta (poker),y
sta (poker)
rts
pokefr2 stz ram_bank
txa
Expand All @@ -100,8 +97,7 @@ fnwait jsr getnum
beq stordo
jsr combyt
stordo stx eormsk
ldy #0
waiter lda (poker),y
waiter lda (poker)
eor eormsk
and andmsk
beq waiter
Expand Down Expand Up @@ -258,8 +254,7 @@ mlex10
adc tenexp ;like multiplying by five.
asl a ;and now by ten.
clc
ldy #0
adc (txtptr),y
adc (txtptr)
sec
sbc #'0'
mlexmi
Expand Down
Loading