beautypg.com

NEC PD75402A User Manual

Page 38

background image

CHAPTER 3. FEATURES OF ARCHITECTURE AND MEMORY MAP

27

(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

........

This manual is related to the following products: