Next: , Previous: , Up: Debugging   [Contents][Index]


5.3 Disassembling

If memory contains code, then it’s often useful to see the disassembled instructions corresponding to that code. This can be done with the disassemble command. Figure 5.2 shows a session where the user has disassembled the same memory as in Figure 5.1.

> disassemble 0x00FE0000 55

  fe0000:       1b 03 00 20     ld s, #8192
  fe0004:       00
  fe0005:       aa fa fe 00     jmp 16646154
  fe0009:       0a
  fe000a:       1a fd           lea s, (-3,s)
  fe000c:       bc 62           clr.b (2,s)
  fe000e:       98 00 02 c2     ld x, #706
  fe0012:       0c 30 40        mov.b #48, (0,x)
  fe0015:       98 00 02 c0     ld x, #704
  fe0019:       0c 10 40        mov.b #16, (0,x)
  fe001c:       bd 60           clr.w (0,s)
  fe001e:       20 06           bra *+6
  fe0020:       9d 60           inc.w (0,s)
  fe0022:       a0 60           ld d2, (0,s)
  fe0024:       90 27 10        ld d2, #10000
  fe0027:       f0 60           cmp d2, (0,s)
  fe0029:       22 77           bhi *-9
  fe002b:       a4 62           ld d0, (2,s)
  fe002d:       cc bc           com.b d0
  fe002f:       c4 62           st d0, (2,s)
  fe0031:       98 00 02 c0     ld x, #704
  fe0035:       94 10           ld d0, #16

Figure 5.2: Disassembling the code on the target