Question: The function many_params takes an unknown number of int parameters. The C and assembly forms of the function are given below, except we do not
The function many_params takes an unknown number of int parameters. The C and assembly forms of the function are given below, except we do not know the full signature. int many_params(int param1, (additional int params), int last_param){ return param1 last_param; } many_params: movl %edi, %eax addl 24(%rsp), %eax ret How many parameters does many_params take? Hint: remember that a call instruction modifies the stack pointer, and the ABI must account for this on the callee side. Hint2: arguments that go on the stack are always placed into 8-byte intervals, regardless of their type. For example, the second argument on the stack would be placed 8 bytes away from the first, even for int types
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
