- Joined
- Mar 4, 2011
- Messages
- 2
- Reaction score
- 0
Hi all of you,
i was reading "thinking in c++" and found difficulties while comprehend the following
i was not able to understand the following lines
1.The calling code is responsible for cleaning the argument off the stack
doubt:how does calling code clean the passed argument
2.compiler knows everything there is to know about return value type because that type is built into the language,so the compiler can return it by placing it in register
doubt:how does the compiler knowledge about the return type is related with placing return value in register
i was reading "thinking in c++" and found difficulties while comprehend the following
Code:
int f(int x, char c);
int g=f(a,b)
//then gave the corresponding generic assembly code
push b
push a
call f()
add sp,4
mov g,register a
1.The calling code is responsible for cleaning the argument off the stack
doubt:how does calling code clean the passed argument
2.compiler knows everything there is to know about return value type because that type is built into the language,so the compiler can return it by placing it in register
doubt:how does the compiler knowledge about the return type is related with placing return value in register