T.I.M | ISA Specification
 All Pages
POP

Description

Loads the top four bytes of the stack into the destination register.

Register Access

The POP instruction can write to any register so long as the supervisor mode bit is set in the Status Register. Otherwise, it can write to any of the general purpose or temporary registers. If it tries to write to a register is should not, it is treated as a NOP.

POP also causes the Stack Pointer register to be decremented.

Memory Layout

This is a 2 byte instruction. The GP/SR bit determines whether the destination register is addressing the general purpose register bank or the special purpose / temporary register bank.

Opcode | Condition Code | GP/SR | Destination | Don't Care
000101 | 00 | 1/0 | DDDD | ???

Assembly Code Examples

1. | POP $R2 ; Pop to general purpose register 2.
2. | POP $PC ; Pop to the program counter to return from a function.
See Also
Instructions Quick Reference, PUSH