Subversion Repositories Kolibri OS

Rev

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