Stack and Subroutines
Stack and Subroutines
Subroutines
The Stack
oThe stack is an area of memory identified
by the programmer for temporary storage
of information.
PUSH B
PUSH
D
...
POP D
POP B
● Reversing
the order
of the
POP
instructio
ns will
The PSW Register Pair
o The 8085 recognizes one additional pair
register called the PSW (Program Status Word).
RST Instruction
RESTART, CONDITIONAL CALL
& RETURN INSTRUCTIONS
Conditional CALL
RESTART, CONDITIONAL CALL
& RETURN INSTRUCTIONS
Conditional RETURN
A Proper Subroutine
C00C: OUT 00
C00E: CALL 1420
Writing Subroutines