mc9s08dz32amlfr Freescale Semiconductor, Inc, mc9s08dz32amlfr Datasheet - Page 152

no-image

mc9s08dz32amlfr

Manufacturer Part Number
mc9s08dz32amlfr
Description
Hcs08 Microcontrollers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Chapter 7 Central Processor Unit (S08CPUV5)
The RTC instruction is used to terminate subroutines invoked by a CALL instruction. RTC unstacks the
PPAGE value and the return address, the queue is refilled, and execution resumes with the next instruction
after the corresponding CALL.
The actual sequence of operations that occur during execution of RTC is:
Since the return operation is implemented as a single uninterruptable CPU instruction, the RTC can be
executed from anywhere in memory, including from a different page of extended memory in the overlay
window.
The CALL and RTC instructions behave like JSR and RTS, except they have slightly longer execution
times. Since extra execution cycles are required, routinely substituting CALL/RTC for JSR/RTS is not
recommended. JSR and RTS can be used to access subroutines that are located outside the program overlay
window or on the same memory page. However, if a subroutine can be called from other pages, it must be
terminated with an RTC. In this case, since RTC unstacks the PPAGE value as well as the return address,
all accesses to the subroutine, even those made from the same page, must use CALL instructions.
152
1. The return value of the 8-bit PPAGE register is pulled from the stack.
2. The 16-bit return address is pulled from the stack and loaded into the PC.
3. The return PPAGE value is written to the PPAGE register.
4. The queue is refilled and execution begins at the new address.
MC9S08DZ128 Series Data Sheet, Rev. 1
Freescale Semiconductor

Related parts for mc9s08dz32amlfr