-
Notifications
You must be signed in to change notification settings - Fork 0
/
getfinfo.asm
284 lines (279 loc) · 6.1 KB
/
getfinfo.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
GetFileInfo proc
mov ah,Column
push ax
mov Column,0
lea dx,Pathleft
call SetDfltDir
call GetFileInfoMain
inc Column
lea dx,Pathright
call SetDfltDir
call GetFileInfoMain
pop ax
mov Column,ah
cmp Column,0
je LeftGeted
ret
LeftGeted:
lea dx,Pathleft
call SetDfltDir
ret
GetFileInfoMain:
mov TempFree,0
cmp Column,0
je RightGetFileInfo
mov TempFree,80
mov ah,0
mov al,Pointerright
call Place
add si,80
mov cx,12
lea di,FNameG
jmp GetFName
RightGetFileInfo:
mov ah,0
mov al,Pointer
call Place
mov cx,12
lea di,FNameG
GetFName:
cmp byte ptr ds:[si],20h
jne GetFName1
cmp byte ptr ds:[si+2],20h
je GetFName2
cmp cx,1
je GetFName10
mov byte ptr es:[di],'.'
inc si
inc si
inc di
loop GetFName
GetFName2:
cmp cx,0
je GetFName10
inc si
inc si
loop GetFName
GetFName1:
cmp cx,0
je GetFName10
movsb
inc si
loop GetFName
GetFName10:
mov byte ptr es:[di],0
lea si,FNameG
lea di,Screen
add di,3202
add di,TempFree
mov ah,8bh
mov cx,13
PutFName:
lodsb
cmp al,0
je PutFName1
stosw
loop PutFName
PutFName1:
mov al,0
rep stosw
;------------------------------------------------
;------------------------------------------------
mov ah,4eh
lea dx,FNameG
mov cx,03fh
int 21h
mov al,byte ptr ds:[(offset DTA)+15h]
rol al,4
jc Directory00
push di
; int 3h
mov cx,10
lea di,FSize
mov al,0
rep stosb
mov ax,word ptr ds:[(offset DTA)+1ah]
mov dx,word ptr ds:[(offset DTA)+1ah+2]
lea di,Kl
dec di
std
call adword
cld
pop di
lea si,FSize
mov cx,10
mov ah,8bh
jmp PutDir
Directory00:
lea si,SubDir
mov cx,10
mov ah,8bh
PutDir:
lodsb
stosw
loop PutDir
add di,2
mov si,(offset DTA)+18h
lodsw
mov bx,ax
push di
lea di,DateTime
and ax,001fh
mov cl,10
div cl
add ax,3030h
stosb
xchg ah,al
stosb
mov al,'.'
stosb
mov ax,bx
and ax,01e0h
ror ax,5
mov cx,10
div cl
add ax,3030h
stosb
xchg ah,al
stosb
mov al,'.'
stosb
mov ax,bx
and ax,0fe00h
ror ax,9
mov cx,10
div cl
add ax,3038h
cmp al,3ah
jl @Norm123
int 3
mov bh,ah
mov ah,0
sub al,30h
mov cl,10
div cl
add ah,30h
mov bl,ah
mov ax,bx
@Norm123:
stosb
xchg ah,al
stosb
mov al,0
stosb
mov si,(offset DTA)+16h
lodsw
mov bx,ax
and ax,0f800h
ror ax,11
mov cx,10
div cl
add ax,3030h
stosb
xchg ah,al
stosb
mov al,':'
stosb
mov ax,bx
and ax,07e0h
ror ax,5
mov cx,10
div cl
add ax,3030h
stosb
xchg ah,al
stosb
pop di
lea si,DateTime
mov ah,8bh
mov cx,14
PutDate:
lodsb
stosw
loop PutDate
ret
DateTime db 14 dup (0)
FNameG db 13 dup (0)
SubDir db ' -= DIR =-'
FSize db 10 dup (0)
Kl db 0
;Unknow db ' Unknown' ;;;;
GetFileInfo endp
GetFreeSpace proc
pusha
mov al,Column
push ax
mov Column,0
mov dl,LeftDisk
sub dl,41h
mov ah,0eh
int 21h
call MainFreeSpace
mov Column,1
mov dl,RightDisk
sub dl,41h
mov ah,0eh
int 21h
call MainFreeSpace
pop ax
mov Column,al
popa
ret
MainFreeSpace:
mov TempFree,0
cmp Column,0
je LeftFree
mov TempFree,80
LeftFree:
.386
mov ah,36h
mov dl,0
int 21h
push ax
mov eax,0
pop ax
mov edx,0
mul ecx
mul ebx
cmp edx,0
je NormalFree
NormalFree:
rol eax,16
mov dx,ax
rol eax,16
lea di,FreeSpace
add di,9
push ax dx
mov eax,0
mov edx,eax
pop dx ax
std
call adword
cld
inc di
mov ah,19h
int 21h
add al,41h
mov byte ptr ds:[(offset StringFree)+24],al
lea si,Screen
add si,3364
add si,TempFree
xchg si,di
lea cx,MMMFree
sub cx,si
inc cx
@1234567890:
movsb
cmp si,offset StringFree
jg NextFree
mov byte ptr es:[di],8fh
NextFree:
inc di
loop @1234567890
ret
TempFree dw 0
FreeSpace db 10 dup (0)
StringFree db ' байт свободно на диске '
db 0
MMMFree db ':'
GetFreeSpace endp