Just Jeff Posted April 5, 2020 Share Posted April 5, 2020 What would happen if code was running in RAM and hit address $00ff? (assuming the stack was clear or saved) Quote Link to comment Share on other sites More sharing options...
alex_79 Posted April 5, 2020 Share Posted April 5, 2020 (edited) Unless that last instruction of the code jumps somewhere else, the cpu would continue reading the next instruction at the following address, that is $0100. But $0100 is a mirror of $00 in the VCS and that's in the area where TIA registers are mapped, so the program would interpret what it reads there (the collision registers) as code and would likely crash (or behave in an unintended way in any case) Edited April 5, 2020 by alex_79 Quote Link to comment Share on other sites More sharing options...
NoLand Posted April 6, 2020 Share Posted April 6, 2020 Particularly, when reading from the TIA, there are 00 ... CXM0P 01 ... CXM1P 02 ... CXP0FB Meaning, if there's no collision, the CPU will execute a BRK instruction ($00). Quote Link to comment Share on other sites More sharing options...
JetSetIlly Posted April 6, 2020 Share Posted April 6, 2020 (edited) Quote Particularly, when reading from the TIA, there are 00 ... CXM0P 01 ... CXM1P 02 ... CXP0FB Meaning, if there's no collision, the CPU will execute a BRK instruction ($00). It depends which RAM mirror you read from. In the case of the primary mirror, allowing the PC to get to $0100 will mean the next instruction loaded is an ORA command (byte code $01). That's without collisions. With collisions, the opcode will variously be $11, $21 or $31. None of which would be particularly useful. As far as I can see, there's no useful mirror/opcode/collision combination that would result in a branch command or jump command. Which is a shame, because that might actually be useful. Edited April 6, 2020 by JetSetIlly 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.