Jump to content
IGNORED

RST38 Vector?


CrazyBoss

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

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.

Guest
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.

Loading...
  • Recently Browsing   0 members

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