I have a Linux x86-32 GAS assembly program terminating like this:
movl $1, %eax
movl $0, %ebx # argument for _exit
int $0x80
When I exit li
Output sent to standard out is usually buffered. If you call fflush(stdout)
before you call _exit
you should get your output.
The reason exit
works is because that function is guaranteed to close and flush any open streams (such as stdout) before calling _exit
itself to actually terminate the program.