Motorola HC12 Refrence Manual page 91

Table of Contents

Advertisement

BGND
Description:
BGND operates like a software interrupt, except that no registers are
stacked. First, the current PC value is stored in internal CPU register
TMP2. Next, the BDM ROM and background register block become ac-
tive. The BDM ROM contains a substitute vector, mapped to the address
of the software interrupt vector, which points to routines in the BDM
ROM that control background operation. The substitute vector is
fetched, and execution continues from the address that it points to. Fi-
nally, the CPU checks the location that TMP2 points to. If the value
stored in that location is $00 (the BGND opcode), TMP2 is incremented,
so that the instruction that follows the BGND instruction is the first in-
struction executed when normal program execution resumes.
For all other types of BDM entry, the CPU performs the same sequence
of operations as for a BGND instruction, but the value stored in TMP2
already points to the instruction that would have executed next had BDM
not become active. If active BDM is triggered just as a BGND instruction
is about to execute, the BDM firmware does increment TMP2, but the
change does not affect resumption of normal execution.
While BDM is active, the CPU executes debugging commands received
via a special single-wire serial interface. BDM is terminated by the exe-
cution of specific debugging commands. Upon exit from BDM, the back-
ground/boot ROM and registers are disabled, the instruction queue is
refilled starting with the return address pointed to by TMP2, and normal
processing resumes.
BDM is normally disabled to avoid accidental entry. While BDM is dis-
abled, BGND executes as described, but the firmware causes execution
to return to the user program. Refer to
AND DEBUG SUPPORT
Condition Codes and Boolean Formulas:
S
None affected.
Addressing Modes, Machine Code, and Execution Times:
Source Form
BGND
CPU12
REFERENCE MANUAL
Enter Background Debug Mode
X
H
I
N
Z
Address Mode
INH
00
INSTRUCTION GLOSSARY
SECTION 8 DEVELOPMENT
for more information concerning BDM.
V
C
Object Code
BGND
Cycles
Access Detail
5
VfPPP
MOTOROLA
6-31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents