kolibrios-fun/programs/develop/ktcc/trunk/libc/kolibrisys/cofflib.asm
andrew_programmer 16f5992719 Mistakes in functions of work with files and with system calls KolibriOS are corrected.
New functions for work with system calls KolibriOS are added. Functions for format output 
are added: printf (), fprintf (), sprintf (), snprintf (), vsnprintf (). For material 
numbers it is meanwhile supported only format output the (%f), and exponential output a (%e)
is not realized yet. 
Functions for format output correctly work only in GCC because TinyC incorrectly works with
the functions containing variable number of arguments.

git-svn-id: svn://kolibrios.org@647 a494cfbc-eb01-0410-851d-a64ba20cac60
2007-10-15 09:42:17 +00:00

74 lines
1.3 KiB
NASM

format ELF
include 'proc32.inc'
section '.text' executable
public _ksys_cofflib_load
public _ksys_cofflib_getproc
proc _ksys_cofflib_load stdcall, name:dword
mov eax, 68
mov ebx, 19
mov ecx, [name]
int 0x40
ret
endp
proc _ksys_cofflib_getproc stdcall, export:dword,name:dword
mov ebx,[export]
next_name_check:
mov ecx,[ebx]
test ecx,ecx
jz end_export
;cmp export string with name
mov esi,[name]
xor edi,edi
next_simbol_check:
xor eax,eax
mov al,[ecx]
test al,al
jz exit_check_simbol
xor edx,edx
mov dl,[esi]
cmp al,dl
je simbols_equvalent
add edi,1
jmp exit_check_simbol
simbols_equvalent:
;pushad
;mov cl,al
;mov ebx,1
;mov eax,63
;int 0x40
;popad
add ecx,1
add esi,1
jmp next_simbol_check
exit_check_simbol:
test edi,edi
jnz function_not_finded
mov eax,[ebx+4]
jmp end_export
function_not_finded:
add ebx,8
jmp next_name_check
end_export:
ret
endp