📄 systree.asm
字号:
nodotadd:
and [scrollsize],dword 0xfff
mov esi , 0x80000
mov ebp , 0
newtest:
cmp [esi],byte 0
je remove_entry
mov al , [esi+11]
and al , 0xf
cmp al , 0xf
je remove_entry
jmp entry_fine
remove_entry:
push esi
mov edi , esi
add esi , 32
mov ecx , [scrollsize]
add ecx , 16
sub ecx , ebp
imul ecx , 32
cld
rep movsb
pop esi
dec dword [scrollsize]
sub esi , 32
entry_fine:
add esi , 32
inc ebp
mov ecx , [scrollsize]
cmp ebp , ecx
jbe newtest
; Search first DEL
mov esi , 0x80000
mov ebp , 0
newtest2:
cmp [esi],byte 0
je found_del
add esi , 32
inc ebp
mov ecx , [scrollsize]
cmp ebp , ecx
jbe newtest2
found_del:
mov [scrollsize],ebp
; Alphabetical order
mov ebp , 0
alpl3:
mov esi , [scrollsize]
dec esi
imul esi , 32
add esi , 0x80000
mov edi , alphatemp
mov ecx , 32
cld
rep movsb
mov ecx , 0
alpl2:
cmp ecx , ebp
jae alpl1
mov esi , ecx
shl esi , 5
mov edi , 0
asdfa:
mov al , [alphatemp + edi]
cmp al , [0x80000 + esi + edi]
jb alpl1
; cmp al , [0x80000 + esi + edi]
jne asdf
inc edi
cmp edi , 11
jb asdfa
asdf:
inc ecx
jmp alpl2
alpl1:
mov esi , ecx
shl esi , 5
add esi , 0x80000
push esi
mov edi , esi
add edi , 32
mov eax , [scrollsize]
dec eax
shl eax , 5
add eax , 0x80000
sub eax , esi
add esi , eax
add edi , eax
mov ecx , eax
add ecx , 32
std
rep movsb
mov esi , alphatemp
pop edi
mov ecx , 32
cld
rep movsb
inc ebp
cmp ebp , [scrollsize]
jbe alpl3
mov edi , [scrollsize]
imul edi , 32
add edi , 0x80000
mov eax , 0
mov ecx , 32
cld
rep stosb
mov [scrollv],dword 1000
call draw_scroll
ret
alphatemp: times 32 db 0
getblock:
pusha
mov esi , eax
dec esi
imul esi , 32
add esi , 0x80000
mov edi , 0x20000
mov ecx , 32*22
cld
rep movsb
popa
ret
read_directory:
mov eax,[readblock]
call getblock
mov [dirlen],ebx
mov esi,0x20000
mov edi,data_area+1024
mov ecx,512+300
cld
rep movsb
mov ebx,1024
; command succesful
mov esi,data_area+1024
mov edi,fileinfo+11
mov edx,16+5
newlineb:
pusha ; clear
mov al,32
mov ecx,58
sub edi,11
cld
rep stosb
popa
mov cl,[esi] ; end of entries ?
cmp cl,6
jnz noib0
mov [edi-5],dword 'EOE '
add esi,32
add edi,62
jmp inf
noib0:
mov cl,[esi+0]
cmp cl,0xe5
je yesdelfil
mov cl,[esi+11] ; long fat32 name ?
cmp cl,0xf
jnz noib1
mov [edi-5],dword 'F32 '
add esi,32
add edi,62
jmp inf
noib1:
mov eax,'DAT ' ; data or .. ?
mov cl,[esi+0] ; deleted file
cmp cl,0xe5
je yesdelfil
cmp cl,0x0
je yesdelfil
jmp nodelfil
yesdelfil:
mov eax,'DEL '
add esi , 32
add edi , 62
jmp inf
jmp ffile
nodelfil:
mov cl,[esi+11] ; folder
and cl,0x10
jz ffile
mov eax,'FOL '
mov [edi-5],eax
; mov [edi+45],byte '-'
; jmp nosize
ffile:
mov [edi-5],eax
pusha ; size
mov eax,[esi+28]
mov esi,edi
add esi,37+2 - 12 + 6
mov ebx,10
mov ecx,12
newnum:
xor edx,edx
div ebx
add dl,48
mov [esi],dl
cmp eax,0
jz zernum
sub esi,1
loop newnum
zernum:
popa
nosize:
pusha ; attributes
mov eax,[esi+11]
mov esi,edi
add esi,37+2 - 18
mov ebx,2
mov ecx,8
newnum2:
xor edx,edx
div ebx
add dl,48
mov [esi],dl
sub esi,1
loop newnum2
popa
pusha ; date
add edi , 15+ 6
mov [edi+17],dword '. .'
mov [edi+21],dword '2002'
mov eax,[esi+24]
and eax,1111111000000000b
shr eax,9
add eax,1980
xor edx,edx
mov ebx,10
div ebx
add dl,48
mov [edi+24],dl
xor edx,edx
div ebx
add dl,48
mov [edi+23],dl
xor edx,edx
div ebx
add al , 48
add dl , 48
mov [edi+22],dl
mov [edi+21],al
mov eax,[esi+24]
and eax,11111b
xor edx,edx
mov ebx,10
div ebx
add al,48
add dl,48
mov [edi+15],al
mov [edi+16],dl
mov eax , [esi+24]
and eax , 0000000111100000b
shr eax , 5
xor edx,edx
mov ebx,10
div ebx
add al,48
add dl,48
mov [edi+18],al ; month
mov [edi+19],dl
popa
pusha ; number
mov ecx,17+5
sub ecx,edx
mov eax,[readblock]
sub eax,1
add eax,ecx
xor edx,edx
mov ebx,10
div ebx
add dl,48
mov [edi-8],dl ;0001
xor edx,edx
div ebx
add dl,48
mov [edi-9],dl ;0010
xor edx,edx
div ebx
add al,48
add dl,48
mov [edi-10],dl ;0100
mov [edi-11],al ;1000
popa
mov ecx,8 ; first 8
cld
rep movsb
mov [edi],byte '.'
add edi,1
mov ecx,3 ; last 3
cld
rep movsb
add esi,(32-11)
add edi,(60-12+2)
inf:
sub edx,1
cmp edx,0
jnz newlineb
ret
hd_read_error:
cmp eax,1
jnz la1
mov edx,nodef
mov esi,50
la1:
cmp eax,2
jnz la2
mov esi,nosup
mov edi,data_area+8
mov ecx,50
cld
rep movsb
mov edx,data_area
mov esi,8+50
la2:
cmp eax,3
jnz la3
mov esi,unknw
mov edi,data_area+8
mov ecx,50
cld
rep movsb
mov edx,data_area
mov esi,8+50
la3:
cmp eax,4
jnz la4
mov edx,xpart
mov esi,50
la4:
cmp eax,5
jnz la5
mov edx,eof
mov esi,50
dec dword [readblock]
add [loclen],dword 12
la5:
cmp eax,6
jnz la6
mov edx,fnf
mov esi,50
la6:
mov eax,4
mov ebx,70*65536+(diry+dirys+5)
mov ecx,0x00000000
int 0x40
sub [loclen],dword 12
jmp read_directory
; DATA AREA
dirlen dd 0x1
b_color dd 0x6677cc
editor db 'TINYPAD '
param db ' ',0
text db '/ '
up db 0x18
down db 0x19
xx db 'x'
loclen dd 0
readblock dd 1
window_label:
db 'FILE BROWSER',0
root db 'ROOTDIR '
location:
db '/ / / / '
db '/ / / / '
db '/ / / / '
db '/ / / / '
db '/ / / / '
db '/ / / / '
db '/ / / / '
db '/ / / / '
fileinfo:
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
db ' 00 . 10.20 01.01.00 '
nodef db 'NO HD BASE AND/OR FAT32 PARTITION DEFINED. '
xpart db 'INVALID PARTITION AND/OR HD BASE '
nosup db '<- FS, NO SUPPORT YET '
unknw db '<- UNKNOWN FS '
eof db 'END OF FILE '
fnf db 'FILE NOT FOUND '
menu_struct:
dq 0
dq 500
db 0,'FILE',0
db 1,'Open ..',0
db 1,'-',0
db 1,'Quit',0
db 255
data_area:
I_END:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -