Hardware Reference
In-Depth Information
of the br command are not placed in the user code before program execution begins. Program
execution begins at the address defined by the current value of the program counter. When user
code reaches the temporary breakpoint and control is returned to D-Bug12, a message is dis-
played explaining the reason for user program termination. In addition, D-Bug12 disassembles
the instruction at the current PC address, prints the CPU register contents, and waits for a com-
mand to be entered by the user.
Example 3.12
+ pc 1500
PP PC
SP
X
Y
D 5 A:B
CCR 5 SXHI
NZVC
38 1500
3C00
1000
1002
00:00
1001
0101
xx: 1500 CF1500
LDS
#$1500
+ gt 1540
Temporary Breakpoint Encountered
PP PC
SP
X
Y
D 5 A:B
CCR 5 SXHI
NZVC
38 1510
1500
1000
1002
1E:00
1001
0000
xx: 1510 3B
PSHD
.
t [ * count + ]
The t ( trace ) command is used to execute one or several user program instructions begin-
ning at the current program counter location. As each instruction is executed, the CPU register
contents and the next instruction to be executed are displayed. A single instruction may be
executed by entering the trace command immediately followed by a carriage return.
Because of the method used to execute a single instruction, branch instructions (Bcc, LBcc,
BRSET, BRCLR, DBEQ/NE, IBEQ/NE, and TBEQ/NE) that contain an offset that branches back
to the instruction opcode do not execute. D-Bug12 appears to become stuck at the branch in-
struction and does not execute the instruction even if the condition for the branch instruction
is satisfied. This limitation can be overcome by using the gt command to set a temporary break-
point at the instruction following the branch instruction.
Example 3.13
+ pc 1500
PP PC
SP
X
Y
D 5 A:B
CCR 5 SXHI
NZVC
38 1500
1500
1000
1002
1E:00
1001
0000
xx: 1500 CF1500
LDS
#$1500
+ t
PP PC
SP
X
Y
D 5 A:B
CCR 5 SXHI
NZVC
38 1503
1500
1000
1002
1E:00
1001
0000
xx: 1503 CE1000
LDX
#$1000
+ t 2
PP PC
SP
X
Y
D 5 A:B
CCR 5 SXHI
NZVC
38 1506
1500
1000
1002
1E:00
1001
0000
xx: 1506
34
PSHX
 
Search WWH ::




Custom Search