CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP
44 Users Manual U10676EJ3V0UM
(7) Stack addressing
This addressing mode is used to save or restore data when interrupt servicing or subroutine processing is
executed.
The address of data memory bank 0 pointed to by the stack pointer (8 bits) is specified in this addressing mode.
In addition to being used during interrupt servicing or subroutine processing, this addressing is also used to
save or restore register contents by using the PUSH or POP instruction.
Examples 1. To save or restore register contents during subroutine processing
SUB : PUSH XA
PUSH HL
PUSH BS ; Saves MBS and RBS
POP BS
POP HL
POP XA
RET
2. To transfer contents of register pair HL to register pair DE
PUSH HL
POP DE ; DE HL
3. To branch to address specified by registers [XABC]
PUSH BC
PUSH XA
RET ; To branch address XABC