Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A function is declared as follows: void foo(long a, long b, long c, int n); Its body compiles to the following code: # a
A function is declared as follows: void foo(long a, long b, long c, int n); Its body compiles to the following code: # a in %rdi, b in %rsi, c in %rdx, n in %ecx movl $0, %eax .12: .LA: capl %ecx, %eax jge .LA movalq %eax, %r8 mov (%rdx,%r8,8), %r9 addq (%rai,%r8,8), %19 movq Zr9, (Zrdi, %r8,8) addl $1, %eax jmp .L2 ret The C code for the body a loop of the form: int i; for (i=0; a. What register holds the loop variable i? b. What is i compared to in the loop test? e. What do the first three arguments point to? d. What do the three instructions in the middle of the loop (novq, addq. movq) do? e. Say in words what is the purpose of the function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started