Objective:
• Access to the DEBUG program
• Examine end modify the contents of Registers
• Utilize some of DEBUG facilities
• Calculate the physical address of the Memory
Procedure:
1. To have access to the DEBUGprogram, the following command will be used at the start.
• Click the BOXDOS Icon
• At Z>: Type mount c c:/
• C>: prompt will appear, then Type cd TASM
• C:\TASM> will be displayed then Type DEBUG as follows
C:\TASM>DEBUG ⅃
When you see the underscore sign shown above, it means you have accessed the DEBUG
program successfully.
2. To be able to examine the content of the Registers inside microprocessor the following
command should be typed at the DEBUG Prompt:
_R⅃
You should be able to see the content of all registers for instance as follows:
AX =0000 BX =0000 CX =0000 DX =0000 SP =FFEE BP =0000 SI =0000
DI =0000 DS =0AED ES =0AED SS =0AED CS =0AED IP =0100
NV UP EI PL NZ NA PO NC
0AED:O100 8A07
MOV
AL, {BX]
Note that the last line is happened to be in the memory.
Display the content of all registers in your computer:
AX =
DI =
BX =
DS =
CX =
ES =
DX =
SS =
SP =
CS =
BP =
IP =
SI =
Flag:
3. The DEBUG command allows you to modify the contents of Register inside microprocessor
R
For an example:
_ R AX ⅃
AX 0000
: ABCD
The content of AX register was changed from 0000 to ABCD.
Please change the content of SI, DI, and AX to 1234, 5678, and 9ABC, respectively. Then,
display the content of all registers:
You are not allowed to modify a byte size registers.
_ R AL ⅃
BR Error
Can we change the content of the CL register?
NO
The following table will help you to determine the status of each flag bit.
BIT Number
11
10
9
7
6
A
2
0
FLAG
Overflow
Direction
Interrupt
Sign
Zero
AC
Parity
Carry
Flag Designation
O
D
I
S
Z
A
P
C
SET
OV
DN
EI
NG
ZR
AC
PE
CY
CLEAR
NV
UP
DI
PL
NZ
NA
PO
NC
How one can change the Parity flag from Odd parity to Even parity?
4. Assemble (A) command
The assemble command is used to provide the offset address for the memory so that one can
enter the instruction code into the memory.
_ A 100 ⅃
0AED:O100
Where 0AED is the code segment and 0100 is Instruction Pointer (IP)
Example (1):
_ A100 ⅃
0AED :0100
mov ax, 1000
0AED:0103
mov bx, 2000
0AED:0106
mov cx, 3000
0AED:0109
add ax, bx
0AED:010B
add ax, cx
0AED:010D
int 20
How can one assemble the program at offset address of 0150?
5. Unassembled (U)command
The U command will display the machine code in memory along with their equivalent assembly
language instructions. The format of the U command is as follows
-U
or
-U
Example (2):
0AED:0100
B80010
mov ax, 1000
0AED:0103
BB0020
mov bx, 2000
0AED:0106
B90030
mov cx, 3000
0AED:0109
01D8
add ax, bx
0AED:010B
01C8
add ax, cx
0AED:010D
CD20
int 20
Assemble a program to input 1, 2, 3, 4, and 5 into register AL, BH, CL, DH, and SI respectively
then unassembled your program and write the address, machine code, and assembly language
code.
6. There are two ways to execute your program in the DEBUG environment
a) The Go command (G)
The go command informs the DEBUG to execute the entire program if the following format is
used:
_G⅃
But if the following format is used, the instructions between two given addresses will be
executed:
_ G= ⅃
Execute the program given in Example (1) using both G command methods and display the
content of all registers. If there is a discrepancy in the results, explain the reason.
b) The Trace command (T)
This command allows you to trace through the execution of your code one line at a time.
_T⅃
If it is desired to execute several instructions at a time, the following format is employed.
_ T=
Please use program in Example (1) to execute one line at a time and show the contents of all
registers.
7. Calculate the physical address of the first and last instructions of Program in Example (1).
Conclusion: