Rev 3378 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1792 | yogev_ezra | 1 | left_sort_files: |
2 | ; mcall 26,9 |
||
3 | ; mov [timer_tick],eax |
||
4 | mov eax,[left_folder_data] |
||
5 | add eax,32+40 |
||
6 | cmp [eax],word '..' |
||
7 | jne @f |
||
8 | cmp [eax+2],byte 0 |
||
9 | jne @f |
||
10 | add [left_folder_data],304 |
||
11 | dec [left_folder_block] |
||
12 | mov [exit_to_dir],1 |
||
13 | @@: |
||
14 | ; add memory for sorting |
||
15 | mov ecx,[right_folder_data] |
||
16 | sub ecx,[left_folder_data] |
||
17 | mov ebx,[appl_memory] |
||
18 | add ecx,ebx |
||
19 | push ebx |
||
20 | mov [appl_memory],ecx |
||
21 | mcall 64,1 |
||
22 | mov edi,[esp] |
||
23 | mov ecx,[appl_memory] |
||
24 | sub ecx,edi |
||
25 | shr ecx,2 |
||
26 | mov eax,0xffffffff |
||
27 | cld |
||
28 | rep stosd |
||
29 | cmp [left_sort_flag],0 |
||
30 | je left_name_sort |
||
31 | cmp [left_sort_flag],1 |
||
32 | je left_type_sort |
||
33 | jmp left_size_date_sort |
||
34 | .move_sorted_file: |
||
35 | ; move sorted file area in folder area |
||
36 | mov esi,[esp] |
||
37 | mov edi,[left_folder_data] |
||
38 | add edi,32 |
||
39 | mov ecx,[right_folder_data] |
||
40 | sub ecx,edi |
||
41 | shr ecx,2 |
||
42 | cld |
||
43 | rep movsd |
||
44 | cmp [exit_to_dir],0 |
||
45 | je @f |
||
46 | sub [left_folder_data],304 |
||
47 | inc [left_folder_block] |
||
48 | mov [exit_to_dir],0 |
||
49 | @@: |
||
50 | ; sub memory for sorting |
||
51 | pop ecx |
||
52 | mov [appl_memory],ecx |
||
53 | mcall 64,1 |
||
54 | ; mcall 26,9 |
||
55 | ; sub eax,[timer_tick] |
||
56 | ; mov [timer_tick],eax |
||
57 | ; call draw_window |
||
58 | ret |
||
59 | ;--------------------------------------------------------------------- |
||
60 | left_name_sort: |
||
61 | ; sorting of files |
||
62 | call prepare_data_1 |
||
63 | call left_name_sort_1 |
||
64 | call prepare_data_2 |
||
65 | call left_name_sort_1 |
||
66 | .1: |
||
67 | call prepare_data_4 |
||
68 | jmp left_sort_files.move_sorted_file |
||
69 | left_name_sort_1: |
||
70 | xor ebp,ebp |
||
71 | .copy_folders: |
||
72 | call copy_folders_1 |
||
73 | je .file |
||
74 | test [esi],byte 0x10 |
||
75 | jz .continue |
||
76 | jmp @f |
||
77 | .file: |
||
78 | test [esi],byte 0x10 |
||
79 | jnz .continue |
||
80 | @@: |
||
81 | call prepare_data_3 |
||
82 | .start: |
||
83 | push esi edi |
||
84 | call sort_by_name.start |
||
85 | jae .add_counter |
||
86 | .no_add_counter: |
||
87 | call move_area_for_bdvk |
||
88 | pop edi esi |
||
89 | jmp .end |
||
90 | .add_counter: |
||
91 | inc [sort_counter] |
||
92 | pop edi esi |
||
93 | call add_counter |
||
94 | jae .start |
||
95 | .end: |
||
96 | call move_bdvk |
||
97 | .continue: |
||
98 | inc ebp |
||
99 | cmp ebp,[left_folder_block] |
||
100 | jb .copy_folders |
||
101 | ret |
||
102 | ;--------------------------------------------------------------------- |
||
103 | left_type_sort: |
||
104 | ; sorting of files |
||
105 | call left_prepare_extension_start_1 |
||
106 | call prepare_data_1 |
||
107 | call left_type_sort_1 |
||
108 | call prepare_data_2 |
||
109 | call left_type_sort_1 |
||
110 | jmp left_name_sort.1 |
||
111 | left_type_sort_1: |
||
112 | xor ebp,ebp |
||
113 | .copy_folders: |
||
114 | call copy_folders_1 |
||
115 | je .file |
||
116 | ; test [esi],byte 0x10 |
||
117 | test al,ah |
||
118 | jz .continue |
||
119 | jmp @f |
||
120 | .file: |
||
121 | ; test [esi],byte 0x10 |
||
122 | test al,ah |
||
123 | jnz .continue |
||
124 | @@: |
||
125 | call prepare_data_3 |
||
126 | .start: |
||
127 | push esi edi |
||
128 | cmp [dir_or_file],1 |
||
129 | je @f |
||
130 | call prepare_data_5 |
||
131 | @@: |
||
132 | call sort_by_name.start |
||
133 | je .1 |
||
134 | ja .add_counter |
||
135 | .no_add_counter: |
||
136 | call move_area_for_bdvk |
||
137 | pop edi esi |
||
138 | jmp .end |
||
139 | .1: |
||
140 | cmp [dir_or_file],1 |
||
141 | je .add_counter |
||
142 | call sort_by_name |
||
143 | jbe .no_add_counter |
||
144 | .add_counter: |
||
145 | inc [sort_counter] |
||
146 | pop edi esi |
||
147 | call add_counter |
||
148 | jae .start |
||
149 | .end: |
||
150 | call move_bdvk |
||
151 | .continue: |
||
152 | inc ebp |
||
153 | cmp ebp,[left_folder_block] |
||
154 | jb .copy_folders |
||
155 | ret |
||
156 | ;--------------------------------------------------------------------- |
||
157 | left_size_date_sort: |
||
158 | ; sorting of files |
||
159 | call prepare_data_1 |
||
160 | call left_size_date_sort_1 |
||
161 | call prepare_data_2 |
||
162 | call left_size_date_sort_1 |
||
163 | jmp left_name_sort.1 |
||
164 | left_size_date_sort_1: |
||
165 | xor ebp,ebp |
||
166 | .copy_folders: |
||
167 | call copy_folders_1 |
||
168 | je .file |
||
169 | test [esi],byte 0x10 |
||
170 | jz .continue |
||
171 | jmp @f |
||
172 | .file: |
||
173 | test [esi],byte 0x10 |
||
174 | jnz .continue |
||
175 | @@: |
||
176 | call prepare_data_3 |
||
177 | .start: |
||
178 | push esi edi |
||
179 | mov eax,[left_sort_flag] |
||
180 | cmp eax,2 |
||
181 | je .size_sort |
||
182 | call sort_by_date |
||
183 | ; je .1 |
||
184 | jae .add_counter |
||
185 | jmp .no_add_counter |
||
186 | .size_sort: |
||
187 | cmp [dir_or_file],0 |
||
188 | je .file_1 |
||
189 | call sort_by_name.start |
||
190 | jmp @f |
||
191 | .file_1: |
||
192 | call sort_by_size |
||
193 | @@: |
||
194 | jae .add_counter |
||
195 | .no_add_counter: |
||
196 | call move_area_for_bdvk |
||
197 | pop edi esi |
||
198 | jmp .end |
||
199 | ;.1: |
||
200 | ; call sort_by_name.start |
||
201 | ; jbe .no_add_counter |
||
202 | .add_counter: |
||
203 | inc [sort_counter] |
||
204 | pop edi esi |
||
205 | call add_counter |
||
206 | jae .start |
||
207 | .end: |
||
208 | call move_bdvk |
||
209 | .continue: |
||
210 | inc ebp |
||
211 | cmp ebp,[left_folder_block] |
||
212 | jb .copy_folders |
||
213 | ret |
||
214 | ;--------------------------------------------------------------------- |
||
215 | left_prepare_extension_start: |
||
216 | xor ebp,ebp |
||
217 | mov esi,[left_folder_data] |
||
218 | add esi,32+40 |
||
219 | .start: |
||
220 | call prepare_extension_start_all |
||
221 | cmp ebp,[left_folder_block] |
||
222 | jb .start |
||
223 | ret |
||
224 | ;--------------------------------------------------------------------- |
||
225 | prepare_extension_start_all: |
||
226 | push esi |
||
227 | call search_extension_start |
||
228 | mov eax,esi |
||
229 | pop esi |
||
230 | sub eax,esi |
||
231 | sub ebx,esi |
||
232 | shl eax,16 |
||
233 | mov ax,bx |
||
234 | mov [esi+300-40],eax |
||
235 | mov [esi+299-40],byte 0 |
||
236 | add esi,304 |
||
237 | inc ebp |
||
238 | ret |
||
239 | ;--------------------------------------------------------------------- |
||
240 | left_prepare_extension_start_1: |
||
241 | xor ebp,ebp |
||
242 | mov edi,[esp+4] |
||
243 | .start: |
||
244 | xor eax,eax |
||
245 | mov [edi+300],eax |
||
246 | add edi,304 |
||
247 | inc ebp |
||
248 | cmp ebp,[left_folder_block] |
||
249 | jb .start |
||
250 | ret |
||
251 | ;--------------------------------------------------------------------- |
||
252 | left_files_name_normalize: |
||
253 | xor ebp,ebp |
||
254 | mov esi,[left_folder_data] |
||
255 | add esi,32+40 |
||
256 | .start: |
||
257 | push esi |
||
258 | mov al,[esi] |
||
259 | call char_toupper |
||
260 | mov [esi],al |
||
261 | @@: |
||
262 | inc esi |
||
263 | mov al,[esi] |
||
264 | test al,al |
||
265 | jz @f |
||
266 | call char_todown |
||
267 | mov [esi],al |
||
268 | jmp @b |
||
269 | @@: |
||
270 | pop esi |
||
271 | add esi,304 |
||
272 | inc ebp |
||
273 | cmp ebp,[left_folder_block] |
||
274 | jb .start |
||
275 | ret |
||
276 | ;--------------------------------------------------------------------- |
||
277 | right_files_name_normalize: |
||
278 | xor ebp,ebp |
||
279 | mov esi,[right_folder_data] |
||
280 | add esi,32+40 |
||
281 | .start: |
||
282 | push esi |
||
283 | mov al,[esi] |
||
284 | call char_toupper |
||
285 | mov [esi],al |
||
286 | @@: |
||
287 | inc esi |
||
288 | mov al,[esi] |
||
289 | test al,al |
||
290 | jz @f |
||
291 | call char_todown |
||
292 | mov [esi],al |
||
293 | jmp @b |
||
294 | @@: |
||
295 | pop esi |
||
296 | add esi,304 |
||
297 | inc ebp |
||
298 | cmp ebp,[right_folder_block] |
||
299 | jb .start |
||
300 | ret |
||
301 | ;--------------------------------------------------------------------- |
||
302 | right_prepare_extension_start: |
||
303 | xor ebp,ebp |
||
304 | mov esi,[right_folder_data] |
||
305 | add esi,32+40 |
||
306 | .start: |
||
307 | call prepare_extension_start_all |
||
308 | cmp ebp,[right_folder_block] |
||
309 | jb .start |
||
310 | ret |
||
311 | ;--------------------------------------------------------------------- |
||
312 | right_prepare_extension_start_1: |
||
313 | xor ebp,ebp |
||
314 | mov edi,[esp+4] |
||
315 | .start: |
||
316 | xor eax,eax |
||
317 | mov [edi+300],eax |
||
318 | add edi,304 |
||
319 | inc ebp |
||
320 | cmp ebp,[right_folder_block] |
||
321 | jb .start |
||
322 | ret |
||
323 | ;--------------------------------------------------------------------- |
||
324 | prepare_data_1: |
||
325 | mov [dir_or_file],1 |
||
326 | mov [dir_temp_counter],0 |
||
327 | ret |
||
328 | ;--------------------------------------------------------------------- |
||
329 | prepare_data_2: |
||
330 | mov eax,[dir_temp_counter] |
||
331 | mov [dir_temp_counter_1],eax |
||
332 | imul eax,304 |
||
333 | add [esp+4],eax |
||
334 | mov [dir_or_file],0 |
||
335 | ret |
||
336 | ;--------------------------------------------------------------------- |
||
337 | prepare_data_3: |
||
338 | mov edi,[esp+4+4] |
||
339 | add esi,40 |
||
340 | add edi,40 |
||
341 | mov [sort_counter],0 |
||
342 | ret |
||
343 | ;--------------------------------------------------------------------- |
||
344 | prepare_data_4: |
||
345 | mov eax,[dir_temp_counter_1] |
||
346 | imul eax,304 |
||
347 | sub [esp+4],eax |
||
348 | ret |
||
349 | ;--------------------------------------------------------------------- |
||
350 | prepare_data_5: |
||
351 | xor eax,eax |
||
352 | mov ax,[esi+302-40] |
||
353 | add esi,eax |
||
354 | mov ax,[edi+302-40] |
||
355 | add edi,eax |
||
356 | ret |
||
357 | ;--------------------------------------------------------------------- |
||
358 | sort_by_name: |
||
359 | mov esi,[esp+8] |
||
360 | mov edi,[esp+4] |
||
361 | .start: |
||
362 | cld |
||
363 | lodsd |
||
364 | mov ebx,[edi] ; bufer |
||
365 | add edi,4 |
||
366 | cmp al,bl |
||
367 | jnz @f |
||
368 | test bl, bl |
||
369 | jz @f |
||
370 | cmp ah,bh |
||
371 | jnz @f |
||
372 | test bh, bh |
||
373 | jz @f |
||
374 | ror eax,16 |
||
375 | ror ebx,16 |
||
376 | cmp al,bl |
||
377 | jnz @f |
||
378 | test bl, bl |
||
379 | jz @f |
||
380 | cmp ah, bh |
||
381 | jnz @f |
||
382 | test bh, bh |
||
383 | jnz .start |
||
384 | @@: |
||
385 | ret |
||
386 | ;--------------------------------------------------------------------- |
||
387 | sort_by_name_3: |
||
388 | mov esi,[esp+8] |
||
389 | mov edi,[esp+4] |
||
390 | .start: |
||
391 | cld |
||
392 | lodsd |
||
393 | mov ecx,4 |
||
394 | rep scasb |
||
395 | jz .start |
||
396 | ret |
||
397 | ;--------------------------------------------------------------------- |
||
398 | sort_by_name_1: |
||
399 | mov esi,[esp+8] |
||
400 | mov edi,[esp+4] |
||
401 | cmp [edi],byte 255 |
||
402 | je @f |
||
403 | .start: |
||
404 | cld |
||
405 | lodsb |
||
406 | mov ah,[edi] ; bufer |
||
407 | inc edi |
||
408 | cmp al,ah |
||
409 | jnz @f |
||
410 | test ah, ah |
||
411 | jnz .start |
||
412 | @@: |
||
413 | ret |
||
414 | ;--------------------------------------------------------------------- |
||
415 | align 4 |
||
416 | sort_by_date: |
||
417 | mov eax,[esi-12] ;+28-40] |
||
418 | cmp eax,[edi-12] ;+28-40] |
||
419 | jnz .end |
||
420 | mov eax,[esi-16] ;+24-40] |
||
421 | cmp eax,[edi-16] ;+24-40] |
||
422 | .end: |
||
423 | ret |
||
424 | |||
425 | ;mov eax,[esi-12] |
||
426 | ;cmp eax,[edi-12] |
||
427 | ;jz @f |
||
428 | ;ret |
||
429 | ;@@: |
||
430 | ;mov eax,[esi-16] |
||
431 | ;cmp eax,[edi-16] |
||
432 | ;ret |
||
433 | |||
434 | ;push ecx ; ìîæíî îïóñòèòü, åñëè ecx íå æàëêî |
||
435 | ;mov eax,[esi-12] |
||
436 | ;cmp eax,[edi-12] |
||
437 | ;setnz ch |
||
438 | ;adc ch,-2 |
||
439 | ;mov eax,[esi-16] |
||
440 | ;cmp eax,[edi-16] |
||
441 | ;setnz cl |
||
442 | ;adc cl,-2 |
||
443 | ;cmp cx,0xFEFE |
||
444 | ;pop ecx |
||
445 | ;ret |
||
446 | ;--------------------------------------------------------------------- |
||
447 | align 4 |
||
448 | sort_by_size: |
||
449 | mov eax,[esi-4] ;+36-40] |
||
450 | cmp eax,[edi-4] ;+36-40] |
||
451 | jnz .end |
||
452 | mov eax,[esi-8] ;+32-40] |
||
453 | cmp eax,[edi-8] ;+32-40] |
||
454 | .end: |
||
455 | ret |
||
456 | |||
457 | ;mov eax,[esi-4] |
||
458 | ;cmp eax,[edi-4] |
||
459 | ;jz @f |
||
460 | ;ret |
||
461 | ;@@: |
||
462 | ;mov eax,[esi-8] |
||
463 | ;cmp eax,[edi-8] |
||
464 | ;ret |
||
465 | |||
466 | ;push ecx ; ìîæíî îïóñòèòü, åñëè ecx íå æàëêî |
||
467 | ;mov eax,[esi-4] |
||
468 | ;cmp eax,[edi-4] |
||
469 | ;setnz ch |
||
470 | ;adc ch,-2 |
||
471 | ;mov eax,[esi-8] |
||
472 | ;cmp eax,[edi-8] |
||
473 | ;setnz cl |
||
474 | ;adc cl,-2 |
||
475 | ;cmp cx,0xFEFE |
||
476 | ;pop ecx |
||
477 | ;ret |
||
478 | ;--------------------------------------------------------------------- |
||
479 | add_counter: |
||
480 | add edi,304 |
||
481 | mov eax,[appl_memory] |
||
482 | sub eax,304-40 |
||
483 | cmp eax,edi |
||
484 | ret |
||
485 | ;--------------------------------------------------------------------- |
||
486 | copy_folders_1: |
||
487 | mov edi,ebp |
||
488 | call multiple_304 |
||
489 | ; imul edi,304 |
||
490 | mov esi,edi |
||
491 | add esi,[left_folder_data] |
||
492 | add esi,32 |
||
493 | mov ah,0x10 |
||
494 | mov al,[esi] |
||
495 | cmp [dir_or_file],0 |
||
496 | ret |
||
497 | ;--------------------------------------------------------------------- |
||
498 | copy_folders_2: |
||
499 | mov edi,ebp |
||
500 | call multiple_304 |
||
501 | ; imul edi,304 |
||
502 | mov esi,edi |
||
503 | add esi,[right_folder_data] |
||
504 | add esi,32 |
||
505 | cmp [dir_or_file],0 |
||
506 | ret |
||
507 | ;--------------------------------------------------------------------- |
||
508 | move_bdvk: |
||
509 | sub esi,40 |
||
510 | mov edi,[sort_counter] |
||
511 | call multiple_304 |
||
512 | add edi,[esp+4+4] |
||
513 | call move_bdvk_1 |
||
514 | inc [dir_temp_counter] |
||
515 | ret |
||
516 | ;--------------------------------------------------------------------- |
||
517 | move_bdvk_1: |
||
518 | mov eax,[esi+300] |
||
519 | mov [edi+300],eax |
||
520 | mov ecx,0 |
||
521 | mov [edi+299],cl |
||
522 | mov cx,[esi+300] |
||
523 | add ecx,41 |
||
524 | ror ecx,2 |
||
525 | mov ax,cx |
||
526 | xor cx,cx |
||
527 | rol ecx,2 |
||
528 | mov bx,cx |
||
529 | mov cx,ax |
||
530 | cld |
||
531 | rep movsd |
||
532 | mov cx,bx |
||
533 | rep movsb |
||
534 | ret |
||
535 | ;--------------------------------------------------------------------- |
||
536 | multiple_304: |
||
537 | shl edi,4 |
||
538 | mov eax,edi |
||
539 | mov ebx,eax |
||
540 | shl edi,5 |
||
541 | shl eax,3 |
||
542 | sub edi,eax |
||
543 | mov eax,ebx |
||
544 | shl ebx,2 |
||
545 | sub edi,ebx |
||
546 | sub edi,eax |
||
547 | ret |
||
548 | ;--------------------------------------------------------------------- |
||
549 | move_area_for_bdvk: |
||
550 | mov eax,[dir_temp_counter] |
||
551 | mov edi,[sort_counter] |
||
552 | test eax,eax |
||
553 | je .end |
||
554 | cmp eax,edi |
||
555 | jbe .end |
||
556 | call multiple_304 |
||
557 | ; imul edi,304 |
||
558 | mov ecx,edi |
||
559 | mov edi,[dir_temp_counter] |
||
560 | add edi,2 |
||
561 | call multiple_304 |
||
562 | ; imul edi,304 |
||
563 | mov eax,ecx |
||
564 | mov ebx,[esp+12+4] |
||
565 | add edi,ebx |
||
566 | mov edx,[appl_memory] |
||
567 | cmp edi,edx |
||
568 | jbe @f |
||
569 | mov edi,edx |
||
570 | @@: |
||
571 | mov esi,edi |
||
572 | sub esi,304 |
||
573 | mov ecx,edi |
||
574 | sub ecx,ebx |
||
575 | sub ecx,eax |
||
576 | shr ecx,2 |
||
577 | std |
||
578 | rep movsd |
||
579 | |||
580 | ; mov eax,ecx |
||
581 | ; mov ebx,304 |
||
582 | ; mov edx,0 |
||
583 | ; div ebx |
||
584 | ; mov ecx,eax |
||
585 | ; sub ecx,2 |
||
586 | ; mov eax,[appl_memory] |
||
587 | ; mov [temp_ecx],edi |
||
588 | ; mov [temp_ebx],esi |
||
589 | ; mov [temp_eax],eax |
||
590 | ; pusha |
||
591 | ; call draw_window |
||
592 | ; mcall 5,300 |
||
593 | ; popa |
||
594 | ; sub edi,303 |
||
595 | ; sub esi,303 |
||
596 | ;@@: |
||
597 | ; push ecx esi edi |
||
598 | ; call move_bdvk_1 |
||
599 | ; pop edi esi ecx |
||
600 | ; sub edi,304 |
||
601 | ; sub esi,304 |
||
602 | ; dec ecx |
||
603 | ; jnz @b |
||
604 | .end: |
||
605 | ret |
||
606 | ;--------------------------------------------------------------------- |
||
607 | search_extension_start: |
||
608 | mov edx,esi |
||
609 | xor eax,eax |
||
610 | @@: |
||
611 | cld |
||
612 | lodsb |
||
613 | test eax,eax |
||
614 | jnz @b |
||
615 | dec esi |
||
616 | dec edx |
||
617 | push esi |
||
618 | @@: |
||
619 | std |
||
620 | lodsb |
||
621 | cmp esi,edx |
||
622 | je .end |
||
623 | cmp al,'.' |
||
624 | jnz @b |
||
625 | add esi,2 |
||
626 | pop ebx |
||
627 | ret |
||
628 | .end: |
||
629 | pop esi |
||
630 | mov ebx,esi |
||
631 | ret |
||
632 | ;--------------------------------------------------------------------- |
||
633 | right_sort_files: |
||
634 | mov eax,[right_folder_data] |
||
635 | add eax,32+40 |
||
636 | cmp [eax],word '..' |
||
637 | jne @f |
||
638 | cmp [eax+2],byte 0 |
||
639 | jne @f |
||
640 | add [right_folder_data],304 |
||
641 | dec [right_folder_block] |
||
642 | mov [exit_to_dir],1 |
||
643 | @@: |
||
644 | ; add memory for sorting |
||
645 | mov ecx,[appl_memory] |
||
646 | push ecx |
||
647 | sub ecx,[right_folder_data] |
||
648 | add ecx,[esp] |
||
649 | mov [appl_memory],ecx |
||
650 | mcall 64,1 |
||
651 | mov edi,[esp] |
||
652 | mov ecx,[appl_memory] |
||
653 | sub ecx,edi |
||
654 | shr ecx,2 |
||
655 | mov eax,0xffffffff |
||
656 | cld |
||
657 | rep stosd |
||
658 | cmp [right_sort_flag],0 |
||
659 | je right_name_sort |
||
660 | cmp [right_sort_flag],1 |
||
661 | je right_type_sort |
||
662 | jmp right_size_date_sort |
||
663 | .move_sorted_file: |
||
664 | ; move sorted file area in folder area |
||
665 | mov esi,[esp] |
||
666 | mov ecx,esi |
||
667 | mov edi,[right_folder_data] |
||
668 | add edi,32 |
||
669 | sub ecx,edi |
||
670 | shr ecx,2 |
||
671 | cld |
||
672 | rep movsd |
||
673 | cmp [exit_to_dir],0 |
||
674 | je @f |
||
675 | sub [right_folder_data],304 |
||
676 | inc [right_folder_block] |
||
677 | mov [exit_to_dir],0 |
||
678 | @@: |
||
679 | ; sub memory for sorting |
||
680 | pop ecx |
||
681 | mov [appl_memory],ecx |
||
682 | mcall 64,1 |
||
683 | ret |
||
684 | ;--------------------------------------------------------------------- |
||
685 | right_name_sort: |
||
686 | ; sorting of files |
||
687 | call prepare_data_1 |
||
688 | call right_name_sort_1 |
||
689 | call prepare_data_2 |
||
690 | call right_name_sort_1 |
||
691 | .1: |
||
692 | call prepare_data_4 |
||
693 | jmp right_sort_files.move_sorted_file |
||
694 | right_name_sort_1: |
||
695 | xor ebp,ebp |
||
696 | .copy_folders: |
||
697 | call copy_folders_2 |
||
698 | je .file |
||
699 | test [esi],byte 0x10 |
||
700 | jz .continue |
||
701 | jmp @f |
||
702 | .file: |
||
703 | test [esi],byte 0x10 |
||
704 | jnz .continue |
||
705 | @@: |
||
706 | call prepare_data_3 |
||
707 | .start: |
||
708 | push esi edi |
||
709 | call sort_by_name.start |
||
710 | jae .add_counter |
||
711 | .no_add_counter: |
||
712 | call move_area_for_bdvk |
||
713 | pop edi esi |
||
714 | jmp .end |
||
715 | .add_counter: |
||
716 | inc [sort_counter] |
||
717 | pop edi esi |
||
718 | call add_counter |
||
719 | jae .start |
||
720 | .end: |
||
721 | call move_bdvk |
||
722 | .continue: |
||
723 | inc ebp |
||
724 | cmp ebp,[right_folder_block] |
||
725 | jb .copy_folders |
||
726 | ret |
||
727 | ;--------------------------------------------------------------------- |
||
728 | right_type_sort: |
||
729 | ; sorting of files |
||
730 | call right_prepare_extension_start_1 |
||
731 | call prepare_data_1 |
||
732 | call right_type_sort_1 |
||
733 | call prepare_data_2 |
||
734 | call right_type_sort_1 |
||
735 | jmp right_name_sort.1 |
||
736 | right_type_sort_1: |
||
737 | xor ebp,ebp |
||
738 | .copy_folders: |
||
739 | call copy_folders_2 |
||
740 | je .file |
||
741 | test [esi],byte 0x10 |
||
742 | jz .continue |
||
743 | jmp @f |
||
744 | .file: |
||
745 | test [esi],byte 0x10 |
||
746 | jnz .continue |
||
747 | @@: |
||
748 | call prepare_data_3 |
||
749 | .start: |
||
750 | push esi edi |
||
751 | cmp [dir_or_file],1 |
||
752 | je @f |
||
753 | call prepare_data_5 |
||
754 | @@: |
||
755 | call sort_by_name.start |
||
756 | je .1 |
||
757 | ja .add_counter |
||
758 | .no_add_counter: |
||
759 | call move_area_for_bdvk |
||
760 | pop edi esi |
||
761 | jmp .end |
||
762 | .1: |
||
763 | cmp [dir_or_file],1 |
||
764 | je .add_counter |
||
765 | call sort_by_name |
||
766 | jbe .no_add_counter |
||
767 | .add_counter: |
||
768 | inc [sort_counter] |
||
769 | pop edi esi |
||
770 | call add_counter |
||
771 | jae .start |
||
772 | .end: |
||
773 | call move_bdvk |
||
774 | .continue: |
||
775 | inc ebp |
||
776 | cmp ebp,[right_folder_block] |
||
777 | jb .copy_folders |
||
778 | ret |
||
779 | ;--------------------------------------------------------------------- |
||
780 | right_size_date_sort: |
||
781 | ; sorting of files |
||
782 | call prepare_data_1 |
||
783 | call right_size_date_sort_1 |
||
784 | call prepare_data_2 |
||
785 | call right_size_date_sort_1 |
||
786 | jmp right_name_sort.1 |
||
787 | right_size_date_sort_1: |
||
788 | xor ebp,ebp |
||
789 | .copy_folders: |
||
790 | call copy_folders_2 |
||
791 | je .file |
||
792 | test [esi],byte 0x10 |
||
793 | jz .continue |
||
794 | jmp @f |
||
795 | .file: |
||
796 | test [esi],byte 0x10 |
||
797 | jnz .continue |
||
798 | @@: |
||
799 | call prepare_data_3 |
||
800 | .start: |
||
801 | push esi edi |
||
802 | cmp [right_sort_flag],2 |
||
803 | je .size_sort |
||
804 | call sort_by_date |
||
805 | je .1 |
||
806 | ja .add_counter |
||
807 | jmp .no_add_counter |
||
808 | .size_sort: |
||
809 | cmp [dir_or_file],0 |
||
810 | je .file_1 |
||
811 | call sort_by_name.start |
||
812 | jmp @f |
||
813 | .file_1: |
||
814 | call sort_by_size |
||
815 | @@: |
||
816 | jae .add_counter |
||
817 | .no_add_counter: |
||
818 | call move_area_for_bdvk |
||
819 | pop edi esi |
||
820 | jmp .end |
||
821 | .1: |
||
822 | call sort_by_name.start |
||
823 | jbe .no_add_counter |
||
824 | .add_counter: |
||
825 | inc [sort_counter] |
||
826 | pop edi esi |
||
827 | call add_counter |
||
828 | jae .start |
||
829 | .end: |
||
830 | call move_bdvk |
||
831 | .continue: |
||
832 | inc ebp |
||
833 | cmp ebp,[right_folder_block] |
||
834 | jb .copy_folders |
||
835 | ret |
||
836 | ;--------------------------------------------------------------------- |