English
Language : 

PD17012_15 Datasheet, PDF (35/320 Pages) Renesas Technology Corp – 4-BIT SINGLE-CHIP MICROCONTROLLERS WITH DIGITAL TUNING SYSTEM HARDWARE
µPD17012, 17P012
3.4 Operation of Address Stack
3.4.1 On execution of subroutine call (“CALL addr”, “CALL @AR”) or return (“RET”, “RETSK”) instruction
When a subroutine call instruction is executed, the value of the stack pointer is decremented by one and a
return address is saved to the address stack register specified by the stack pointer.
When a return instruction is executed, the contents (return address) of the address stack register specified
by the stack pointer are restored to the program counter, and the value of the stack pointer is incremented by
one.
3.4.2 On execution of table reference instruction (“MOVT DBF, @AR”)
When a table reference instruction is executed, the value of the stack pointer is decremented by one, and
a return address is saved to the address stack register specified by the stack pointer.
Next, the contents of the program memory specified by the address register are read to the data buffer, the
contents (return address) of the address stack register specified by the stack pointer are restored to the program
counter, and then the value of the stack pointer is incremented by one.
3.4.3 On acknowledgement of interrupt and execution of return instruction (“RETI”)
When an interrupt is acknowledged, the value of the stack pointer is decremented by one, and the return
address is saved to the address stack register specified by the stack pointer.
When a return instruction is executed, the contents (return address) of the address stack register specified
by the stack pointer are restored to the program counter, and the value of the stack pointer is incremented by
one.
3.4.4 On execution of address stack manipulation instruction (“PUSH AR”, “POP AR”)
When the “PUSH” instruction is executed, the value of the stack pointer is decremented by one, and the
contents of the address register are transferred to the address stack register specified by the stack pointer.
When the “POP” instruction is executed, the contents of the address stack register specified by the stack
pointer are transferred to the address register, and the value of the stack pointer is incremented by one.
3.5 Notes on Using Address Stack
The nesting level of the address stack is 5 and the value of the address stack register (ASR5) is “undefined”
when the value of the stack pointer is 05H.
Do not use a subroutine call or interrupt exceeding level 5 without manipulating the stack; otherwise,
execution returns to an undefined address.
Data Sheet U10101EJ4V0DS
33