next up previous contents

[ENGN3213 Home]

The dBug Monitor

The dBug monitor provides a text-based interface for you to interact with the SBC. The main dBug commands we will use are shown in Table 1.


 
Table 1: Main dBug Commands
command description syntax
bf block fill bf (width) begin end data
bm block move bm begin end dest
bs block search bs (width) begin end data
br breakpoint br addr (-r)
data data convert data value
di disassemble di (addr)
dl download serial dl (offset)
go execute go (addr)
gt go till breakpoint gt (addr)
help help help (command)
md memory display md (width) (begin) (end)
mm memory modify mm (width) addr (data)
rd register display rd (reg)
rm register modify rm reg data
reset reset reset
step step (over) step
trace trace (into) trace (num)
 

Rather than go through a lengthy explanation of each command, it is probably more efficient for you to learn by doing, and make use of the help command. For example, type rd at the dBug prompt to see the current register contents.

Let's enter and run the following code fragment by hand:

10000    303C 2468         move.w #0x2468,%d0
10004    33C0 0002         move.w %d0,0x20000
         0000 
1000a    7000              move.l #0x0000,%d0
1000c    4E4F              trap   #15

This is similar to code we used for the BSVC simulator. However, the last two instructions are used to provide a graceful means for exiting back to the dBug monitor.

Enter this code beginning at memory location 0x10000:

1.
At the dBug prompt, type mm 10000

2.
Enter each word in sequence.

3.
When complete, enter . (i.e. period) to return to the dBug prompt.

4.
Check your entry by typing di 10000 to disassemble the Coldfire machine code.

Next, run the code and check for correct operation:

1.
At the dBug prompt, type
go 10000
to begin execution of your code beginning at memory location 0x10000.

2.
When the program has run (it should be very quick), you will be returned to the dBug prompt. If not, a reset may occur, indicating there was an error.

3.
Now check to see that the program worked by checking the contents of memory location 0x20000 by typing md 20000. You should see 0x2468 there (1 word, 2 bytes, locations 0x20000 and 0x20001).

From now one we will use the gcc cross development system to assemble/compile our code. This system will automatically take care of initialization termination issues associated with user programs. All code will start at memory address 0x10000.


next up previous contents

[ENGN3213 Home]

ANU Engineering - ENGN3213