ROHS MC9S08QE128 Reference Manual page 67

Table of Contents

Advertisement

4.4.3.1.1
Program Space
The PPAGE register holds the page select value for the paging window. The value in PPAGE can be
manipulated by using normal read and write instructions as well as the CALL and RTC instructions. The
user should not change PPAGE directly when running from paged memory, only CALL and RTC should
be used.
When the MMU detects that the CPU is addressing the paging window, the value currently in PPAGE will
be used to create an extended address that the MCU's decode logic will use to select the desired flash
location.
As seen in
Figure
4-1, the flash blocks in the CPU addressable memory can be accessed directly or using
the paging window and PPAGE register. For example, the flash from location 0x4000-0x7FFF can be
accessed directly or using the paging window, PPAGE = 1, address 0x8000-0xBFFF.
4.4.3.1.2
CALL and RTC (Return from Call) Instructions
CALL and RTC are instructions that perform automated page switching when executed in the user
program. CALL is similar to a JSR instruction, but the subroutine that is called can be located anywhere
in the normal 64K byte address space or on any page of program memory.
During the execution of a CALL instruction, the CPU:
Stacks the return address.
Pushes the current PPAGE value onto the stack.
Writes the new instruction-supplied PPAGE value into the PPAGE register.
Transfers control to the subroutine of the new instruction-supplied address.
This sequence is not interruptible; there is no need to inhibit interrupts during CALL execution. A CALL
can be executed from any address in memory to any other address.
The new PPAGE value is provided by an immediate operand in the instruction along with the address
within the paging window, 0x8000-0xBFFF.
RTC is similar to an RTS instruction.
The RTC instruction terminates subroutines invoked by a CALL instruction.
During the execution of an RTC instruction, the CPU:
Pulls the old PPAGE value from the stack and loads it into the PPAGE register
Pulls the 16-bit return address from the stack and loads it into the PC
Resumes execution at the return address
This sequence is not interruptible; there is no need to inhibit interrupts during RTC execution. An RTC
can be executed from any address in memory.
Freescale Semiconductor
MC9S08QE128 MCU Series Reference Manual, Rev. 2
Chapter 4 Memory
67

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for ROHS MC9S08QE128

This manual is also suitable for:

Mc9s08qe96Mc9s08qe64

Table of Contents