Motorola CPU32 Reference Manual page 295

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

If a bus error or address error occurs on the first instruction prefetch
from the new PC, the processor exits BDM and the error is trapped
as a normal mode exception. The stacked value of the current PC
may not be valid in this case, depending on the state of the machine
prior to entering BDM. For address error, the PC does not reflect the
true return PC. Instead, the stacked fault address is the (odd) return
PC.
Command Format:
15
14
13
0
0
0
Command Sequence:
CALL
???
Operand Data:
The 32-bit operand data is the starting location of the patch routine, which is the
initial PC upon exiting BDM.
Result Data:
None
As an example, consider the following code segment. It is supposed to output a char-
acter to an asynchronous communications interface adaptor — note that the routine
fails to check the transmit data register empty (TDRE) flag.
CHKSTAT:
MISSING:
BDM and the CALL command can be used to patch the code as follows:
1. Breakpoint user program at CHKSTAT
2. Enter BDM
3. Execute CALL command to MISSING
4. Exit BDM
5. Execute MISSING code
6. Return to user program.
CPU32
REFERENCE MANUAL
12
11
10
9
0
1
0
0
MS ADDR
LS ADDR
"NOT READY"
"NOT READY"
XXX
NEXT CMD
"ILLEGAL"
"NOT READY"
MOVE.B
ACIAS,D0
BEQ.B
CHKSTAT
MOVE.B
DATA,ACIAD
ANDI.B
#2,D0
RTS
DEVELOPMENT SUPPORT
8
7
6
5
0
0
0
0
STACK
RETURN PC
BERR/AERR
FREEZE
NEGATED
PREFETCH
STARTED
Move ACIA status to D0
Loop till condition true
Output data
Check for TDRE
Return to in-line code
4
3
2
1
0
0
0
0
XXX
NEXT CMD
"NOT READY"
NORMAL
MODE
MOTOROLA
0
0
7-23

Advertisement

Table of Contents
loading

Table of Contents