libk  Diff

Differences From Artifact [7c5909e17f]:

To Artifact [fed93e863f]:



1
2
3

4
5
6
7
8
9

10
11
12
13
14
15
16










17
18
19
20
21
22

; vim: ft=nasm
%define sys.exit 1
%define sys.fork 2

%define sys.read 3
%define sys.write 4
%define sys.open 5
%define sys.close 6
%define sys.chdir 12


%define sys.reg.n 6
%define sys.reg.0 eax
%define sys.reg.1 ebx
%define sys.reg.2 ecx
%define sys.reg.3 edx
%define sys.reg.4 esi
%define sys.reg.5 edi











%define sys.call int 0x80 ; sysenter is allegedly the
  ; politically correct option but it does not actually
  ; appear to work without a whole lot of extra bullshit

; todo: learn vdsos
>

<
<
>
|
|
<
<
<

>







>
>
>
>
>
>
>
>
>
>






1
2


3
4
5



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;; abi definition file for x86 linux 32-bit
; vim: ft=nasm



; syscall32 numbers - syscall table must be created first!
%include "calls.x86.lin.32.s"




; syscall32 registers
%define sys.reg.n 6
%define sys.reg.0 eax
%define sys.reg.1 ebx
%define sys.reg.2 ecx
%define sys.reg.3 edx
%define sys.reg.4 esi
%define sys.reg.5 edi

%macro sys 1-6
	%assign i 0
	%rep %0
		mov sys.reg. %+ i, %1 ; i'm actually shocked this worked
		%rotate 1
		%assign i i+1
	%endrep 
	syscall
%endmacro

%define sys.call int 0x80 ; sysenter is allegedly the
  ; politically correct option but it does not actually
  ; appear to work without a whole lot of extra bullshit

; todo: learn vdsos