View Single Post
Old 9th Jul 2019, 8:03 am   #22
julie_m
Dekatron
 
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
Default Re: Fun with 6502 Assembler

Spot the schoolgirl error:
Code:
.dotest
LDY offsets,X
LDA (fxb),Y
INX
LDY offsets,X
CMP (mvb),Y
PHP \ save C,N,Z flags
INX \ will trash comparison result
PLP \ restore real result
RTS
In case you need context, it's called from a routine doing a bunch of comparisons on arrays of bytes starting at the addresses in fxb, fxb+1 and mvb, mvb+1; and it's doing them out-of-order. Hence the table of offsets indexed by X.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments.
julie_m is offline