Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .STACK 100H
- .DATA
- MSG DB "INSET TWO NUMBER!(1 - 5) $"
- MSG1 DB "ADDITION IS :$"
- MSG2 DB "SUBTRUCTION IS :$"
- X DB ?
- Y DB ?
- RESULT1 DB ?
- RESULT2 DB ?
- NL DB 0AH,0DH, "$"
- .CODE
- PROC MAIN
- MOV DX, @DATA
- MOV DS, DX
- LEA DX, MSG
- MOV AH, 09H
- INT 21H
- LEA DX, NL
- MOV AH, 09H
- INT 21H
- ; INPUT X
- MOV AH, 01H
- INT 21H
- MOV X, AL
- ;SUB X, 30H
- LEA DX, NL
- MOV AH, 09H
- INT 21H
- ;INPUT Y
- MOV AH, 01H
- INT 21H
- MOV Y, AL
- ;SUB Y, 30H
- ;ADDITION FUCTION
- MOV AL, X
- ADD AL, Y
- MOV RESULT1, AL
- SUB RESULT1, 30H
- LEA DX, NL
- MOV AH, 09H
- INT 21H
- LEA DX, MSG1
- MOV AH, 09H
- INT 21H
- LEA DX, RESULT1
- MOV AH, 09H
- INT 21H
- ;SUBTRUCT FUNCTION
- MOV AL, X
- SUB AL, Y
- MOV RESULT2, AL
- ADD RESULT2, 30H
- LEA DX, MSG2
- MOV AH, 09H
- INT 21H
- LEA DX, RESULT2
- MOV AH, 09H
- INT 21H
- MOV AH, 04CH
- INT 21H
- ENDP MAIN
- END MAIN
- RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement