Doc Bot

Download | Tutorials | Instruction Set | Hardware Reference
Introduction | About Doc Bot | Site Map | Search | Use License | Contact Us
Download
Screenshots
Table Of Contents | Addressing Modes | Memory Model | External Ports | Instruction Set | Hardware Reference | Turn Cycles | File format
Table Of Contents | Introduction | Types Of Memory | Special Function Registers | Basic Registers | Addressing Modes | Program Flow | Timers | External Ports | Interrupts | Power Control Modes | Hardware Components
Table Of Contents | Calculate Square Roots | Safe Division

Documentation

small logo

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.

See also:
CALL | RET | RETI

Introduction | About Doc Bot | Site Map | Search | Use License | Contact Us
©2009 Daniel Julivert