Jump to content
IGNORED

5200 vs. A8 interrupt handling


Recommended Posts

For starters, the RAM based vector locations are different.

 

But, looking at a disassembly http://atarihq.com/danb/files/5200BIOS.txt

 

Things aren't too much different.

 

Both machines on IRQ jump through an immediate IRQ vector, without doing anything to the registers (although XL and later performs a CLD).

 

Both machines push A to the stack in their immediate IRQ routine. Then later on also push X. So, an IRQ routine would need to take action dependant on it's type (nothing, pull A, pull X and A).

 

NMI routines seeem to be an entire different matter.

 

Both machines do nothing if it's a DLI - giving the user control without any register saving.

 

But: in a VBI, the 5200 does not save any registers before passing through the Immediate VBlank vector, where the computer saves all registers.

 

So, on the computer, you return from VBlank simply by jumping either to $E45F or $E462.

 

On the 5200, you are responsible for saving/restoring any registers you use.

Link to comment
Share on other sites

For starters, the RAM based vector locations are different.

 

But, looking at a disassembly http://atarihq.com/danb/files/5200BIOS.txt

 

Things aren't too much different.

 

Both machines on IRQ jump through an immediate IRQ vector, without doing anything to the registers (although XL and later performs a CLD).

 

Both machines push A to the stack in their immediate IRQ routine. Then later on also push X. So, an IRQ routine would need to take action dependant on it's type (nothing, pull A, pull X and A).

 

NMI routines seeem to be an entire different matter.

 

Both machines do nothing if it's a DLI - giving the user control without any register saving.

 

But: in a VBI, the 5200 does not save any registers before passing through the Immediate VBlank vector, where the computer saves all registers.

 

So, on the computer, you return from VBlank simply by jumping either to $E45F or $E462.

 

On the 5200, you are responsible for saving/restoring any registers you use.

OK, thanks - that must be it. In the VBI it is screwing up the registers since it isn't saving them and then screwing up the stack pointer since it pulls three values off the stack (that it didn't push to begin with) before returning.

 

I think the only interrupts in Squish 'Em are a (giant) DLI, a VBI, and the keyboard. So I think if I add code to save the registers at the beginning of the VBI I should fix that problem.

 

Thanks again.

Edited by vdub_bobby
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...