-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvd3file.asm
49 lines (43 loc) · 962 Bytes
/
vd3file.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
;vi du ve file 3
;tao 1 tep moi,doc du lieu tu ban phim va luu vao tep
.model small
.stack 50
.data
controf dw ?
tenf db 'ab.txt',0
buff db 5 dup('$')
.code
main proc
mov ax, @data
mov ds, ax
mov cx,0 ; cx = 0 binh thuong, 1 chi doc 2 an 4 tap tin he thong
lea dx,tenf
mov ah,3Ch
int 21h
mov controf, ax
Lea Si,buff
xor cx,cx
Lapnhap:
mov ah,1
int 21h
cmp al,0Dh
je thoat
mov [si], al
inc si
inc cx
cmp cx,5
je thoat
jmp Lapnhap
thoat:
;cx da duoc tang o tren
lea dx, buff
mov bx, controf
mov ah,40h
int 21h
mov ah,3Eh
mov bx,controf
int 21h
mov ah,4Ch
int 21h
main endp
end main