This repository has been archived by the owner on Nov 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2.3.asm
141 lines (124 loc) · 1.45 KB
/
2.3.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
DATA SEGMENT
STRI1 DB 5 dup(0)
STRI2 DB 5 dup(0)
addc DB '+'
equal DB '='
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,SS:STACK,DS:DATA,ES:DATA
START PROC FAR
PUSH DS
MOV AX,0
PUSH AX
MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI1+3,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI1+2,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI1+1,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI1,al
MOV DL,0AH
MOV AH,2H
INT 21H
MOV DL,0DH
MOV AH,2H
INT 21H
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI2+3,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI2+2,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI2+1,al
MOV AH,1H
INT 21H
SUB AL,30H
mov STRI2,al
MOV DL,0AH
MOV AH,2H
INT 21H
MOV DL,0DH
MOV AH,2H
INT 21H
MOV SI,OFFSET STRI1
push [si]
push [si+1]
push [si+2]
push [si+3]
MOV DI,OFFSET STRI2
push [di]
push [di+1]
push [di+2]
push [di+3]
MOV CX,5
CLC
CYCLE:
MOV AL,[SI]
ADC AL,[DI]
AAA
MOV [DI],AL
INC SI
INC DI
LOOP CYCLE
mov cx,4
S:
pop dx
add dl,30h
MOV AH,2
INT 21H
loop S
mov dl,addc
MOV AH,2
INT 21H
mov cx,4
S2:
pop dx
add dl,30h
MOV AH,2
INT 21H
loop S2
mov dl,equal
MOV AH,2
INT 21H
MOV SI,OFFSET STRI2
MOV DL,[SI+4]
ADD DL,30H
MOV AH,2
INT 21H
MOV DL,[SI+3]
ADD DL,30H
MOV AH,2
INT 21H
MOV DL,[SI+2]
ADD DL,30H
MOV AH,2
INT 21H
MOV DL,[SI+1]
ADD DL,30H
MOV AH,2
INT 21H
MOV DL,[SI+0]
ADD DL,30H
MOV AH,2
INT 21H
RET
START ENDP
CODE ENDS
END START