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.

The x86-64 assembly given below was compiled with GCC from the C

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

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 Databases Questions!