Stack Instructions
PUSH (#|&|@|R|@R)op1- Opcode: 0xC0
- Addresses: 2
- Flags: none
- Registers: SP, Stack
- Function: Push op1 into stack
PUSH first increments the value of the Stack Pointer (SP) by 1. Then it takes the value of op1 into the stack, that is, writes it to the internal memory address pointed to by SP.
POP (#|&|@|R|@R)op1- Opcode: 0xD0
- Addresses: 2
- Flags: none
- Registers: SP, Stack
- Function: Pop value from stack into op1
Copies the last value placed on the stack, that is, the internal memory address pointed to by the Stack Pointer (SP), into the memory address pointed to by op1. The Stack Pointer (SP) is then decremented by 1. Note that if op1's addressing mode is immediate, the value retrieved from the stack will overwrite the current value of op1.