Subversion Repositories Kolibri OS

Rev

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