-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSum of Two Numbers.asm
63 lines (48 loc) · 951 Bytes
/
Sum of Two Numbers.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
; @author: Nilay Chandra Barman (https://github.com/Nilaycb)
; Copyright (c) 2019, All rights reserved.
; Copyrights licensed under the GNU AGPLv3 License.
.MODEL SMALL
.STACK 100H
.DATA
A DB "Enter 1st Number: $"
B DB "Enter 2nd Number: $"
C DB "The Sum is : $"
.CODE
MAIN PROC
; The sum must have to be within 0 to 9
MOV AX,@DATA
MOV DS,AX
MOV AH,9H
MOV DX,OFFSET A ;PRINT A
INT 21H
MOV AH,1
INT 21H
MOV BL,AL
MOV AH,2
MOV DL,0AH
INT 21H
MOV DL,0DH
INT 21H
MOV AH,9H
MOV DX,OFFSET B ;PRINT B
INT 21H
MOV AH,1
INT 21H
MOV CL,AL
ADD BL,CL
SUB BL,48
MOV AH,2
MOV DL,0AH
INT 21H
MOV DL,0DH
INT 21H
MOV AH,9H
MOV DX,OFFSET C ;PRINT C
INT 21H
MOV AH,2
MOV DL,BL
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN