NEC PD17062 User Manual
Page 23

23
µ
PD17062
Fig. 2-3 Operation of Subroutine Call Instruction
(a) Direct subroutine call (CALL addr)
(b) Indirect subroutine call (CALL @AR)
Address
Program memory
Instruction
CALL SUB1
Page 0
Page 1
0 0 0 0 H
0 7 F F H
0 8 0 0 H
0 F 7 F H
CALL SUB1
Address
Program memory
Instruction
Page 0
Page 1
0 0 0 0 H
0 0 1 0 H
0 0 8 5 H
MOV AR0, #5H
MOV AR1, #8H
CALL @AR
Label:
Label:
0 5 0 0 H
SUB1:
RET
0 7 F F H
0 8 0 0 H
0 F 7 F H
SUB2:
SUB3:
RET
MOV AR0, #0H
MOV AR1, #1H
CALL @AR
Fig. 2-4 Sample Uses of Subroutine Call Instruction
(a) If the subroutine return instruction is in page 1
(b) If the first address of the subroutine is in page 1
Address
Program memory
Instruction
CALL SUB1
Page 0
Page 1
0 0 0 0 H
0 7 F F H
0 8 0 0 H
0 F 7 F H
CALL SUB1
Address
Program memory
Instruction
CALL SUB1
Page 0
Page 1
0 0 0 0 H
Label:
Label:
0 5 0 0 H
SUB1:
RET
0 7 F F H
0 8 0 0 H
0 F 7 F H
SUB1:BR
SUB2
0 8 9 0 H
S U B 2 :
CALL SUB1
RET