-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path6.s
67 lines (61 loc) · 856 Bytes
/
6.s
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
.model tiny
.dosseg
.data
screen db 2000 dup(0)
str2search db 'MANUN'
str2out db 'MANUN',0ah,0dh,'$'
stry db 'Y',0ah,0dh,'$'
strn db 'N',0ah,0dh,'$'
.code
.startup
;send MANUN to screen
;lea dx,str2out
;mov ah,9
;int 21h
;end send MANUN to screen
; for speed test read only 6 first symbol from screen
mov dx,6
mov cx,0
lea bx,screen
mov ax,0b000h
mov di,08000h
mov es,ax
L1:
push bx
push dx
call readchar
pop dx
pop bx
mov [bx],al
inc bx
dec dx
jnz L1
mov dx,6
mov bx,0
L2:
cld
mov si,offset screen
add si,bx
mov di,offset str2search
mov cx, 5
repne cmpsb
jnz found
inc bx
dec dx
jnz L2
lea dx, strn
jmp fin
found:
lea dx,stry
jmp fin
fin:
mov ah,9
int 21h
mov ah, 4Ch
int 21h
readchar:
mov al,es:[di]
inc di
inc di
ret
end