Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL
- .STACK 100H
- .DATA
- MSG DB " Addition of 3 numbers$"
- PROMPT1 DB 10,10,13,"ENTER A FIRST NUMBER:$"
- PROMPT2 DB 10,13,"ENTER A SECOND NUMBER:$"
- PROMPT3 DB 10,13,"ENTER A 3rd NUMBER:$"
- PROMPT4 DB 10,10,13,"ANSWER:$"
- NUM1 DB ?,'$'
- NUM2 DB ?,'$'
- NUM3 DB ?,'$'
- .CODE
- MAIN PROC
- MOV AX,@DATA
- MOV DS,AX
- INT 21H
- MOV AH,9
- MOV DX,OFFSET MSG
- INT 21H
- MOV AH,9
- MOV DX,OFFSET PROMPT1
- INT 21H
- MOV AH,1
- INT 21H
- SUB AL,30H
- MOV NUM1,AL
- MOV AH,9
- MOV DX,OFFSET PROMPT2
- INT 21H
- MOV AH,1
- INT 21H
- SUB AL,30H
- MOV NUM2,AL
- MOV AH,9
- MOV DX,OFFSET PROMPT3
- INT 21H
- MOV AH,1
- INT 21H
- SUB AL,30H
- MOV NUM3,AL
- MOV AH,9
- MOV DX,OFFSET PROMPT4
- INT 21H
- MOV AL,NUM1
- ADD AL,NUM2
- ADD AL,NUM3
- ADD AL,30H
- MOV AH,2
- MOV DL,AL
- INT 21H
- MOV AH,4CH
- INT 21H
- ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement