NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: RTI / RTS, Interrupt Questions  
Posted byTimW
Posted on9/6/03 1:32 PM
From IP209.179.226.47  



/*
JSR

* PC is next instruction (minus 1) <-- is that right?

- Push high byte of PC
- Push low byte of PC
- jump to new address

So... RTS:
- Pull low byte of PC
- Pull high byte of PC
- Add 1 to PC
*/

right

/*
if BRK, PC is next instruction + 1 (padding byte)
* if IRQ, PC is next instruction

- Push high byte of PC
- Push low byte of PC
- Push Processor status (B flag set on break, cleared on IRQ, R always set)
- Set I flag ??? <-- is this right?
- Jump to address at $FFFE-$FFFF

So to compliment this... RTI would:
- Pull Processor Status
- Pull low byte of PC
- Pull high byte of PC
*/
sounds good except on brk you push PC+2



-
Entire Thread
Subject  Posted byPosted On
*RTI / RTS, Interrupt Questions  Disch9/5/03 8:21 PM
..Re: RTI / RTS, Interrupt Questions  TimW9/6/03 1:32 PM
.*Re: RTI / RTS, Interrupt Questions  quietust9/5/03 8:47 PM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo