On 5/6/2022 at 10:19 AM, TomXP411 said:
You're right. I misread that when I looked at it yesterday. There is no Zero Page Y-Indexed address mode for LDA. I was looking at the X-Indexed instructions. ?
Regardless, if LDA $0024,Y won't assemble, that is clearly a bug. Likewise, if LDA $0024,X produces a zero-page mode rather than the absolute indexed mode, that is also an error. While it's a fine point, there are reasons to produce the absolute vs zero page instruction from time time to time. The biggest reason being that if the code is intended to ever be run on a 65816, there is no Zero Page. The '816 has "Direct Page" which can actually be relocated, so $24 and $0024 are not actually the same address! So when writing an assembler, it's critical that address mode hints (two vs four digits) be followed correctly.
Good point. If I were writing 65816 code, I'd keep that in mind, but I'm just working specifically on x16 code, so the 'direct page' issue isn't really relevant. The main reason I'm using ABS,Y on the zero page is I'm performing a direct transfer to the zero page from indirect addresses. My code therefore operates as thus:
LDY #$00
*LDA (src),Y
STA dest,Y
INY
CPY #limit
BCC -
It is being used specifically for screen blanked video tile loading or file access, so speed isn't quite as important as code density (besides which, adding an LDX #$00 before the loop and an INX inside the loop would take longer, even replacing STA dest,Y with STA dest,X).