KFM - fixed the display of files larger than 4GB.

git-svn-id: svn://kolibrios.org@9691 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov 2022-02-06 20:05:54 +00:00
parent 8f544cdd1d
commit 5f02a78eaf
4 changed files with 79 additions and 33 deletions

View File

@ -1,4 +1,5 @@
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm -m 16384 kfm.asm kfm @fasm -m 16384 kfm.asm kfm
@kpack kfm
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -399,57 +399,103 @@ draw_type_size_date:
mov [size_table+4],word '- ' mov [size_table+4],word '- '
jmp .date jmp .date
;-------------------------------------- ;--------------------------------------
.qword_div:
mov eax,[edx-40+32]
mov ebx,[edx-40+32+4]
@@: ; /1024
shrd eax,ebx,5 ; /32
shr ebx,5 ; /32
shrd eax,ebx,5 ; /32
shr ebx,5 ; /32
dec ecx
jnz @b
; /(1024*1024)
shr eax,20
test eax,eax
ret
;--------------------------------------
.copy_size: .copy_size:
;/0x40000000 - Gb ;/0x1000000000000000 - EB
;/0x100000 - Mb ;/0x4000000000000 - PB
;/0x400 Kb ;/0x10000000000 - TB
;/0x40000000 - GB
;/0x100000 - MB
;/0x400 - KB
mov [size_table],dword ' ' mov [size_table],dword ' '
mov [size_table+4],word ' ' mov [size_table+4],word ' '
push ebx push ebx edx
push edx push ecx
mov eax,[edx-40+32] mov ecx,4
mov ebx,0x40000000 call .qword_div
xor edx,edx pop ecx
div ebx jz @f
cmp eax,0
je @f
mov ebx,size_table mov ebx,size_table
call decimal_string_4 call decimal_string_4
mov [ebx],byte 'G' mov [ebx],byte 'E' ; Exa Byte
jmp .size_convert_end jmp .size_convert_end
;-------------------------------------- ;--------------------------------------
@@: @@:
mov edx,[esp] push ecx
mov eax,[edx-40+32] mov ecx,3
mov ebx,0x100000 call .qword_div
xor edx,edx pop ecx
div ebx jz @f
cmp eax,0
je @f
mov ebx,size_table mov ebx,size_table
call decimal_string_4 call decimal_string_4
mov [ebx],byte 'M' mov [ebx],byte 'P' ; Peta Byte
jmp .size_convert_end jmp .size_convert_end
;-------------------------------------- ;--------------------------------------
@@: @@:
mov edx,[esp] push ecx
mov eax,[edx-40+32] mov ecx,2
mov ebx,0x400 call .qword_div
xor edx,edx pop ecx
div ebx jz @f
cmp eax,0
je @f
mov ebx,size_table mov ebx,size_table
call decimal_string_4 call decimal_string_4
mov [ebx],byte 'K' mov [ebx],byte 'T' ; Tera Byte
jmp .size_convert_end
;--------------------------------------
@@:
push ecx
mov ecx,1
call .qword_div
pop ecx
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'G' ; Giga Byte
jmp .size_convert_end jmp .size_convert_end
;-------------------------------------- ;--------------------------------------
@@: @@:
mov edx,[esp]
mov eax,[edx-40+32] mov eax,[edx-40+32]
mov ebx,eax
shr eax,20 ; /(1024*1024)
test eax,eax
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'M' ; Mega Byte
jmp .size_convert_end
;--------------------------------------
@@:
mov eax,ebx
shr eax,10 ; /1024
test eax,eax
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'K' ; Kilo Byte
jmp .size_convert_end
;--------------------------------------
@@:
mov eax,ebx
;.size_convert: ;.size_convert:
mov ebx,size_table mov ebx,size_table
call decimal_string_4 call decimal_string_4
@ -473,8 +519,7 @@ draw_type_size_date:
jmp @r jmp @r
;-------------------------------------- ;--------------------------------------
@@: @@:
pop edx pop edx ebx
pop ebx
;-------------------------------------- ;--------------------------------------
.date: .date:
xor eax,eax xor eax,eax

View File

@ -60,7 +60,7 @@ draw_files_information_window:
@@: @@:
; show file or directory size ; show file or directory size
add edx,INF_LINEH add edx,INF_LINEH
mcall 47,0x80140001,files_size mcall 47,0xc0140001,files_size
;-------------------------------------- ;--------------------------------------
mov ebp,date.create mov ebp,date.create
call show_date_and_time_of_files_information call show_date_and_time_of_files_information

View File

@ -391,8 +391,8 @@ include 'file_inf.inc'
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
include 'text.inc' include 'text.inc'
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
I_END:
;include_debug_strings ;include_debug_strings
I_END:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
include 'data.inc' include 'data.inc'
;--------------------------------------------------------------------- ;---------------------------------------------------------------------