diff options
| author | Miguel <m.i@gmx.at> | 2018-09-02 00:08:42 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-02 00:08:42 +0200 |
| commit | 8e3411139b27a3421e9ac75c13f14f99f6dd3137 (patch) | |
| tree | cf8b53ab02863117c310bde11ee4683e134cf1b2 /newlib/syscall.s | |
| parent | 0fff2e6dc6fae82da1c7978918a490c25cc36f04 (diff) | |
syscalls
Diffstat (limited to 'newlib/syscall.s')
| -rw-r--r-- | newlib/syscall.s | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/syscall.s b/newlib/syscall.s new file mode 100644 index 0000000..abce63a --- /dev/null +++ b/newlib/syscall.s @@ -0,0 +1,16 @@ +.global syscall + +syscall: + + push %ebx // preserve (sysV abi convnetion) + + mov 0x8(%esp),%eax //syscall number + mov 0xC(%esp),%edx //p1 + mov 0x10(%esp),%ecx //p2 + mov 0x14(%esp),%ebx //p3 + + int $0x80 + mov %ebx, %eax // set as return value + + pop %ebx // preserve + ret |
