Question: The x86-64 assembly given below was compiled with GCC from the C code given above. Write Y86-64 code that matches the given C and x86-64.
The x86-64 assembly given below was compiled with GCC from the C code given above.

Write Y86-64 code that matches the given C and x86-64. You should mostly be able to translate instruction by instruction, but some x86-64 instructions will need to be implemented by multiple Y86-64 instructions.
sum to_100: %rax $0, 2 mova .L3: addq mova (%rdi), %rax 8 (trdi), trdi .L2: rdi, rdi 3 testq ne cmpa ne mova ret $100, %rax 5 $1, %rax L5: $0, %rax mova ret sum to_100: %rax $0, 2 mova .L3: addq mova (%rdi), %rax 8 (trdi), trdi .L2: rdi, rdi 3 testq ne cmpa ne mova ret $100, %rax 5 $1, %rax L5: $0, %rax mova ret
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
