CrazyBoss Posted September 26, 2016 Share Posted September 26, 2016 Hi I am converting a ColecoVision game, but this game using two interrupt handles. The NMI and also RST38. Its quite common to use NMI, but can anyone explain how the RST38 works. I added a breakpoint at the address RST38 calls in the code, and in some parts of the game is called seldom, and in other parts its called quite often. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 2, 2016 Share Posted October 2, 2016 Several Colecovision games use RST 38H as a way to save bytes, because all RST xx instructions are effectively CALL 00xx Inside the Colecovision BIOS every vector for RST instructions is made to jump to known locations inside the cartridge memory, that in turn jump to game code. RST 08H - jumps to 800CH RST 10H - jumps to 800FH RST 18H - jumps to 8012H RST 20H - jumps to 8015H RST 28H - jumps to 8018H RST 30H - jumps to 801BH RST 38H - jumps to 801EH You could think "what I can do with 3 bytes?" just put a JP instruction to jump to anywhere in your game. So using RST as a way to save bytes is effective, but not for getting speed The only one non-useful is RST 00H because it's same as pressing RESET button. 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.