mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-01 04:57:03 +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
119 lines
2.0 KiB
NASM
119 lines
2.0 KiB
NASM
format ELF
|
|
include "public_stdcall.inc"
|
|
section '.text' executable
|
|
public_stdcall _ksys_get_irq_owner,4
|
|
;arg1 - irq
|
|
mov edx,ebx
|
|
mov eax,41
|
|
mov ebx,[esp+4]
|
|
int 0x40
|
|
mov ebx,edx
|
|
ret 4
|
|
|
|
public_stdcall _ksys_get_data_read_by_irq,12
|
|
;arg1 - irq
|
|
;arg2 - *size
|
|
;arg3 - data
|
|
mov edx,ebx
|
|
mov eax,42
|
|
mov ebx,[esp+4]
|
|
int 0x40
|
|
cmp ecx,2
|
|
jz .not_an_owner
|
|
push ecx
|
|
mov ecx,[esp+16]
|
|
test ecx,ecx
|
|
jz .ignore_data
|
|
mov [ecx],bl
|
|
.ignore_data:
|
|
mov ecx,[esp+12]
|
|
mov [ecx],eax
|
|
pop eax
|
|
mov ebx,edx
|
|
ret 12
|
|
.not_an_owner:
|
|
mov eax,2
|
|
mov ebx,edx
|
|
ret
|
|
|
|
public_stdcall _ksys_send_data_to_device,8
|
|
;arg1 - port
|
|
;arg2 - data
|
|
mov edx,ebx
|
|
mov eax,63
|
|
mov ebx,[esp+8]
|
|
mov ecx,[esp+4]
|
|
int 0x40
|
|
mov ebx,edx
|
|
ret 8
|
|
|
|
public_stdcall _ksys_receive_data_from_device,8
|
|
;arg1 - port
|
|
;arg2 - data
|
|
mov edx,ebx
|
|
mov eax,43
|
|
mov ecx,[esp+4]
|
|
add ecx,0x80000000
|
|
int 0x40
|
|
mov ecx,[esp+8]
|
|
mov [ecx],bl
|
|
mov ebx,edx
|
|
ret 8
|
|
|
|
public_stdcall _ksys_program_irq,8
|
|
;arg1 - intrtable
|
|
;arg2 - irq
|
|
mov edx,ebx
|
|
mov eax,44
|
|
mov ebx,[esp+4]
|
|
mov ecx,[esp+8]
|
|
int 0x40
|
|
mov ebx,edx
|
|
ret 8
|
|
|
|
public_stdcall _ksys_reserve_irq,4
|
|
;arg1 - irq
|
|
mov edx,ebx
|
|
mov eax,45
|
|
xor ebx,ebx
|
|
mov ecx,[esp+4]
|
|
int 0x40
|
|
mov ebx,edx
|
|
ret 4
|
|
|
|
public_stdcall _ksys_free_irq,4
|
|
;arg1 - irq
|
|
mov edx,ebx
|
|
mov eax,45
|
|
xor ebx,ebx
|
|
inc ebx
|
|
mov ecx,[esp+4]
|
|
int 0x40
|
|
mov ebx,edx
|
|
ret 4
|
|
|
|
public_stdcall _ksys_reserve_port_area,8
|
|
;arg1 - start
|
|
;arg2 - end
|
|
push ebx
|
|
mov eax,46
|
|
xor ebx,ebx
|
|
mov ecx,[esp+8]
|
|
mov edx,[esp+12]
|
|
int 0x40
|
|
pop ebx
|
|
ret 8
|
|
|
|
public_stdcall _ksys_free_port_area,8
|
|
;arg1 - start
|
|
;arg2 - end
|
|
push ebx
|
|
mov eax,46
|
|
xor ebx,ebx
|
|
inc ebx
|
|
mov ecx,[esp+8]
|
|
mov edx,[esp+12]
|
|
int 0x40
|
|
pop ebx
|
|
ret 8
|
|
|