NEC PD75P402, PD75402A Stack addressing, SUB Push POP RET, Push HL POP, Push HL Push XA RET

Models: PD75402A PD75P402

1 195
Download 195 pages 45.34 Kb
Page 38
Image 38

CHAPTER 3. FEATURES OF ARCHITECTURE AND MEMORY MAP

(6) Stack addressing

This addressing mode is for the saving/restoring operation during the interrupting process, subroutine process. The data memory is addressed indirectly according to the content of the stack pointer (SP : 8 bits).

The memory bank (MB) addressed in this addressing mode is fixed to 0. Also as the stack pointer’s high-order 3 bits are fixed to 001, the addressable area is limited to 020H to 03FH.

This addressing mode is also applied at register save/restore by the PUSH, POP instruction in addition to the interrupting process, subroutine process.

Note The Evachip packaged on the board for evaluation can address the whole area of Memory bank 0 in this addressing mode unlike in the μPD75402A. To eliminate such a difference during the evaluation, a value

not to access beyond the range of 20H to 3FH should be set in the stack pointer.

Example 1. Save/restore the register during the subroutine process.

SUB:

PUSH

XA

 

PUSH

HL

 

 

........

 

POP

HL

 

POP

XA

 

RET

 

2.Transfer the content of the HL register pair to the XA register pair.

PUSH HL

POP

XA

; XA HL

3.Branch to the address indicated by the (XAHL) register.

PUSH HL

PUSH XA

RET

; Branch to address XAHL

27

Page 38
Image 38
NEC PD75P402, PD75402A user manual Stack addressing, SUB Push POP RET, Push HL POP, Push HL Push XA RET