70 likes | 335 Views
DEBUG EXAMPLE. DEBUG Program. DEBUG filename.exe. Question 6. Q4) Write the following program in notepad and save it as P.asm. ADD AX,AX MOV BX, 0FFFFH SUB X,BX ADD AX,W NEG AX INC AX ;DOC Exit MOV AH,4CH INT 21H MAIN ENDP END MAIN. .MODEL SMALL .STACK 100H
E N D
DEBUG Program DEBUG filename.exe
Question 6 Q4) Write the following program in notepad and save it as P.asm ADD AX,AX MOV BX, 0FFFFH SUB X,BX ADD AX,W NEG AX INC AX ;DOC Exit MOV AH,4CH INT 21H MAIN ENDP END MAIN .MODEL SMALL .STACK 100H .DATA X DW -2 W EQU 7 .CODE MAIN PROC MOV AX,@DATA MOV DS,AX MOV AX,4000H ADD AX,AX MOV BX, 0FFFFH SUB X,BX
Question 6 (continue ) After compiling and execute the program in DOS screen , use the DEBUG program and answer the following: C:\asm> DEBUG P.EXE • Display the register by write command : R • What is the content of AX register ? • What is the offset address of X? • Trace Instructions by typing : T • When you reach INT 21h, press: P after that complete tracing using T command. • Complete execution of the program by typing : G • Exit the DEBUG by typing : Q
What is the content of AX register ? • 0000 • @Data = 0B8D • The data segment address
What is the offset address of X ? • 000C Offset address of X Because W is EQU ,here its value instead of its offset address