On Thu, Feb 06, 2003 at 06:12:28AM +0000, James Daniels wrote:
> I believe this might be the source of the problems because inside some
> of my routines I'm storing the stack (r13) and then using it as a
> general purpose register. Of course, I restore the stack before
> returning or calling another function so there's not normally a problem.
> However, if an interrupt were to occur whilst r13 contained something
> other than the stack then random areas of memory would be corrupted.
Interrupts use a different stack pointer from the user stack pointer.
So, unless these other routines are also being run in IRQ mode, or your
startup code is doing something funny to the position of the IRQ mode
stack, everything should be fine on that front.
Hi all, I've also posted this question on the gbadev.org forums so I apologise if you've also read this there. Anyway, I'm using interrupts in my code and most...
Hi James. ... Interrupts use a different stack pointer from the user stack pointer. So, unless these other routines are also being run in IRQ mode, or your ...
... That's funny, works fine for me. Am I confusing something? (I just tested it, with some hblank and vblank effects driven by interrupts, while the main...
Seriously, IRQ mode is a completely seperate processor mode - it has it's own set of certain registers it IS ok to play with r13 as long as you don't do it...
Hi, I'm the author of the "Girlfriend Advance" emulator. If I can remember well, the interrupt just save the current PC value and jump in the bios, with...
Vincent Cantin
karma@...
Feb 6, 2003 5:56 pm
Hi Julian, ... I've just done what I should have done before and confirmed that the stack value is sensible inside the interrupt and it always is, so you must...
Hi James, ... That's right, there are two stack pointers. I originally found out about this when writing (the equivalent of) crt0.s for a recent project. So,...
You're absolutely correct. However, it would be possible for the BIOS to do funky things with the stacks, if it chose to. I do not believe that the BIOS does...
Mike Schwartz
mykes@...
Feb 6, 2003 10:29 pm
Hi Julian, ... Thanks for the help! ... Surely the interrupt stack is 224 bytes big in this case? Also, why does the interrupt stack need to start so far away...
Hi James, ... Hah, you're absolutely right. I must have mentally switched between hex and decimal mode while writing that comment. ... One could put it at...
Hi Julian, ... I just did a bit more research and discovered the following (from the GBATEK spec): * * * Default memory usuage at 03007FXX (and mirrored to...
From: "Julian Squires" <tek@...> ... i should have been clearer. i believe i had multiple interrupts enabled, which uses the normal stack as the interrupt...