You don't see any output because the libc's IO package performs buffered IO and you do not flush the buffer of stdout before terminating your program. This issue is a symptom of a bigger underlying problem and that is you not initialising and deinitialising the libc correctly. In every program that uses the libc, you should:
- let the libc initialise itself on startup, letting its initialisation code be
_start and call your main function
- not perform raw system calls through the
syscall instruction, instead use the wrappers provided by the libc
- terminate the program correctly by calling
exit or returning from main
- link in all the libc code correctly by using the C compiler driver
cc to link your program instead of directly invoking the link editor
Once you are more experienced, you may diverge from these suggestions, but doing so can have subtle consequences you may not be aware of, so for now it's best to just follow these rules.