-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6STRCMPW.ASM
56 lines (53 loc) · 1.07 KB
/
6STRCMPW.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
.model small
printf macro str
mov ah,09h
mov dx,offset str
int 21h
endm
.data
str_s db 'Computer$'
str_d db 'Computer$'
len_s db 0
len_d db 0
msg_e db 'Strings are Equal......$'
msg_ne db 'Strings are Not Equal..$'
.code
mov ax,@data
mov ds,ax
mov si,offset str_s
next: mov al,[si]
cmp al,'$'
jz exit
inc len_s
inc si
jmp next
exit:
mov si,offset str_d
next1: mov al,[si]
cmp al,'$'
jz exit1
inc len_d
inc si
jmp next1
exit1:
mov cl,len_s
cmp cl,len_d
jnz exit2
mov si,offset str_s
mov di,offset str_d
up: mov al,[si]
cmp al,[di]
jnz exit2
inc si
inc di
dec cl
jnz up
printf msg_e
jmp exit3
exit2:
printf msg_ne
exit3:
mov ah,4ch
int 21h
ends
end