Subroutines & Stack: Dr. Farid Farahmand Updated: 2/18/2019
Subroutines & Stack: Dr. Farid Farahmand Updated: 2/18/2019
l PUSH
l Increment the memory address in the stack pointer (by
one) and stores the contents of the counter (PC+2) on the
top of the stack
l POP
l Discards the address of the top of the stack and
decrement the stack pointer by one
l The contents of the stack (21-bit address), pointed
by the stack pointer, are copied into three special
function registers
l TOSU (Top-of-Stack Upper), TOSH (High), and TOSL (Low)
TOSU TOSH TOSL
Instructions to Store and Retrieve Information
from the Stack
Org 0x20
? ?
END ;ending directive
Org 0x20
Org 0x40
2-Word Instructions