I'm just getting started on my CPU and am using nestest.log to verify that I'm getting things right. It's already helped me spot a few bugs, which is really just insanely great.
One thing I've got hung up on, though, is the behavior of PLA. For example,
Here, I should be
a) pushing P (0x6F) at SP (0xFB) (and decrementing SP)
b) and then loading it back into A (and incrementing SP)
This seems mostly right, but I'm confused about two things:
1) Why is the value being loaded into A 0x7F instead of 0x6F?
2) What flags do the stack instructions affect? 6502.org seems to be silent on this, and the 650x datasheet that looks like it might have this information is totally unreadable.
TIA for any pointers.
One thing I've got hung up on, though, is the behavior of PLA. For example,
Code:
C7E7 08 PHP A:00 X:00 Y:00 P:6F SP:FB CYC:193 SL:242
C7E8 68 PLA A:00 X:00 Y:00 P:6F SP:FA CYC:202 SL:242
C7E9 29 EF AND #$EF A:7F X:00 Y:00 P:6D SP:FB CYC:214 SL:242
C7E8 68 PLA A:00 X:00 Y:00 P:6F SP:FA CYC:202 SL:242
C7E9 29 EF AND #$EF A:7F X:00 Y:00 P:6D SP:FB CYC:214 SL:242
Here, I should be
a) pushing P (0x6F) at SP (0xFB) (and decrementing SP)
b) and then loading it back into A (and incrementing SP)
This seems mostly right, but I'm confused about two things:
1) Why is the value being loaded into A 0x7F instead of 0x6F?
2) What flags do the stack instructions affect? 6502.org seems to be silent on this, and the 650x datasheet that looks like it might have this information is totally unreadable.
TIA for any pointers.