Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL small
- .STACK 100h
- .DATA
- CR EQU 0DH
- LF EQU 0AH
- MSG1 DB 'ENTER FIRST NUMBER : $'
- Numb1 ?
- MSG2 DB CR,LF'ENTER SECOND NUMBER : $'
- Numb2 ?
- MSG3 DB CR,LF'RESULT IS : '
- CHAR db ?,'$'
- .CODE
- MAIN PROC
- mov AX,@DATA
- mov DS,AX
- ;load DS
- LEA DX,MSG1
- mov AH,9
- INT 21h
- ;print first msg
- mov AH,1
- INT 21h
- mov Numb1,AL
- ;Move first number to Numb1 var
- LEA DX,MSG2
- mov AH,9
- INT 21h
- ;print Second msg
- mov AH,1
- INT 21h
- mov Numb2,AL
- ;Move Second number to Numb2 var
- add numb2,numb1
- mov CHAR,numb2
- ;here where i am not sure if i can use add numb2,numb1 since both are memory locations ?
- ; another code is
- ;mov BL,numb1
- ;add numb2,BL
- LEA DX,MSG3
- mov AH,9
- INT 21h
- ;here will display the 3rd msg with the result
- mov AH,4CH
- int 21h
- MAIN ENDP
- END MAIN
Add Comment
Please, Sign In to add comment