Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; You may customize this and other start-up templates;
- ; The location of this template is c:\emu8086\inc\0_com_template.txt
- org 100h
- .MODEL SMALL
- .STACK 100H
- .DATA
- MSG1 DB 'The sum of '
- X DB ?
- MSG2 DB ' and '
- Y DB ?
- MSG3 DB ' is $'
- .CODE
- MAIN PROC
- MOV AX,@DATA ;INITIALIZE
- MOV DS,AX
- MOV AH,2
- MOV DL,'?'
- INT 21H
- ;INPUT-1
- MOV AH,1
- INT 21H
- MOV BL,AL
- MOV X,BL
- ;INPUT-2
- MOV AH,1
- INT 21H
- MOV BH,AL
- MOV Y,BH
- ;ADD
- ADD BL,BH ;BL=BL+BH
- SUB BL,48 ;SUB
- ;PRINT
- MOV AH,2
- MOV DL,0DH ;CARRIAGE RETURN
- INT 21H
- MOV DL,0AH ;LINE FEED
- INT 21H
- ;DISPLAY
- LEA DX,MSG1
- MOV AH,9
- INT 21H
- MOV AH,2
- MOV DL,BL
- INT 21H
- MAIN ENDP
- END MAIN
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement