Consider the following function where X, Y, Z, and W represent incomplete code.
ID: 3863404 • Letter: C
Question
Consider the following function where X, Y, Z, and W represent incomplete code. int math int a, int b, int c) int res1 X; int res2 Y; int res Z; int res 4 W; return res4 The function above is implemented in assembly code below where the function's parameters a, b and c are at the effective addresses 0x8 ($ebp), 0xc ($ebp) and 0x10 ($ebp), respectively. mov 0xc (%ebp),%eax not %eax mov %eax, -0x10 (%ebp) mov 0x10(%ebp) ,%eax mov 0x8 %ebp),%edx add %edx,%eax mov %eax, 0xc (%ebp) mov 0x10(%ebp),%eax imul $0x17,%eax, %eax mov %eax, 0x8 (%ebp) mov 0x10(%ebp),%eax sar $0x5,%eax mov %eax, 0x4 (%ebp) Choose the correct options for X, Y, Z and W to complete the function so that it corresponds with its assembly code.Explanation / Answer
Your answers are correct as shown the assembly interactions are true
X is ~b
Y is a+res1
Z is c*23
W is c>>5
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.