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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -