I tried experimenting to see if the argument is passed to a register, and also in the previous stack frame but I haven't had any luck yet. Will this be more complex than I think it is?
Code: Select all
#PURPOSE: Simple program that exits and returns a value to the kernel
#VARIABLES:
# %eax holds the system call number
# %ebx holds the return status
#
.section .data
.section .text
.globl _start
_start:
movl 8(%esp), %ebx #copy data from above stack frame into %ebx
movl $1, %eax #prepare kernel exit call
int $0x80 #exit
I'm just experimenting and having fun, so if I'm doing anything silly, keep that in mind