62
8.27 Unassemble U
Formats:
U[Repeats] [StartAddress|*]
or
UL[Repeats] [StartAddress|*]
or
U [StartAddress|*] [EndAddress|+Length]
or
UL [StartAddress|*] [EndAddress|+Length]
Command to unassemble (disassemble or reverse engineer) memory. If no start address is specified,
or an asterisk is used, Xplor8 will use the current value of its own starting address, in L/U. Either an
ending address, or a number of repeats may be specified (but not both). Repeats is an optional number
which specifies how many times the command is to be repeated. Note that repeats is specified as a
decimal number, unlike other values which are entered in hexadecimal. The value of 'Repeats' follows
the letters U or UL without a gap. Code cannot be unassembled between $FFFC and $FFFF.
The U form unassembles MCU-controlled memory, UL unassembles only local memory.
The following example disassembles the 10 instructions beginning at $F800:
u10 f800
This might produce something like the following output:
0001: F800 C6FFC0 LDA $FFC0
0002: F803 A1FF CMP #$FF
0003: F805 2703 BEQ $F80A
0004: F807 C7FC00 STA $FC00
0005: F80A 6E091F MOV #$09,$001F
0006: F80D 6E081E MOV #$08,$001E
0007: F810 450C80 LDHX #$0C80
0008: F813 5BFE DBNZX $F813
0009: F815 6E0236 MOV #$02,$0036
0010: F818 3F80 CLR $0080
The information on each line is: line number, address, bytes at that address, instruction, operands. In
certain instances a comment will be added, for example if an unrecognized opcode is encountered. A
symbolic disassembly is also possible - see Using a Symbol Table below.
The above result would also be achieved by issuing the command:
UL 0 +17
To reverse engineer a program available as an S19 or binary image file, it is not necessary to connect
to an MCU at all; the program may simply be loaded into local memory at the correct starting address,
and the 'UL' command used to disassemble it.
Comentarios a estos manuales