libk  Diff

Differences From Artifact [7c5909e17f]:

To Artifact [fed93e863f]:


            1  +;; abi definition file for x86 linux 32-bit
     1      2   ; vim: ft=nasm
     2         -%define sys.exit 1
     3         -%define sys.fork 2
     4         -%define sys.read 3
     5         -%define sys.write 4
     6         -%define sys.open 5
     7         -%define sys.close 6
     8         -%define sys.chdir 12
            3  +
            4  +; syscall32 numbers - syscall table must be created first!
            5  +%include "calls.x86.lin.32.s"
     9      6   
            7  +; syscall32 registers
    10      8   %define sys.reg.n 6
    11      9   %define sys.reg.0 eax
    12     10   %define sys.reg.1 ebx
    13     11   %define sys.reg.2 ecx
    14     12   %define sys.reg.3 edx
    15     13   %define sys.reg.4 esi
    16     14   %define sys.reg.5 edi
           15  +
           16  +%macro sys 1-6
           17  +	%assign i 0
           18  +	%rep %0
           19  +		mov sys.reg. %+ i, %1 ; i'm actually shocked this worked
           20  +		%rotate 1
           21  +		%assign i i+1
           22  +	%endrep 
           23  +	syscall
           24  +%endmacro
    17     25   
    18     26   %define sys.call int 0x80 ; sysenter is allegedly the
    19     27     ; politically correct option but it does not actually
    20     28     ; appear to work without a whole lot of extra bullshit
    21     29   
    22     30   ; todo: learn vdsos