kolibrios-gitea/kernel/trunk/lib/proc.inc
SPraid (simba) e1f463adf0 loading libs for kernel
loading from HD
inifiles.asm (not completed, using with kernel to load sys.conf)
parse file names
%sys% may be system directory for programs (70 function)

git-svn-id: svn://kolibrios.org@488 a494cfbc-eb01-0410-851d-a64ba20cac60
2007-05-11 19:38:23 +00:00

100 lines
1.4 KiB
PHP

macro export [name,sname]
{
forward
dd __#name#_export_name__,name
common
dd 0
forward
align 4
__#name#_export_name__ db sname,0
}
copy_s:
; eax - ªã¤ 
; ebx - ®âªã¤ 
; cl - ¤® 祣®
; ¢ë室 - eax - ᪮«ìª® ᪮¯¨à®¢ ­®
pushad
push eax
@@:
mov ch,[ebx]
cmp ch,cl
je @f
mov [eax],ch
inc ebx
inc eax
jmp @b
@@:
mov [eax], byte 0
pop ebx
sub eax,ebx
mov [esp+0x1c],eax
popad
ret
strcmp:
; esi - áâப  1
; edi - áâப  2
; ¢ë室 - eax=-1 - ­¥à ¢­®
xor eax,eax
pushad
@@: lodsb
scasb
jne .fail
or al,al
jnz @b
jmp .ok
.fail: or eax,-1
mov [esp+0x1c],eax
.ok: popad
ret
proc get_filesize stdcall, file_name:dword
locals
cmd dd ?
offset dd ?
dd ?
count dd ?
buff dd ?
db ?
name dd ?
info dd ?
flags dd ?
cr_time dd ?
cr_date dd ?
acc_time dd ?
acc_date dd ?
mod_time dd ?
mod_date dd ?
file_size dd ?
file dd ?
file2 dd ?
endl
xor eax, eax
mov ebx, [file_name]
mov ecx,info-ebp
add ecx,ebp
mov [cmd], 5
mov [offset], eax
mov [offset+4], eax
mov [count], eax
mov [buff], ecx
mov byte [buff+4], al
mov [name], ebx
mov eax, 70
lea ebx, [cmd]
int 0x40
mov eax,[file_size]
ret
endp