If you are interested in writing code on command prompt and like writing code in command prompt than this tutorial is for you. Debugging assembly language is easy. Following picture shows an example of it:
What is Debugging?
Debug is a dos program which allows programmers to see execution of the program closely in depth. It is used to:
- Change and see memory contents
- Enter and execute programs
- Hold the program at a specific instruction to check the data values or change them.
Debugging commands Assembly language
Below are the command examples of debugging an assembly language code:
Debug: Enter a program
Q: Quit the program.
R: See register contents/values.
R<register>: see particular register content/value also change it.
Practice Program: See AX register contents and change the value to 2, 34, 543, and GE.
A: this command assembles the program. You can enter assembly instructions into the memory.
A <starting address>: starting address can be an offset of code segment or you can also specify segment register.
Example – your turn: a 100 or a cs: 100 are the same, type a 100 and debug it.
U: a command that un-assembles the program. You can see machine code of your program by using this command. You can also specify the starting and ending addresses of memory section you want to see the code of, U<starting address> (space) <ending address>.
G: G is a go command that allows the program to run until it reaches the breakpoint. At the end register contents are displayed to the programmer.
F: F command is used to fill into the memory. Format of this command is: F<starting address> <ending address> <data>.
E: E command is used to enter any data or change into the memory. For example: E 200 ‘HELLO WORLD’.
D: D command is used to see the register contents. You can also use this command to fill segment providing offset. For example: F 10 10F FF, fills 16bytes with FF.
