Jump to content

Running code in RAM

Just Jeff

Recommended Posts

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 by alex_79
Link to comment
Share on other sites


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 by JetSetIlly
  • Like 4
Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...