Question: Write C code given the following assembly code: movl $1, %edx # line #1 xorl %eax, %eax # line #2 movzbl %sil, %ecx # line

Write C code given the following assembly code:

movl $1, %edx # line #1

xorl %eax, %eax # line #2

movzbl %sil, %ecx # line #3

.L3: movq %rdx, %rsi # line #4

salq %cl, %rdx # line #5

andq %rdi, %rsi # line #6

xorq %rsi, %rax # line #7

testq %rdx, %rdx # line #8

jne .L3 # line #9

ret # line #10

long loop(long z, int num) { long accum = __________; long loopvar; for (loopvar = __________; loopvar __________ ; loopvar = __________) { accum ^= __________; } return accum; }

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!