1 / 7

DEBUG EXAMPLE

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

liz
Télécharger la présentation

DEBUG EXAMPLE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEBUG EXAMPLE

  2. DEBUG Program DEBUG filename.exe

  3. 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

  4. 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

  5. Display the register by write command : R

  6. What is the content of AX register ? • 0000 • @Data = 0B8D • The data segment address

  7. What is the offset address of X  ? •  000C Offset address of X Because W is EQU ,here its value instead of its offset address

More Related