Hardware Reference
In-Depth Information
in the operand field are interpreted as signed decimal numbers. Placing a $ in front of any num-
ber will cause the number to be interpreted as a hex number.
When an instruction is disassembled and displayed, the D-Bug12 prompt is displayed
following the disassembled instruction. If a carriage return is the first nonspace character
entered following the prompt, the next instruction in memory is disassembled and displayed on
the next line. If an HCS12 instruction is entered following the prompt, the entered instruction
is assembled and placed into memory. The line containing the new entry is erased and the new
instruction is disassembled and displayed on the same line. The next instruction location is
then disassembled and displayed on the screen.
When entering branch instructions, the number placed in the operand field should be the
absolute destination address of the instruction. The assembler calculates the two's complement
offset of the branch and places the offset in memory with the instruction.
The assembly/disassembly process may be terminated by entering a period as the first non-
space character following the assembler prompt.
The following example displays the assembly instructions from memory location $2000
until $2011. The carriage-return character is entered at the + prompt of each line and the period
character is entered at the last line.
+ asm 2000
2000
FC0800
LDD
$0800
.
2003
CD0900
LDY
#$0900
.
2006
CE000A
LDX
#$000A
.
2009
1810
IDIV
.
200B
CB30
ADDB
#$30
.
200D
6B44
STAB
4,Y
.
200F
B7C5
XGDX
.
2011
CE000A
LDX
#$000A
. .
.
The following example enters a short program that consists of three instructions starting
from the memory location at $1500:
+ asm 1500
1500
FC0800
LDD
$0800
1503
F30802
ADDD
$0802
1506
7C0900
STD
$0900
1509
E78C
TST
12,SP
. .
.
br [ * Address + …]
The br ( breakpoint set ) command sets a breakpoint at a specified address to display any pre-
viously set breakpoints. The function of a breakpoint is to halt user program execution when
the program reaches the breakpoint address. When a breakpoint address is encountered, D-
Bug12 disassembles the instruction at the breakpoint address, prints the CPU register contents,
and waits for a D-Bug12 command to be entered by the user.
Breakpoints are set by typing the breakpoint command followed by one or more breakpoint
addresses. Entering the breakpoint command without any breakpoint addresses will display all
the currently set breakpoints. A maximum of two user breakpoints may be set at one time.
Whenever the user program is not working correctly and the user suspects that the instruction
at a certain memory location is incorrect, he or she can set a breakpoint at that location and
check the execution result by looking at the contents of CPU registers or memory locations.
 
Search WWH ::




Custom Search