April 20th, 2010, 10:30 PM
Return and pop
In Intel assembler, there is an return instruction which pops a fixed number of parameters from the stack. Unfortunately most C compilers do not use this as the caller knows how many it added and therefore it is responsible for popping the correct number.
How about the caller specifying how many parameters it pushed in say the EFX register, and on return, it just issues a RET EFX and it pops the correct number of parameters.
It won't reduce the amount of coding significantly but it will run more efficiently.
Succinct is verbose for terse
Click Here to Expand Forum to Full Width