-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileop_thurs
81 lines (66 loc) · 857 Bytes
/
fileop_thurs
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
.model tiny
.data
fname db 'a.txt',0
f2 db 'b.txt',0
handle dw ?
store2 db 'ABCDEFGHIJKLMNO$'
store db 20 dup('$')
nl db 0dh,0ah,'$'
.code
.startup
mov ah,3dh
mov al,2
lea dx,fname
int 21h
mov handle,ax
mov bx,handle
mov ah,3fh
mov cx,15
lea dx,store
int 21h
mov bx,handle
mov ah,3eh
int 21h
lea si,store
lea di,store2
mov cl,07h
x: mov al,[si]
mov bl,[di]
mov [di],al
mov [si],bl
inc si
inc si
inc di
inc di
dec cl
jnz x
mov al,[si]
mov bl,[si]
mov [di],bl
mov [si],al
lea si,store
lea di,store2
mov cl,15
x1: mov dl,[si]
mov ah,02h
int 21h
inc si
dec cl
jnz x1
lea dx,nl
mov ah,09h
int 21h
mov cl,15
mov ah,3dh
mov al,2
lea dx,f2
int 21h
mov bx,ax
mov ah,40h
mov cx,15
lea dx,store
int 21h
mov ah,3eh
int 21h
.exit
end