Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-003
F-35
Native Program Example
LMAP Command (Continued)
Note that address 0x7000057C contains a JAL. The address points to the
EXAMPLE_INIT procedure. We can see this using the LMAP command:
After the NOP in the delay slot, we see the parameters being set up for the next JAL.
The SEGMENT_ALLOCATE_ procedure can accept a variable number of parameters;
register A0 is a mask indicating which parameters are being passed. Some of the
parameters are passed in registers and others are passed on the stack. Register A1
contains the segment number and A2, the length. The pointer to ERROR_DETAIL,
$SP + 68, is stored at $SP + 20. So, for the first call to SEGMENT_ALLOCATE_, we
see this sequence of output:
The results from SEGMENT_ALLOCATE_ are stored in ERROR_MAIN, at $SP + 70,
the result is also put in register T7 and compared against the zero constant in register
$0. If the results are not equal, we fall into the next JAL, which is the call to Debug.
The following shows this sequence:
050,03,00266-I 0x70000570, (#320 / 4)
70000570: ADDIU sp,sp,-72 SW ra,60(sp) SW s0,56(sp)
7000057C: JAL 0x70000390 NOP LUI a0,0xC800
70000588: LI a1,1 LUI a2,0x1
70000590: ORI a2,a2,0xFFF8 ADDIU t6,sp,68 SW t6,20(sp)
7000059C: SW $0,44(sp) JAL 0x7F8051A8 NOP
700005A8: OR s0,v0,$0 SH s0,70(sp)
700005B0: LH t7,70(sp) NOP BEQ t7,$0,0x700005D0
700005BC: NOP JAL 0x7C369070 NOP
700005C8: BEQ $0,$0,0x700005D0 NOP
700005D0: LUI a0,0xC800 LI a1,2 LUI a2,0x1
700005DC: ORI a2,a2,0xFFF8 ADDIU t8,sp,68 SW t8,20(sp)
700005E8: JAL 0x7F8051A8 NOP
700005F0: OR s0,v0,$0 SH s0,70(sp) LH t9,70(sp)
700005FC: NOP BEQ t9,$0,0x70000618 NOP
70000608: JAL 0x7C369070 NOP
70000610: BEQ $0,$0,0x70000618 NOP LUI a0,0xC800
7000061C: LI a1,17 LUI a2,0x3 ORI a2,a2,0xEFD0
70000628: ADDIU t0,sp,68 SW t0,20(sp)
70000630: JAL 0x7F8051A8 NOP OR s0,v0,$0
7000063C: SH s0,70(sp) LH t1,70(sp) NOP
70000648: BEQ t1,$0,0x70000660 NOP
70000650: JAL 0x7C369070 NOP BEQ $0,$0,0x70000660
7000065C: NOP LI a0,1 JAL 0x70000464
70000668: NOP LI a0,2
70000670: JAL 0x70000464 NOP LI a0,17
7000067C: JAL 0x70000464 NOP OR a0,$0,$0
70000688: JAL 0x7F808C98 NOP
70000690: BEQ $0,$0,0x70000698 NOP LW s0,56(sp)
7000069C: LW ra,60(sp) NOP JR ra
700006A8: ADDIU sp,sp,72 NOP
050,03,00266-LMAP 0x70000390
EXAMPLE_INIT (UCr)
7000057C: LUI a0,0xC800
70000588: LI a1,1 LUI a2,0x1
70000590: ORI a2,a2,0xFFF8 ADDIU t6,sp,68 SW t6,20(sp)
7000059C: SW $0,44(sp) JAL 0x7F8051A8 NOP
700005A8: OR s0,v0,$0 SH s0,70(sp)
700005B0: LH t7,70(sp) NOP BEQ t7,$0,0x700005D0
700005BC: NOP JAL 0x7C369070 NOP