mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-15 19:33:59 +03:00
16f5992719
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
33 lines
596 B
NASM
33 lines
596 B
NASM
format ELF
|
|
include "public_stdcall.inc"
|
|
section '.text' executable
|
|
extrn malloc
|
|
public_stdcall _ksys_start_thread,12
|
|
;arg1 - proc
|
|
;arg2 - stacksize
|
|
;arg3 - pid
|
|
push dword [esp+8]
|
|
call malloc
|
|
test eax,eax
|
|
jz .no_mem
|
|
push ebx
|
|
mov edx,eax
|
|
add edx,[esp+12]
|
|
mov [edx-4],dword 0
|
|
mov ecx,[esp+8]
|
|
mov ebx,1
|
|
mov eax,51
|
|
int 0x40
|
|
mov ebx,[esp+16]
|
|
test ebx,ebx
|
|
jz .no_val
|
|
mov [ebx],eax
|
|
.no_val:
|
|
mov eax,edx
|
|
sub eax,[esp+12]
|
|
pop ebx
|
|
ret 12
|
|
.no_mem:
|
|
mov ecx,[esp+12]
|
|
mov [ecx],eax
|
|
ret 12 |