SX Embedded Controller Instruction

PopPC (DW $04F)

Description: Pop the contents of MW from the "PCstack"
Operation: M : W = PCstack[PSP--]
Flags affected: ?
Registers affected: M : W 
Sources referenced: PCstack
Cycles: 1
Opcode: $04F
Details: Secret Instructions Page
Microchip PIC syntax: n/a
Notes:

The PCstack is only two levels deep and is used by both the interrupt and the debug system. If you don't set a breakpoint or happen to break into debug while in an ISR, you can use one level without concern. If you don't use interrupts or debug, you can use both levels.

After an interrupt occurs, the value of PC just prior to the interrupt is saved onto this PCstack. So your ISR can find out exactly what was going on when it was invoked with the PopPC command.

To use this instruction, first define the following macro.

PopPC macro
 DW $04F
 endm