Hello,
I'm developing a NES emulator, and I've been using nestest.nes to do so. I've hit a roadblock with one of the instructions. I'll post what I think are the relevant instructions from the Nintendulator nestest.nes log and will expose my problem after that:
My problem is that I don't see how the last opcode changes A to #$AA. According to that log, the location $200 contains #$5A instead, and there are no other instructions that I can see between $CFC7 and $D01C that modify $0200. #$AA is contained in $5A from what I see, not on $0200.
What am I missing?
Thanks in advance.
I'm developing a NES emulator, and I've been using nestest.nes to do so. I've hit a roadblock with one of the instructions. I'll post what I think are the relevant instructions from the Nintendulator nestest.nes log and will expose my problem after that:
Code:
// After this runs, $0200 will contain #$5A
CFC7 STA $0200 = 00 A:5A X:55 Y:69 P:25 SP:FB
...
// After this runs, $5A will contain #$AA
D009 STA ($80,X) @ 80 = 0200 = 5A A:AA X:00 Y:69 P:26 SP:FB
...
// After this runs, A will contain #$AA
D01C LDA $0200 = AA A:AD X:00 Y:69 P:A4 SP:FB
CFC7 STA $0200 = 00 A:5A X:55 Y:69 P:25 SP:FB
...
// After this runs, $5A will contain #$AA
D009 STA ($80,X) @ 80 = 0200 = 5A A:AA X:00 Y:69 P:26 SP:FB
...
// After this runs, A will contain #$AA
D01C LDA $0200 = AA A:AD X:00 Y:69 P:A4 SP:FB
My problem is that I don't see how the last opcode changes A to #$AA. According to that log, the location $200 contains #$5A instead, and there are no other instructions that I can see between $CFC7 and $D01C that modify $0200. #$AA is contained in $5A from what I see, not on $0200.
What am I missing?
Thanks in advance.