SkyOS Assembly Programming
Argument order for syscalls is:
ebx ecx edx esi edi
For function calls, arguments are pushed onto the stack, so that esp+4 is ebx
If more arguments are needed, put them in a structure and pass a pointer to it in the first argument. All registers are preserved across calls. Return value is put into eax.
For a list of syscalls, look at skyos/syscalls.h in the include directory. One should call interrupt 0xA0 to execute a syscall.
Here is an example program written in assembly for SkyOS. They should be compiled and linked by doing the following.
fasm file.asm file.o gcc file.o -o file.app
format ELF public main section '.text' executable align 16 main: mov edx,len ; message length mov ecx,msg ; message mov ebx,1 ; stdout mov eax,3 ; sys_write int 0xA0 ; call interrupt mov eax,5 ; sys_exit mov ebx,0 ; return value int 0xA0 ; call interrupt section '.data' writeable align 4 msg db 'Hello, World!',0xa len = $ - msg