debugging .asm file

Discussion in 'Assembly Language Programming (ALP) Forum' started by ssg96b, Nov 25, 2006.

  1. ssg96b

    ssg96b New Member

    Joined:
    Nov 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    When I want to debug my .asm file how do I do it line by line? Do I have to go into debug mode and enter the lines each one at a time? If that is the only way then how do I enter the labels in the code that I want to jump to at the debug prompt. When I enter labels it gives an error. for instance
    Code:
    ; TESTQUAD.ASM: TEST MY PROGRAM
    ;
    	.MODEL SMALL
    	.DATA
    X1 DB 4		;TEST CASE FOR VALUE 4
    Y1 DW 10	                ; Y SHOULD BE 10
    PASS DB 'Procedure passes.',0DH,0AH,'$'
    FAIL DB 'Procedure fails.',0DH,0AH,'$'
    
    	.CODE
    	.STARTUP
    	MOV AL,X1	;LOAD MY FIRST VALUE
    	CALL QUAD	;COMPUTE RESULTS
    	CMP AX,Y1 	;LOOK FOR MATCH
    	JNZ BAD
    	LEA DX,PASS	;SETUP POINTER
    	JMP SEND	;OUTPUT MESSAGE
    BAD: 	LEA DX,FAIL	;SETUP POINTER TO FAIL MESSAGE
    SEND: 	MOV AH,9	;DISPLAY STRING FUNCTION
    	INT 21H	;DOS CALL
    	.EXIT
    
    QUAD	PROC NEAR
    	MOV BL,AL	;save a copy of input value
    	MOV CX,10	;setting up 10x	
    	MUL CX		;compute 10X
    	MOV AL,32	; placing 50 dec into AL
    	SUB AX,CX	; perform y=50-10x
    	RET
    QUAD	ENDP
    
    END
    if I enter SEND: it will give an error and I am still trying to get this to work.
     
    Last edited by a moderator: Nov 27, 2006

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice