Subversion Repositories Kolibri OS

Rev

Rev 3731 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. left_sort_files:
  2. ;   mcall 26,9
  3. ;   mov  [timer_tick],eax
  4.    cmp   [left_folder_block], 0
  5.    jz    .nothing
  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
  15.    jz    .return_exit_to_dir
  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
  22.    add   ecx,4 ; äëÿ ñòðàõîâêè
  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
  48. ; sub memory for sorting
  49.    pop   ecx
  50.    add   ecx,4 ; äëÿ ñòðàõîâêè
  51.    mov   [appl_memory],ecx
  52.    mcall 64,1
  53.    cmp   [exit_to_dir],0
  54.    je    @f
  55. .return_exit_to_dir:
  56.    sub   [left_folder_data],304
  57.    inc   [left_folder_block]
  58.    mov   [exit_to_dir],0
  59. @@:
  60. .nothing:
  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:
  143. ;       pushad
  144. ;       pushfd
  145. ;       dps     'left_type_sort'
  146. ;       newline
  147. ;       popfd
  148. ;       popad
  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
  230.    mov   esi,[left_folder_data]
  231.    add   esi,32+40
  232. .start:
  233.    call  prepare_extension_start_all
  234.    cmp   ebp,[left_folder_block]
  235.    jb    .start
  236.    ret
  237. ;---------------------------------------------------------------------
  238. prepare_extension_start_all:
  239.    push  esi
  240.    call  search_extension_start
  241.    mov   eax,esi
  242.    pop   esi
  243.    sub   eax,esi
  244.    sub   ebx,esi
  245.    shl   eax,16
  246.    mov   ax,bx
  247.    mov   [esi+300-40],eax
  248.    mov   [esi+299-40],byte 0
  249.    add   esi,304
  250.    inc   ebp
  251.    ret
  252. ;---------------------------------------------------------------------
  253. left_prepare_extension_start_1:
  254.    xor   ebp,ebp
  255.    mov   edi,[esp+4]
  256. .start:
  257.    xor   eax,eax
  258.    mov   [edi+300],eax
  259.    add   edi,304
  260.    inc   ebp
  261.    cmp   ebp,[left_folder_block]
  262.    jb    .start
  263.    ret
  264. ;---------------------------------------------------------------------
  265. ;left_files_name_normalize:
  266. ;   xor  ebp,ebp
  267. ;   mov  esi,[left_folder_data]
  268. ;   add  esi,32+40
  269. ;.start:
  270. ;   push  esi
  271. ;   mov  al,[esi]
  272. ;   call  char_toupper
  273. ;   mov  [esi],al
  274. ;@@:
  275. ;   inc  esi
  276. ;   mov  al,[esi]
  277. ;   test  al,al
  278. ;   jz  @f
  279. ;   call  char_todown
  280. ;   mov  [esi],al
  281. ;   jmp  @b
  282. ;@@:
  283. ;   pop  esi
  284. ;   add  esi,304
  285. ;   inc  ebp
  286. ;   cmp  ebp,[left_folder_block]
  287. ;   jb   .start
  288. ;   ret
  289. ;---------------------------------------------------------------------
  290. ;right_files_name_normalize:
  291. ;   xor  ebp,ebp
  292. ;   mov  esi,[right_folder_data]
  293. ;   add  esi,32+40
  294. ;.start:
  295. ;   push  esi
  296. ;   mov  al,[esi]
  297. ;   call  char_toupper
  298. ;   mov  [esi],al
  299. ;@@:
  300. ;   inc  esi
  301. ;   mov  al,[esi]
  302. ;   test  al,al
  303. ;   jz  @f
  304. ;   call  char_todown
  305. ;   mov  [esi],al
  306. ;   jmp  @b
  307. ;@@:
  308. ;   pop  esi
  309. ;   add  esi,304
  310. ;   inc  ebp
  311. ;   cmp  ebp,[right_folder_block]
  312. ;   jb   .start
  313. ;   ret
  314. ;---------------------------------------------------------------------
  315. right_prepare_extension_start:
  316.    xor   ebp,ebp
  317.    mov   esi,[right_folder_data]
  318.    add   esi,32+40
  319. .start:
  320.    call  prepare_extension_start_all
  321.    cmp   ebp,[right_folder_block]
  322.    jb    .start
  323.    ret
  324. ;---------------------------------------------------------------------
  325. right_prepare_extension_start_1:
  326.    xor   ebp,ebp
  327.    mov   edi,[esp+4]
  328. .start:
  329.    xor   eax,eax
  330.    mov   [edi+300],eax
  331.    add   edi,304
  332.    inc   ebp
  333.    cmp   ebp,[right_folder_block]
  334.    jb    .start
  335.    ret
  336. ;---------------------------------------------------------------------
  337. prepare_data_1:
  338.    mov   [dir_or_file],1
  339.    mov   [dir_temp_counter],0
  340.    ret
  341. ;---------------------------------------------------------------------
  342. prepare_data_2:
  343.    mov   eax,[dir_temp_counter]
  344.    mov   [dir_temp_counter_1],eax
  345.    imul  eax,304
  346.    add   [esp+4],eax
  347.    mov   [dir_or_file],0
  348.    ret
  349. ;---------------------------------------------------------------------
  350. prepare_data_3:
  351.    mov   edi,[esp+4+4]
  352.    add   esi,40
  353.    add   edi,40
  354.    mov   [sort_counter],0
  355.    ret
  356. ;---------------------------------------------------------------------
  357. prepare_data_4:
  358.    mov   eax,[dir_temp_counter_1]
  359.    imul  eax,304
  360.    sub   [esp+4],eax
  361.    ret
  362. ;---------------------------------------------------------------------
  363. prepare_data_5:
  364.    xor  eax,eax
  365.    mov   ax,[esi+302-40]
  366.    add   esi,eax
  367.    mov   ax,[edi+302-40]
  368.    add   edi,eax
  369.    ret
  370. ;---------------------------------------------------------------------
  371. sort_by_name:
  372.    mov   esi,[esp+8]
  373.    mov   edi,[esp+4]
  374. .start:
  375.    cld
  376.    lodsd
  377.    mov   ebx,[edi]  ; bufer
  378.    add   edi,4
  379.    cmp   al,bl
  380.    jnz   @f
  381.    test  bl, bl
  382.    jz    @f
  383.    cmp   ah,bh
  384.    jnz   @f
  385.    test  bh, bh
  386.    jz    @f
  387.    ror   eax,16
  388.    ror   ebx,16
  389.    cmp   al,bl
  390.    jnz   @f
  391.    test  bl, bl
  392.    jz    @f
  393.    cmp   ah, bh
  394.    jnz   @f
  395.    test  bh, bh
  396.    jnz   .start
  397. @@:
  398.    ret
  399. ;---------------------------------------------------------------------
  400. sort_by_name_3:
  401.    mov   esi,[esp+8]
  402.    mov   edi,[esp+4]
  403. .start:
  404.    cld
  405.    lodsd
  406.    mov  ecx,4
  407.    rep scasb
  408.    jz  .start
  409.    ret
  410. ;---------------------------------------------------------------------
  411. sort_by_name_1:
  412.    mov   esi,[esp+8]
  413.    mov   edi,[esp+4]
  414.    cmp   [edi],byte 255
  415.    je    @f
  416. .start:
  417.    cld
  418.    lodsb
  419.    mov   ah,[edi]  ; bufer
  420.    inc   edi
  421.    cmp   al,ah
  422.    jnz   @f
  423.    test  ah, ah
  424.    jnz   .start
  425. @@:
  426.    ret
  427. ;---------------------------------------------------------------------
  428. align 4
  429. sort_by_date:
  430.    mov  eax,[esi-12]  ;+28-40]
  431.    cmp  eax,[edi-12]  ;+28-40]
  432.    jnz  .end
  433.    mov  eax,[esi-16]  ;+24-40]
  434.    cmp  eax,[edi-16]  ;+24-40]
  435. .end:
  436.    ret
  437.  
  438. ;mov eax,[esi-12]
  439. ;cmp eax,[edi-12]
  440. ;jz @f
  441. ;ret
  442. ;@@:
  443. ;mov eax,[esi-16]
  444. ;cmp eax,[edi-16]
  445. ;ret
  446.  
  447. ;push ecx ; ìîæíî îïóñòèòü, åñëè ecx íå æàëêî
  448. ;mov eax,[esi-12]
  449. ;cmp eax,[edi-12]
  450. ;setnz ch
  451. ;adc ch,-2
  452. ;mov eax,[esi-16]
  453. ;cmp eax,[edi-16]
  454. ;setnz cl
  455. ;adc cl,-2
  456. ;cmp cx,0xFEFE
  457. ;pop ecx
  458. ;ret
  459. ;---------------------------------------------------------------------
  460. align 4
  461. sort_by_size:
  462.    mov  eax,[esi-4]   ;+36-40]
  463.    cmp  eax,[edi-4]   ;+36-40]
  464.    jnz  .end
  465.    mov  eax,[esi-8]   ;+32-40]
  466.    cmp  eax,[edi-8]   ;+32-40]
  467. .end:
  468.    ret
  469.  
  470. ;mov eax,[esi-4]
  471. ;cmp eax,[edi-4]
  472. ;jz @f
  473. ;ret
  474. ;@@:
  475. ;mov eax,[esi-8]
  476. ;cmp eax,[edi-8]
  477. ;ret
  478.  
  479. ;push ecx ; ìîæíî îïóñòèòü, åñëè ecx íå æàëêî
  480. ;mov eax,[esi-4]
  481. ;cmp eax,[edi-4]
  482. ;setnz ch
  483. ;adc ch,-2
  484. ;mov eax,[esi-8]
  485. ;cmp eax,[edi-8]
  486. ;setnz cl
  487. ;adc cl,-2
  488. ;cmp cx,0xFEFE
  489. ;pop ecx
  490. ;ret
  491. ;---------------------------------------------------------------------
  492. add_counter:
  493.    add   edi,304
  494.    mov   eax,[appl_memory]
  495.    sub   eax,304-40
  496.    cmp   eax,edi
  497.    ret
  498. ;---------------------------------------------------------------------
  499. copy_folders_1:
  500.    mov   edi,ebp
  501.    call  multiple_304
  502. ;   imul  edi,304
  503.    mov   esi,edi
  504.    add   esi,[left_folder_data]
  505.    add   esi,32
  506.    mov   ah,0x10
  507.    mov   al,[esi]
  508.    cmp   [dir_or_file],0
  509.    ret
  510. ;---------------------------------------------------------------------
  511. copy_folders_2:
  512.    mov   edi,ebp
  513.    call  multiple_304
  514. ;   imul  edi,304
  515.    mov   esi,edi
  516.    add   esi,[right_folder_data]
  517.    add   esi,32
  518.    cmp   [dir_or_file],0
  519.    ret
  520. ;---------------------------------------------------------------------
  521. move_bdvk:
  522.    sub   esi,40
  523.    mov   edi,[sort_counter]
  524.    call  multiple_304
  525.    add   edi,[esp+4+4]
  526.    call  move_bdvk_1
  527.    inc   [dir_temp_counter]
  528.    ret
  529. ;---------------------------------------------------------------------
  530. move_bdvk_1:
  531.    mov   eax,[esi+300]
  532.    mov   [edi+300],eax
  533.    mov   ecx,0
  534.    mov   [edi+299],cl
  535.    mov   cx,[esi+300]
  536.    add   ecx,41
  537.    ror   ecx,2
  538.    mov   ax,cx
  539.    xor   cx,cx
  540.    rol   ecx,2
  541.    mov   bx,cx
  542.    mov   cx,ax
  543.    cld
  544.    rep   movsd
  545.    mov   cx,bx
  546.    rep   movsb
  547.    ret
  548. ;---------------------------------------------------------------------
  549. multiple_304:
  550.    shl   edi,4
  551.    mov   eax,edi
  552.    mov   ebx,eax
  553.    shl   edi,5
  554.    shl   eax,3
  555.    sub   edi,eax
  556.    mov   eax,ebx
  557.    shl   ebx,2
  558.    sub   edi,ebx
  559.    sub   edi,eax
  560.    ret
  561. ;---------------------------------------------------------------------
  562. move_area_for_bdvk:
  563.    mov   eax,[dir_temp_counter]
  564.    mov   edi,[sort_counter]
  565.    test  eax,eax
  566.    je    .end
  567.    cmp   eax,edi
  568.    jbe   .end
  569.    call  multiple_304
  570. ;   imul  edi,304
  571.    mov   ecx,edi
  572.    mov   edi,[dir_temp_counter]
  573.    add   edi,2
  574.    call  multiple_304
  575. ;   imul  edi,304
  576.    mov   eax,ecx
  577.    mov   ebx,[esp+12+4]
  578.    add   edi,ebx
  579.    mov   edx,[appl_memory]
  580.    cmp   edi,edx
  581.    jbe   @f
  582.    mov   edi,edx
  583. @@:
  584.    mov   esi,edi
  585.    sub   esi,304
  586.    mov   ecx,edi
  587.    sub   ecx,ebx
  588.    sub   ecx,eax
  589.    shr   ecx,2
  590. ;       pushad
  591. ;       pushfd
  592. ;       dph     [appl_memory]
  593. ;       newline
  594. ;       dps     'ECX:'
  595. ;       dpd     ecx
  596. ;       newline
  597. ;       dps     'ESI:'
  598. ;       dpd     esi
  599. ;       newline
  600. ;       dps     'EDI:'
  601. ;       dpd     edi
  602. ;       newline
  603. ;       popfd
  604. ;       popad
  605.    std
  606.    rep   movsd
  607. ;       pushad
  608. ;       pushfd
  609. ;       dps     'move_area_for_bdvk END'
  610. ;       newline
  611. ;       popfd
  612. ;       popad
  613. ;   mov  eax,ecx
  614. ;   mov  ebx,304
  615. ;   mov  edx,0
  616. ;   div  ebx
  617. ;   mov  ecx,eax
  618. ;   sub  ecx,2
  619. ;   mov  eax,[appl_memory]
  620. ;   mov  [temp_ecx],edi
  621. ;   mov  [temp_ebx],esi
  622. ;   mov  [temp_eax],eax
  623. ;   pusha
  624. ;   call  draw_window
  625. ;   mcall 5,300
  626. ;   popa
  627. ;   sub   edi,303
  628. ;   sub   esi,303
  629. ;@@:
  630. ;   push  ecx esi edi
  631. ;   call  move_bdvk_1
  632. ;   pop  edi esi ecx
  633. ;   sub  edi,304
  634. ;   sub  esi,304
  635. ;   dec  ecx
  636. ;   jnz  @b
  637. .end:
  638.    ret
  639. ;---------------------------------------------------------------------
  640. search_extension_start:
  641.    mov   edx,esi
  642.    xor   eax,eax
  643. @@:
  644.    cld
  645.    lodsb
  646.    test  eax,eax
  647.    jnz   @b
  648.    dec   esi
  649.    dec   edx
  650.    push  esi
  651. @@:
  652.    std
  653.    lodsb
  654.    cmp   esi,edx
  655.    je    .end
  656.    cmp   al,'.'
  657.    jnz   @b
  658.    add   esi,2
  659.    pop   ebx
  660.    ret
  661. .end:
  662.    pop  esi
  663.    mov  ebx,esi
  664.    ret
  665. ;---------------------------------------------------------------------
  666. right_sort_files:
  667.    cmp   [right_folder_block], 0
  668.    jz    .nothing
  669.    mov   eax,[right_folder_data]
  670.    add   eax,32+40
  671.    cmp   [eax],word '..'
  672.    jne   @f
  673.    cmp   [eax+2],byte 0
  674.    jne   @f
  675.    add   [right_folder_data],304
  676.    dec   [right_folder_block]
  677.    mov   [exit_to_dir],1
  678.    jz    .return_exit_to_dir
  679. @@:
  680. ; add memory for sorting
  681.    mov   ecx,[appl_memory]
  682.    push  ecx
  683.    sub   ecx,[right_folder_data]
  684.    add   ecx,[esp]
  685.    add   ecx,4 ; äëÿ ñòðàõîâêè
  686.    mov   [appl_memory],ecx
  687.    mcall 64,1
  688.    mov   edi,[esp]
  689.    mov   ecx,[appl_memory]
  690.    sub   ecx,edi
  691.    shr   ecx,2
  692.    mov   eax,0xffffffff
  693.    cld
  694.    rep   stosd
  695.    cmp   [right_sort_flag],0
  696.    je    right_name_sort
  697.    cmp   [right_sort_flag],1
  698.    je    right_type_sort
  699.    jmp    right_size_date_sort
  700. .move_sorted_file:
  701. ; move sorted file area in folder area
  702.    mov   esi,[esp]
  703.    mov   ecx,esi
  704.    mov   edi,[right_folder_data]
  705.    add   edi,32
  706.    sub   ecx,edi
  707.    shr   ecx,2
  708.    cld
  709.    rep   movsd
  710. ; sub memory for sorting
  711.    pop   ecx
  712.    add   ecx,4 ; äëÿ ñòðàõîâêè
  713.    mov   [appl_memory],ecx
  714.    mcall 64,1
  715.    cmp   [exit_to_dir],0
  716.    je    @f
  717. .return_exit_to_dir:
  718.    sub   [right_folder_data],304
  719.    inc   [right_folder_block]
  720.    mov   [exit_to_dir],0
  721. @@:
  722. .nothing:
  723.    ret
  724. ;---------------------------------------------------------------------
  725. right_name_sort:
  726. ; sorting of files
  727.    call  prepare_data_1
  728.    call  right_name_sort_1
  729.    call  prepare_data_2
  730.    call  right_name_sort_1
  731. .1:
  732.    call  prepare_data_4
  733.    jmp   right_sort_files.move_sorted_file
  734. right_name_sort_1:
  735.    xor   ebp,ebp
  736. .copy_folders:
  737.    call  copy_folders_2
  738.    je    .file
  739.    test  [esi],byte 0x10
  740.    jz    .continue
  741.    jmp   @f
  742. .file:
  743.    test  [esi],byte 0x10
  744.    jnz   .continue
  745. @@:
  746.    call  prepare_data_3
  747. .start:
  748.    push esi edi
  749.    call  sort_by_name.start
  750.    jae   .add_counter
  751. .no_add_counter:
  752.    call  move_area_for_bdvk
  753.    pop   edi esi
  754.    jmp  .end
  755. .add_counter:
  756.    inc   [sort_counter]
  757.    pop   edi esi
  758.    call  add_counter
  759.    jae   .start
  760. .end:
  761.    call  move_bdvk
  762. .continue:
  763.    inc   ebp
  764.    cmp   ebp,[right_folder_block]
  765.    jb    .copy_folders
  766.    ret
  767. ;---------------------------------------------------------------------
  768. right_type_sort:
  769. ; sorting of files
  770.    call  right_prepare_extension_start_1
  771.    call  prepare_data_1
  772.    call  right_type_sort_1
  773.    call  prepare_data_2
  774.    call  right_type_sort_1
  775.    jmp   right_name_sort.1
  776. right_type_sort_1:
  777.    xor   ebp,ebp
  778. .copy_folders:
  779.    call  copy_folders_2
  780.    je    .file
  781.    test  [esi],byte 0x10
  782.    jz    .continue
  783.    jmp   @f
  784. .file:
  785.    test  [esi],byte 0x10
  786.    jnz   .continue
  787. @@:
  788.    call  prepare_data_3
  789. .start:
  790.    push esi edi
  791.    cmp   [dir_or_file],1
  792.    je    @f
  793.    call  prepare_data_5
  794. @@:
  795.    call  sort_by_name.start
  796.    je    .1
  797.    ja    .add_counter
  798. .no_add_counter:
  799. ;       pushad
  800. ;       pushfd
  801. ;       dps     'left_type_sort'
  802. ;       newline
  803. ;       popfd
  804. ;       popad
  805.    call  move_area_for_bdvk
  806.    pop   edi esi
  807.    jmp  .end
  808. .1:
  809.    cmp   [dir_or_file],1
  810.    je    .add_counter
  811.    call  sort_by_name
  812.    jbe   .no_add_counter
  813. .add_counter:
  814.    inc   [sort_counter]
  815.    pop   edi esi
  816.    call  add_counter
  817.    jae   .start
  818. .end:
  819.    call  move_bdvk
  820. .continue:
  821.    inc   ebp
  822.    cmp   ebp,[right_folder_block]
  823.    jb    .copy_folders
  824.    ret
  825. ;---------------------------------------------------------------------
  826. right_size_date_sort:
  827. ; sorting of files
  828.    call  prepare_data_1
  829.    call  right_size_date_sort_1
  830.    call  prepare_data_2
  831.    call  right_size_date_sort_1
  832.    jmp   right_name_sort.1
  833. right_size_date_sort_1:
  834.    xor   ebp,ebp
  835. .copy_folders:
  836.    call  copy_folders_2
  837.    je    .file
  838.    test  [esi],byte 0x10
  839.    jz    .continue
  840.    jmp   @f
  841. .file:
  842.    test  [esi],byte 0x10
  843.    jnz   .continue
  844. @@:
  845.    call  prepare_data_3
  846. .start:
  847.    push  esi edi
  848.    cmp   [right_sort_flag],2
  849.    je    .size_sort
  850.    call  sort_by_date
  851.    je    .1
  852.    ja    .add_counter
  853.    jmp  .no_add_counter
  854. .size_sort:
  855.    cmp   [dir_or_file],0
  856.    je    .file_1
  857.    call  sort_by_name.start
  858.    jmp   @f
  859. .file_1:
  860.    call  sort_by_size
  861. @@:
  862.    jae   .add_counter
  863. .no_add_counter:
  864.    call  move_area_for_bdvk
  865.    pop   edi esi
  866.    jmp  .end
  867. .1:
  868.    call  sort_by_name.start
  869.    jbe   .no_add_counter
  870. .add_counter:
  871.    inc   [sort_counter]
  872.    pop   edi esi
  873.    call  add_counter
  874.    jae   .start
  875. .end:
  876.    call  move_bdvk
  877. .continue:
  878.    inc   ebp
  879.    cmp   ebp,[right_folder_block]
  880.    jb    .copy_folders
  881.    ret
  882. ;---------------------------------------------------------------------
  883.