Quote:
Anyway, the code runs, but only seems to get the LSB of the address, thus loading the data in ScreenFake, not Screen_PF1...
What am I doing wrong?
You don't show your macro definitions, but it sounds like SET_POINTER is only taking care of one byte, and not putting the 1 (high byte of Screen_PF1's 1FF) at the next byte after the FF at PF1_pointer.
Quote:
it told me it was an illegal addressing mode...
It's standard for all CMOS 6502's. AFAIK, the NMOS one have not been made in two decades, but Western Design Center is making CMOS ones with no end in sight, with more instructions and addressing modes than the NMOS ones had. You might need to tell your assembler you're using CMOS by using the line "processor 65c02", if indeed you are. The only reason
not to use CMOS is if you're using old hardware like the Commodore 64 which used the 6510 which was never avaialble in a CMOS version. With an NMOS 6502, your putting 0 in Y and using LDA (ZP),Y is the best way to do it.
Depending on whether the stack is getting initialized at 1FF at reset and whether there's a system running in the background that might eat up a lot of stack space, it might be a little dangerous to put Screen_PF1 in $01AA where it could get stepped on by the stack. Page 1, especially high in the page, is generally not a good place to put variables.
When you list code on this forum, in order to keep the spaces from getting gobbled up and everything shoved against the left margin, bracket the code with left-square-bracket CODE right-square-bracket (or just mark the block and then click "Code"), and uncheck the "disable BB code" box at the bottom.