Subversion Repositories Kolibri OS

Rev

Rev 9828 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
  4. ;;  Distributed under terms of the GNU General Public License.  ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8.  
  9. ; CD external functions
  10. ;   in:
  11. ; esi -> path string in UTF-8
  12. ; ebx -> parameter structure +4
  13. ; ecx = bytes to read
  14. ; edx -> buffer
  15. ;   out:
  16. ; eax, ebx = return values for sysfunc 70
  17. iglobal
  18. align 4
  19. fs_CdServices:
  20.         dd      fs_CdRead
  21.         dd      fs_CdReadFolder
  22.         dd      fs_NotImplemented
  23.         dd      fs_NotImplemented
  24.         dd      fs_NotImplemented
  25.         dd      fs_CdGetFileInfo
  26.         dd      fs_NotImplemented
  27.         dd      0
  28.         dd      fs_NotImplemented
  29.         dd      fs_NotImplemented
  30. fs_NumCdServices = ($ - fs_CdServices)/4
  31. endg
  32.  
  33. uglobal
  34. align 4
  35. cd_current_pointer_of_input     dd  0
  36. cd_current_pointer_of_input_2   dd  0
  37. cd_mem_location                 dd  0
  38. cd_counter_block                dd  0
  39. cd_status                       dd  0
  40. endg
  41.  
  42. ;-----------------------------------------------------------------------------
  43. fs_NotImplemented:
  44.         movi    eax, ERROR_UNSUPPORTED_FS
  45.         ret
  46. ;-----------------------------------------------------------------------------
  47. reserve_cd:
  48.         cli
  49.         cmp     [cd_status], 0
  50.         je      reserve_ok2
  51.  
  52.         sti
  53.         call    change_task
  54.         jmp     reserve_cd
  55. ;-----------------------------------------------------------------------------
  56. reserve_ok2:
  57.         push    eax
  58.         mov     eax, [current_slot]
  59.         mov     eax, [eax + APPDATA.tid]
  60.         mov     [cd_status], eax
  61.         pop     eax
  62.         sti
  63.         ret
  64. ;-----------------------------------------------------------------------------
  65. reserve_cd_channel:
  66.         pushad
  67.         mov     eax, [cdpos]
  68.         dec     eax
  69.         shr     eax, 2
  70.  
  71.         test    eax, eax
  72.         jnz     .1
  73.  
  74.         cmp     [ChannelNumber], 1
  75.         jne     @f
  76.  
  77.         mov     ecx, ide_channel1_mutex
  78.         jmp     .mutex_lock
  79. ;--------------------------------------
  80. @@:
  81.         mov     ecx, ide_channel2_mutex
  82.         jmp     .mutex_lock
  83. ;--------------------------------------
  84. .1:
  85.         dec     eax
  86.         jnz     .2
  87.  
  88.         cmp     [ChannelNumber], 1
  89.         jne     @f
  90.  
  91.         mov     ecx, ide_channel3_mutex
  92.         jmp     .mutex_lock
  93. ;--------------------------------------
  94. @@:
  95.         mov     ecx, ide_channel4_mutex
  96.         jmp     .mutex_lock
  97. ;--------------------------------------
  98. .2:
  99.         cmp     [ChannelNumber], 1
  100.         jne     @f
  101.  
  102.         mov     ecx, ide_channel5_mutex
  103.         jmp     .mutex_lock
  104. ;--------------------------------------
  105. @@:
  106.         mov     ecx, ide_channel6_mutex
  107. .mutex_lock:
  108.         call    mutex_lock
  109.         popad
  110.         ret
  111. ;-----------------------------------------------------------------------------
  112. free_cd_channel:
  113.         pushad
  114.         mov     eax, [cdpos]
  115.         dec     eax
  116.         shr     eax, 2
  117.  
  118.         test    eax, eax
  119.         jnz     .1
  120.  
  121.         cmp     [ChannelNumber], 1
  122.         jne     @f
  123.  
  124.         mov     ecx, ide_channel1_mutex
  125.         jmp     .mutex_unlock
  126. ;--------------------------------------
  127. @@:
  128.         mov     ecx, ide_channel2_mutex
  129.         jmp     .mutex_unlock
  130. ;--------------------------------------
  131. .1:
  132.         dec     eax
  133.         jnz     .2
  134.  
  135.         cmp     [ChannelNumber], 1
  136.         jne     @f
  137.  
  138.         mov     ecx, ide_channel3_mutex
  139.         jmp     .mutex_unlock
  140. ;--------------------------------------
  141. @@:
  142.         mov     ecx, ide_channel4_mutex
  143.         jmp     .mutex_unlock
  144. ;--------------------------------------
  145. .2:
  146.         cmp     [ChannelNumber], 1
  147.         jne     @f
  148.  
  149.         mov     ecx, ide_channel5_mutex
  150.         jmp     .mutex_unlock
  151. ;--------------------------------------
  152. @@:
  153.         mov     ecx, ide_channel6_mutex
  154. .mutex_unlock:
  155.         call    mutex_unlock
  156.         popad
  157.         ret
  158.  
  159. ;-----------------------------------------------------------------------------
  160. fs_CdRead:
  161.         call    cd_find_lfn
  162.         jc      .notFound
  163.         mov     edi, [cd_current_pointer_of_input]
  164.         test    byte [edi+25], 10b  ; do not allow read directories
  165.         jnz     .noaccess
  166.         test    ebx, ebx
  167.         jz      .l1
  168.         cmp     dword [ebx+4], 0
  169.         jz      @f
  170.         xor     ebx, ebx
  171.         movi    eax, ERROR_END_OF_FILE
  172.         ret
  173.  
  174. .notFound:
  175.         cmp     [DevErrorCode], 0
  176.         jne     .noaccess
  177.         xor     ebx, ebx
  178.         movi    eax, ERROR_FILE_NOT_FOUND
  179.         ret
  180.  
  181. .noaccess_3:
  182.         pop     eax edx ecx
  183. .noaccess:
  184.         xor     ebx, ebx
  185.         movi    eax, ERROR_ACCESS_DENIED
  186.         ret
  187.  
  188. @@:
  189.         mov     ebx, [ebx]
  190. .l1:
  191.         push    ecx edx 0
  192.         mov     eax, [edi+10]   ; real size of the file section
  193.         sub     eax, ebx
  194.         jb      .eof
  195.         cmp     eax, ecx
  196.         jae     @f
  197.         mov     ecx, eax
  198.         pop     eax
  199.         push    ERROR_END_OF_FILE
  200. @@:
  201.         mov     eax, [edi+2]
  202.         mov     [CDSectorAddress], eax
  203. ; now eax=cluster, ebx=position, ecx=count, edx=buffer for data
  204. .new_sector:
  205.         test    ecx, ecx
  206.         jz      .done
  207.         sub     ebx, 2048
  208.         jae     .next
  209.         add     ebx, 2048
  210.         jnz     .incomplete_sector
  211.         cmp     ecx, 2048
  212.         jb      .incomplete_sector
  213. ; we may read and memmove complete sector
  214.         mov     [CDDataBuf_pointer], edx
  215.         call    ReadCDWRetr
  216.         cmp     [DevErrorCode], 0
  217.         jne     .noaccess_3
  218.         add     edx, 2048
  219.         sub     ecx, 2048
  220. .next:
  221.         inc     dword [CDSectorAddress]
  222.         jmp     .new_sector
  223.  
  224. .eof:
  225.         pop     eax
  226.         push    ERROR_END_OF_FILE
  227. .done:
  228.         mov     ebx, edx
  229.         pop     eax edx ecx
  230.         sub     ebx, edx
  231.         ret
  232.  
  233. .incomplete_sector: ; we must read and memmove incomplete sector
  234.         mov     [CDDataBuf_pointer], CDDataBuf
  235.         call    ReadCDWRetr
  236.         cmp     [DevErrorCode], 0
  237.         jne     .noaccess_3
  238.         push    ecx
  239.         add     ecx, ebx
  240.         cmp     ecx, 2048
  241.         jbe     @f
  242.         mov     ecx, 2048
  243. @@:
  244.         sub     ecx, ebx
  245.         push    edi esi ecx
  246.         mov     edi, edx
  247.         lea     esi, [CDDataBuf + ebx]
  248.         cld
  249.         rep movsb
  250.         pop     ecx esi edi
  251.         add     edx, ecx
  252.         sub     [esp], ecx
  253.         pop     ecx
  254.         xor     ebx, ebx
  255.         jmp     .next
  256.  
  257. ;-----------------------------------------------------------------------------
  258. fs_CdReadFolder:
  259.         push    edi
  260.         call    cd_find_lfn
  261.         jnc     .found
  262.         pop     edi
  263.         cmp     [DevErrorCode], 0
  264.         jne     .noaccess_1
  265.         xor     ebx, ebx
  266.         mov     eax, ERROR_FILE_NOT_FOUND
  267.         ret
  268.  
  269. .found:
  270.         mov     edi, [cd_current_pointer_of_input]
  271.         test    byte [edi+25], 10b    ; do not allow read directories
  272.         jnz     .found_dir
  273.         pop     edi
  274. .noaccess_1:
  275.         xor     ebx, ebx
  276.         mov     eax, ERROR_ACCESS_DENIED
  277.         ret
  278.  
  279. .end_buffer:
  280.         pop     edx eax
  281.         sub     eax, 2048   ; directory is over?
  282.         ja      .read_to_buffer
  283.         mov     eax, [cd_counter_block]
  284.         mov     [edx+8], eax
  285.         mov     eax, [ebx]
  286.         sub     [edx+4], eax
  287.         xor     eax, eax
  288.         dec     ecx
  289.         js      @f
  290.         mov     al, ERROR_END_OF_FILE
  291. @@:
  292.         pop     ecx edi
  293.         mov     ebx, [edx+4]
  294.         ret
  295.  
  296. .found_dir:
  297.         mov     eax, [edi+2]    ; eax=cluster
  298.         mov     [CDSectorAddress], eax
  299.         mov     eax, [edi+10]   ; directory size
  300.         push    eax ecx
  301.         mov     edi, edx
  302.         mov     ecx, 32/4
  303.         xor     eax, eax
  304.         rep stosd
  305.         pop     ecx eax
  306.         mov     byte [edx], 1   ; version
  307.         mov     [cd_mem_location], edx
  308.         add     [cd_mem_location], 32
  309.         mov     [cd_counter_block], dword 0
  310.         dec     dword [CDSectorAddress]
  311.         push    ecx
  312. .read_to_buffer:
  313.         inc     dword [CDSectorAddress]
  314.         mov     [CDDataBuf_pointer], CDDataBuf
  315.         call    ReadCDWRetr     ; read sector of directory
  316.         cmp     [DevErrorCode], 0
  317.         jne     .noaccess_1
  318.         mov     [cd_current_pointer_of_input_2], CDDataBuf
  319.         push    eax edx
  320. .get_names_from_buffer:
  321.         call    cd_get_name
  322.         jc      .end_buffer
  323.         inc     dword [cd_counter_block]
  324.         mov     eax, [cd_counter_block]
  325.         cmp     [ebx], eax
  326.         jae     .get_names_from_buffer
  327.         test    ecx, ecx
  328.         jz      .get_names_from_buffer
  329.         mov     edi, [cd_counter_block]
  330.         mov     [edx+4], edi
  331.         dec     ecx
  332.         mov     esi, ebp
  333.         call    cd_get_parameters_of_file
  334.         add     edi, 40
  335.         mov     ax, '.'
  336.         cmp     dword[ebx+4], 2
  337.         jz      .utf16
  338.         cmp     dword[ebx+4], 3
  339.         jz      .utf8
  340.         cmp     [cd_counter_block], 2
  341.         jbe     .parentDirectory
  342. @@:
  343.         lodsw
  344.         xchg    ah, al
  345.         call    uni2ansi_char
  346.         stosb
  347.         call    .checkForEnd
  348.         jc      @b
  349. @@:
  350.         mov     [edi], byte 0
  351.         add     [cd_mem_location], 304
  352.         jmp     .get_names_from_buffer
  353.  
  354. .parentDirectory:
  355.         stosb
  356.         cmp     [cd_counter_block], 2
  357.         jnz     @b
  358.         stosb
  359.         jmp     @b
  360.  
  361. .utf8:
  362.         add     [cd_mem_location], 256
  363.         cmp     [cd_counter_block], 2
  364.         jbe     .parentDirectory
  365.         push    ecx
  366.         mov     ecx, 519
  367. @@:
  368.         lodsw
  369.         xchg    ah, al
  370.         call    UTF16to8
  371.         js      @f
  372.         call    .checkForEnd
  373.         jc      @b
  374. @@:
  375.         pop     ecx
  376.         mov     [edi], byte 0
  377.         add     [cd_mem_location], 304
  378.         jmp     .get_names_from_buffer
  379.  
  380. .checkForEnd:
  381.         mov     ax, [esi]
  382.         cmp     ax, 3B00h   ; ';'
  383.         jz      @f
  384. ; check for files not ending with separator
  385.         movzx   eax, byte [ebp-33]
  386.         add     eax, ebp
  387.         sub     eax, 34
  388.         cmp     esi, eax
  389.         jz      @f
  390. ; check the end of the directory
  391.         movzx   eax, byte [ebp-1]
  392.         add     eax, ebp
  393.         cmp     esi, eax
  394. @@:
  395.         ret
  396.  
  397. .utf16:
  398.         cmp     [cd_counter_block], 2
  399.         jbe     .utf16ParentDirectory
  400. @@:
  401.         lodsw
  402.         xchg    ah, al
  403.         stosw
  404.         call    .checkForEnd
  405.         jc      @b
  406. @@:
  407.         mov     [edi], word 0
  408.         add     [cd_mem_location], 560
  409.         jmp     .get_names_from_buffer
  410.  
  411. .utf16ParentDirectory:
  412.         stosw
  413.         cmp     [cd_counter_block], 2
  414.         jnz     @b
  415.         stosw
  416.         jmp     @b
  417.  
  418. cd_get_parameters_of_file:
  419.         mov     edi, [cd_mem_location]
  420. cd_get_parameters_of_file_1:
  421. ; get file attributes
  422.         xor     eax, eax
  423. ; file is not archived
  424.         inc     eax
  425.         shl     eax, 1
  426. ; is a directory?
  427.         test    [ebp-8], byte 2
  428.         jz      .file
  429.         inc     eax
  430. .file:
  431. ; not as a volume label in the FAT, in this form not available
  432. ; file is not a system
  433.         shl     eax, 3
  434. ; file is hidden? (attribute of existence)
  435.         test    [ebp-8], byte 1
  436.         jz      .hidden
  437.         inc     eax
  438. .hidden:
  439.         shl     eax, 1
  440. ; file is always read-only, as this CD
  441.         inc     eax
  442.         mov     [edi], eax
  443.         mov     eax, [ebx+4]
  444.         mov     [edi+4], eax
  445. ; get the time to file
  446. ; hour
  447.         movzx   eax, byte [ebp-12]
  448.         shl     eax, 8
  449. ; minute
  450.         mov     al, [ebp-11]
  451.         shl     eax, 8
  452. ; second
  453.         mov     al, [ebp-10]
  454. ; file creation time
  455.         mov     [edi+8], eax
  456. ; last access time
  457.         mov     [edi+16], eax
  458. ; last write time
  459.         mov     [edi+24], eax
  460. ; get date for file
  461. ; year
  462.         movzx   eax, byte [ebp-15]
  463.         add     eax, 1900
  464.         shl     eax, 8
  465. ; month
  466.         mov     al, [ebp-14]
  467.         shl     eax, 8
  468. ; day
  469.         mov     al, [ebp-13]
  470. ; file creation date
  471.         mov     [edi+12], eax
  472. ; last access date
  473.         mov     [edi+20], eax
  474. ; last write date
  475.         mov     [edi+28], eax
  476. ; get the file size in bytes
  477.         xor     eax, eax
  478.         mov     [edi+32+4], eax
  479.         mov     eax, [ebp-23]
  480.         mov     [edi+32], eax
  481.         ret
  482.  
  483. ;-----------------------------------------------------------------------------
  484. fs_CdGetFileInfo:
  485.         call    cd_find_lfn
  486.         movi    eax, ERROR_FILE_NOT_FOUND
  487.         jc      @f
  488.         mov     edi, edx
  489.         mov     eax, [ebx+4]
  490.         mov     [edx+4], eax
  491.         cmp     byte [esi], 0
  492.         jz      .volume
  493.         mov     ebp, [cd_current_pointer_of_input]
  494.         add     ebp, 33
  495.         call    cd_get_parameters_of_file_1
  496.         xor     eax, eax
  497. @@:
  498.         ret
  499.  
  500. .volume:
  501.         test    eax, eax
  502.         jz      .size
  503.         mov     ecx, 16
  504.         mov     esi, CDDataBuf+40
  505.         add     edi, 40
  506.         cmp     eax, 2
  507.         jz      .utf16
  508.         cmp     eax, 3
  509.         jz      .utf8
  510. @@:
  511.         lodsw
  512.         xchg    al, ah
  513.         call    uni2ansi_char
  514.         stosb
  515.         loop    @b
  516.         jmp     .size
  517.  
  518. .utf16:
  519.         lodsw
  520.         xchg    al, ah
  521.         stosw
  522.         loop    .utf16
  523.         jmp     .size
  524.  
  525. .utf8:
  526.         mov     ebx, ecx
  527.         shl     ecx, 1
  528. @@:
  529.         lodsw
  530.         xchg    ah, al
  531.         call    UTF16to8
  532.         dec     ebx
  533.         jnz     @b
  534. .size:
  535.         mov     eax, [CDDataBuf+80]
  536.         shl     eax, 11
  537.         mov     [edx+32], eax
  538.         xor     eax, eax
  539.         mov     [edx+36], eax
  540.         stosw
  541.         mov     byte [edx], 8
  542.         ret
  543.  
  544. ;-----------------------------------------------------------------------------
  545. cd_find_lfn:
  546.         mov     [cd_appl_data], 0
  547. ; in: esi -> path string in UTF-8
  548. ; out: [cd_current_pointer_of_input] -> direntry, CF=1 -> file not found
  549.         push    eax esi
  550. ; Sector 16 - start set of volume descriptors
  551.         call    WaitUnitReady
  552.         cmp     [DevErrorCode], 0
  553.         jne     .access_denied
  554.  
  555.         call    prevent_medium_removal
  556. ; testing of reading
  557.         mov     [CDSectorAddress], dword 16
  558.         mov     [CDDataBuf_pointer], CDDataBuf
  559.         call    ReadCDWRetr;_1
  560.         cmp     [DevErrorCode], 0
  561.         jne     .access_denied
  562.  
  563. ; calculation of the last session
  564.         call    WaitUnitReady
  565.         cmp     [DevErrorCode], 0
  566.         jne     .access_denied
  567.  
  568.         call    Read_TOC
  569.         mov     ah, [CDDataBuf+4+4]
  570.         mov     al, [CDDataBuf+4+5]
  571.         shl     eax, 16
  572.         mov     ah, [CDDataBuf+4+6]
  573.         mov     al, [CDDataBuf+4+7]
  574.         add     eax, 15
  575.         mov     [CDSectorAddress], eax
  576. ;  mov  [CDSectorAddress],dword 15
  577.         mov     [CDDataBuf_pointer], CDDataBuf
  578. ;--------------------------------------
  579. .start:
  580.         inc     dword [CDSectorAddress]
  581.         call    ReadCDWRetr;_1
  582.         cmp     [DevErrorCode], 0
  583.         jne     .access_denied
  584.  
  585. .start_check:
  586. ; checking for "lice"
  587.         cmp     [CDDataBuf+1], dword 'CD00'
  588.         jne     .access_denied
  589.  
  590.         cmp     [CDDataBuf+5], byte '1'
  591.         jne     .access_denied
  592. ; sector is the terminator of set of descriptors volumes?
  593.         cmp     [CDDataBuf], byte 0xff
  594.         je      .access_denied
  595. ; sector is an additional and improved descriptor of volume?
  596.         cmp     [CDDataBuf], byte 0x2
  597.         jne     .start
  598. ; sector is an additional descriptor of volume?
  599.         cmp     [CDDataBuf+6], byte 0x1
  600.         jne     .start
  601.  
  602. ; parameters of root directory
  603.         mov     eax, [CDDataBuf+0x9c+2]; start of root directory
  604.         mov     [CDSectorAddress], eax
  605.         mov     eax, [CDDataBuf+0x9c+10]; size of root directory
  606.         cmp     byte [esi], 0
  607.         jnz     @f
  608.  
  609.         mov     [cd_current_pointer_of_input], CDDataBuf+0x9c
  610.         jmp     .done
  611. ;--------------------------------------
  612. @@:
  613. ; start the search
  614. .mainloop:
  615.         dec     dword [CDSectorAddress]
  616. ;--------------------------------------
  617. .read_to_buffer:
  618.         inc     dword [CDSectorAddress]
  619.         mov     [CDDataBuf_pointer], CDDataBuf
  620.         call    ReadCDWRetr      ; read sector of directory
  621.         cmp     [DevErrorCode], 0
  622.         jne     .access_denied
  623.         call    cd_find_name_in_buffer
  624.         jnc     .found
  625.         sub     eax, 2048
  626. ; directory is over?
  627.         cmp     eax, 0
  628.         ja      .read_to_buffer
  629. ; desired element of chain is not found
  630. .access_denied:
  631.         pop     esi eax
  632.         mov     [cd_appl_data], 1
  633.         stc
  634.         ret
  635. ;--------------------------------------
  636. ; desired element of chain found
  637. .found:
  638. ; the end of the file path
  639.         cmp     byte [esi-1], 0
  640.         jz      .done
  641.         mov     eax, [cd_current_pointer_of_input]
  642.         push    dword [eax+2]
  643.         pop     dword [CDSectorAddress] ; beginning of the directory
  644.         mov     eax, [eax+2+8] ; size of directory
  645.         jmp     .mainloop
  646. ;--------------------------------------
  647. ; file pointer found
  648. .done:
  649.         pop     esi eax
  650.         mov     [cd_appl_data], 1
  651.         clc
  652.         ret
  653. ;-----------------------------------------------------------------------------
  654. cd_find_name_in_buffer:
  655.         mov     [cd_current_pointer_of_input_2], CDDataBuf
  656. ;--------------------------------------
  657. .start:
  658.         call    cd_get_name
  659.         jc      .not_found
  660.  
  661.         call    cd_compare_name
  662.         jc      .start
  663. ;--------------------------------------
  664. .found:
  665.         clc
  666.         ret
  667. ;--------------------------------------
  668. .not_found:
  669.         stc
  670.         ret
  671. ;-----------------------------------------------------------------------------
  672. cd_get_name:
  673.         push    eax
  674.         mov     ebp, [cd_current_pointer_of_input_2]
  675.         mov     [cd_current_pointer_of_input], ebp
  676.         mov     eax, [ebp]
  677.         test    eax, eax ; entry's is over?
  678.         jz      .next_sector
  679.  
  680.         cmp     ebp, CDDataBuf+2048  ; buffer is over?
  681.         jae     .next_sector
  682.  
  683.         movzx   eax, byte [ebp]
  684.         add     [cd_current_pointer_of_input_2], eax ; next entry of directory
  685.         add     ebp, 33; pointer is set to the beginning of the name
  686.         pop     eax
  687.         clc
  688.         ret
  689. ;--------------------------------------
  690. .next_sector:
  691.         pop     eax
  692.         stc
  693.         ret
  694. ;-----------------------------------------------------------------------------
  695. cd_compare_name:
  696. ; in: esi -> UTF-8 name, ebp -> UTF-16BE name
  697. ; out: CF=0 -> names match, esi -> next component of name
  698. ;      CF=1 -> esi is not changed
  699.         push    edx edi eax esi
  700.         mov     edi, ebp
  701. .loop:
  702.         call    utf8to16
  703.         call    utf16toUpper
  704.         mov     edx, eax
  705.         mov     ax, [edi]
  706.         xchg    al, ah
  707.         call    utf16toUpper
  708.         cmp     ax, dx
  709.         jne     .name_not_coincide
  710.         add     edi, 2
  711.         cmp     [esi], byte '/' ; path separator is end of current element
  712.         je      .done
  713.         cmp     [esi], byte 0 ; path separator end of name
  714.         jne     .loop
  715. .done:
  716. ; check end of file
  717.         cmp     [edi], word 3B00h; separator end of file ';'
  718.         je      .done_1
  719. ; check for files not ending with separator
  720.         movzx   eax, byte [ebp-33]
  721.         add     eax, ebp
  722.         sub     eax, 34
  723.         cmp     edi, eax
  724.         je      .done_1
  725. ; check the end of directory
  726.         movzx   eax, byte [ebp-1]
  727.         add     eax, ebp
  728.         cmp     edi, eax
  729.         jne     .name_not_coincide
  730. .done_1:
  731.         pop     eax eax edi edx
  732.         inc     esi
  733.         ret
  734.  
  735. .name_not_coincide:
  736.         pop     esi eax edi edx
  737.         stc
  738.         ret
  739.