Basic usage of debug

 # Debug the basic usage


Next, talk about the basic usage of debug

debug basic instructions Full instruction name usage use
---------- ? Show debug command list
A assemble A [ address ] The input source program is compiled into object code and instruction stored starting from the specified address location. If the defaulted start address, from the current CS: 100 start address is stored. A command line by the assembler, the main procedures for assembling small pieces or modification of the target program
C compare C range address Comparison of the two parts of memory
D dump D [ range ] Display part of the memory contents
E enter E address [ list ] Starting at the specified address, data input
F fill F range list Section of memory is filled with the specified value
G go G [ = address ] [ addresses ] Running in memory executable file
H hex H value1 value2 Hexadecimal arithmetic execution
I input I port Display 1-byte value from a specific port
L load L [ address ] [driver ] [ firstsector ] [ number ] The file or disk sector content is loaded into memory
M move M range address Copy the contents of the memory block
N name N [pathname] [guile] Parameter name of the executable file Debug l (load) or w (write) command, or specify the executable file is being debugged
THE output O port byte Value output port to send a byte
P proceed P [ =address ] [ number ] Execution cycle, repeated string instructions, or software interrupt subroutine; or by any other instruction trace
Q quit Q Exit debug session without saving the current test file
R register R [ register ] When the register name is given, then the display memory register can be modified. Default register names, the contents of all registers and the current value (not modified) is displayed
S search S range list Search pattern of one or more byte values ​​in the memory section
T trace T [ =address] [ value ] Execute one instruction, then displays the contents of all registers, the instruction decoded form of the status of all flags to be executed next, and Debug
The unassemble U [ range ] Disassemble bytes and displays the corresponding original sentence
W write W [address ] [ drive ] [ firstsector ] [ number ] The test file is written to disk
FAR allocate expanded memory XA [ # pages ] Allocate extended memory
XD deallocate expanded memory XD [ handle ] The release of extended memory
XM map expanded memory pages XM [ Lpage ] [ Ppage ] [ handle ] Expanded memory page mapping
XS display expanded memory status XS Displays the status of extended memory

The above is debug profile.


Learn assembly language and call the debug time, mainly used to -L -U -D -G -T -P command

-L -G run into the disassembly -T -U single step (you can enter the subroutine) -P single step (do not enter the subroutine) -D query memory

Assembly language program establishes steps:

  • edit establish the source file formats: edit xxx.asm (asm must file name extension, or can not use masm call), generate obj file.
  • masm generating link file: masm xxx.asm then generates obj file obj connection file is the file, the next link required link file generated exe
  • exe format generating link: link xxx.obj generate executable exe

Guess you like

Origin www.cnblogs.com/Yunrui-blogs/p/11530651.html