English
Language : 

MC68HC11P2 Datasheet, PDF (217/268 Pages) Motorola, Inc – Microcontrollers
Freescale Semiconductor, Inc.
CPU Core and Instruction Set
Registers
When a subroutine is called by a jump to subroutine (JSR) or branch to
subroutine (BSR) instruction, the address of the instruction after the JSR
or BSR is automatically pushed onto the stack, less significant byte first.
When the subroutine is finished, a return from subroutine (RTS)
instruction is executed. The RTS pulls the previously stacked return
address from the stack, and loads it into the program counter. Execution
then continues from this recovered return address.
When an interrupt is recognized, the current instruction finishes
normally, the return address (the current value in the program counter)
is pushed onto the stack, all of the CPU registers are pushed onto the
stack, and execution continues at the address specified by the vector for
the interrupt. At the end of the interrupt service routine, an RTI instruction
is executed. The RTI instruction causes the saved registers to be pulled
off the stack in reverse order. Program execution resumes at the return
address.
There are instructions that push and pull the A and B accumulators and
the X and Y index registers. These instructions are often used to
preserve program context. For example, pushing accumulator A onto the
stack when entering a subroutine that uses accumulator A, and then
pulling accumulator A off the stack just before leaving the subroutine,
ensures that the contents of a register will be the same after returning
from the subroutine as they were before starting the subroutine.
11.3.5 Program counter (PC)
The program counter, a 16-bit register, contains the address of the next
instruction to be executed. After reset, the program counter is initialized
from one of six possible vectors, depending on operating mode and the
cause of reset.
Table 11-1. Reset vector comparison
POR or RESET pin Clock monitor
Normal
$FFFE, $FFFF
$FFFC, $FFFD
COP watchdog
$FFFA, $FFFB
MC68HC11P2 — Rev 1.0
CPU Core and Instruction Set
For More Information On This Product,
Go to: www.freescale.com
Technical Data