Translate the following code to x86. Assume standard conventions for passing par
ID: 3787617 • Letter: T
Question
Translate the following code to x86. Assume standard conventions for passing parameters and return values using registers. int minus Two (int n) {n = n - 2: return n;} Translate the following code to x86. Assume standard conventions for passing parameters and return values using registers. Use %rcx for n, and %rbx for m. n = 1 2; m = minusTwo (n); n = n + m; Assume your previous code from questions 5 and 6 both use the same register %rbx, to hold different values. Write code for minusTwo that demonstrates proper "filling" and "spilling" of %rbx to the stack.Explanation / Answer
6)
main:
mov %rcx,#0CH
push %rcx
mov %rbx,[esp+4]
mov %rax,%rcx
add %rax,%rbx
mov %rcx,%rax
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.