Subversion Repositories Kolibri OS

Rev

Rev 75 | Rev 78 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 75 Rev 77
Line 925... Line 925...
925
;  ebx  pointer to 64-bit number = first wanted byte, 0+
925
;  ebx  pointer to 64-bit number = first wanted byte, 0+
926
;       may be ebx=0 - start from first byte
926
;       may be ebx=0 - start from first byte
927
;  ecx  number of bytes to read, 0+
927
;  ecx  number of bytes to read, 0+
928
;  edx  mem location to return data
928
;  edx  mem location to return data
929
;
929
;
930
;  ret ebx = size or 0xffffffff file not found
930
;  ret ebx = bytes read or 0xffffffff file not found
931
;      eax = 0 ok read or other = errormsg
931
;      eax = 0 ok read or other = errormsg
932
;
932
;
933
;--------------------------------------------------------------
933
;--------------------------------------------------------------
934
fs_RamdiskRead:
934
fs_RamdiskRead:
935
        cmp     byte [esi], 0
935
        cmp     byte [esi], 0
Line 948... Line 948...
948
.found:
948
.found:
949
        test    ebx, ebx
949
        test    ebx, ebx
950
        jz      .l1
950
        jz      .l1
951
        cmp     dword [ebx+4], 0
951
        cmp     dword [ebx+4], 0
952
        jz      @f
952
        jz      @f
953
        mov     ebx, [edi+28]
953
        xor     ebx, ebx
954
.reteof:
954
.reteof:
955
        mov     eax, 6          ; EOF
955
        mov     eax, 6          ; EOF
956
        pop     edi
956
        pop     edi
957
        ret
957
        ret
958
@@:
958
@@:
959
        mov     ebx, [ebx]
959
        mov     ebx, [ebx]
960
.l1:
960
.l1:
961
        push    dword [edi+28]		; file size
-
 
962
        push    dword [edi+28]
-
 
963
        movzx   edi, word [edi+26]	; cluster
-
 
964
        push    ecx edx
961
        push    ecx edx
-
 
962
        push    0
-
 
963
        mov     eax, [edi+28]
-
 
964
        sub     eax, ebx
-
 
965
        jb      .eof
-
 
966
        cmp     eax, ecx
-
 
967
        jae     @f
-
 
968
        mov     ecx, eax
-
 
969
        mov     byte [esp], 6           ; EOF
-
 
970
@@:
-
 
971
        movzx   edi, word [edi+26]	; cluster
965
.new:
972
.new:
966
        jecxz   .done
973
        jecxz   .done
967
        test    edi, edi
974
        test    edi, edi
968
        jz      .eof
975
        jz      .eof
969
        cmp     edi, 0xFF8
976
        cmp     edi, 0xFF8
Line 979... Line 986...
979
        push    ecx
986
        push    ecx
980
        cmp     ecx, ebx
987
        cmp     ecx, ebx
981
        jbe     @f
988
        jbe     @f
982
        mov     ecx, ebx
989
        mov     ecx, ebx
983
@@:
990
@@:
984
        cmp     ecx, [esp+12]
-
 
985
        jbe     @f
-
 
986
        mov     ecx, [esp+12]
-
 
987
@@:
-
 
988
        mov     ebx, edx
991
        mov     ebx, edx
989
        call    memmove
992
        call    memmove
990
        add     edx, ecx
993
        add     edx, ecx
991
        sub     [esp], ecx
994
        sub     [esp], ecx
992
        sub     [esp+12], ecx
-
 
993
        pop     ecx
995
        pop     ecx
994
        xor     ebx, ebx
996
        xor     ebx, ebx
995
        cmp     [esp+8], ebx
-
 
996
        jnz     .skip
-
 
997
        jecxz   .done
-
 
998
        jmp     .eof
-
 
999
.skip:
997
.skip:
1000
        movzx   edi, word [edi*2+0x280000]      ; find next cluster from FAT
998
        movzx   edi, word [edi*2+0x280000]      ; find next cluster from FAT
1001
        jmp     .new
999
        jmp     .new
1002
.eof:
1000
.eof:
-
 
1001
        mov     ebx, edx
1003
        pop     edx ecx ebx ebx
1002
        pop     eax edx ecx
-
 
1003
        sub     ebx, edx
1004
        jmp     .reteof
1004
        jmp     .reteof
1005
.done:
1005
.done:
-
 
1006
        mov     ebx, edx
1006
        pop     edx ecx ebx ebx edi
1007
        pop     eax edx ecx edi
1007
        xor     eax, eax
1008
        sub     ebx, edx
1008
        ret
1009
        ret
Line 1009... Line 1010...
1009
 
1010
 
1010
;----------------------------------------------------------------
1011
;----------------------------------------------------------------
1011
;
1012
;
Line 1063... Line 1064...
1063
        add     edi, 0x20
1064
        add     edi, 0x20
1064
        cmp     edi, 0x100000+512*33
1065
        cmp     edi, 0x100000+512*33
1065
        jb      .l1
1066
        jb      .l1
1066
        add     esp, 262*2+4
1067
        add     esp, 262*2+4
1067
        pop     ebp
1068
        pop     ebp
1068
        mov     ebx, [edx+8]
1069
        mov     ebx, [edx+4]
1069
        xor     eax, eax
1070
        xor     eax, eax
1070
        dec     ecx
1071
        dec     ecx
1071
        js      @f
1072
        js      @f
1072
        mov     al, ERROR_END_OF_FILE
1073
        mov     al, ERROR_END_OF_FILE
1073
@@:
1074
@@: