How's return value implemented in assembly level? -


int main(void){  printf("hello world");  return 0;  } 

how 0 passed return value in assembly level? there dedicated cpu register job?

update

here's 2 tables on passing/return data in pdf, doesn't seems have exact info on how calling convention of api determined , register used storing return address:

alt text

alt text

that depends on architecture. couple of examples, on x86 eax register used return values. on x86-64, it's rax. on sparc, it'll show in %o0.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -