Question: Most functions operate on values passed to them as parameters, also called arguments. Many functions also return a value. Consider this function: long sum 3

Most functions operate on values passed to them as parameters, also called arguments. Many functions also return a value. Consider this function:
long sum3(long a, long b, long c)
{
return a + b + c;
}
sum() takes three long parameters and returns the sum of them as its value. The x86-64 passes the first six integral and pointer arguments in registers as follows:
Argument Number Register
1%rdi
2%rsi
3%rdx
4%rcx
5%r8
6%r9
Its rare for a function to have more than three or four arguments, but if there are more than six arguments, the remainder are pushed on the stack.
sum3() is called as follows:
s = sum3(14,87,122);
What register will hold each of the input values on entry?
Drag the correct label (value or register) to complete each sentence. Not all labels will be used

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!