Hello,
I am learning ia-32 assembly. I have observed that when creating an object file using gcc from the simple c program:
main () {
char buf[256];
write(1, buf, 256);
}
it generates the following instruction for the write: (using the data on top of the stack for the args)
call write
I get similar results for read() as well. What I am wondering is, is this a system call for write, where the linker replaces the "write" instruction for syscall with the appropriate syscall number, or is this something that is linked to the c library?
Essentially what I would like to know is how do I find out what exactly the program is doing. If it is linking to the c library, how do I find out what the code looks like that it is linking to? If it is just a syscall, how does it determine the appropriate syscall number for the kernel?
Thanks,
Allasso