Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL
- .STACK 100
- .DATA
- NUM1 DB ?
- NUM2 DB ?
- NUM3 DB ?
- NUM4 DB ?
- RESULT DB ?
- MSG1 DB "ENTER 1ST NUMBER : $"
- MSG2 DB 10,13, "ENTER 2ND NUMBER : $"
- MSG3 DB 10,13, "ENTER 3RD NUMBER : $"
- MSG4 DB 10,13, "ENTER 3RD NUMBER : $"
- MSG DB 10,13, "OUTPUT : $"
- .CODE
- MAIN PROC
- MOV AX, @DATA
- MOV DS, AX
- LEA DX, MSG1
- MOV AH, 9
- INT 21H
- MOV AH, 1
- INT 21H
- SUB AL, 30H
- MOV NUM1, AL
- LEA DX, MSG2
- MOV AH, 9
- INT 21H
- MOV AH, 1
- INT 21H
- SUB AL, 30H
- MOV NUM2, AL
- ADD AL, NUM1
- ADD AL, 30H
- MOV BL, AL
- SUB BL, 30H
- LEA DX, MSG3
- MOV AH, 9
- INT 21H
- MOV AH, 1
- INT 21H
- MOV CL, AL
- SUB CL, 30H
- SUB BL, CL
- ADD BL, 30H
- SUB BL, 30H
- LEA DX, MSG4
- MOV AH, 9
- INT 21H
- MOV AH, 1
- INT 21H
- SUB AL, 30H
- ADD AL, BL
- ADD AL, 30H
- MOV DL, AL
- MOV AH, 2
- INT 21H
- MOV AH, 4CH
- INT 21H
- MAIN ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement