Question: 6. You know the following assembly code snippet is from a for loop in C. Determine the for loop behavior by determining a-what does the

 6. You know the following assembly code snippet is from a

6. You know the following assembly code snippet is from a for loop in C. Determine the for loop behavior by determining a-what does the loop counter get initialized to? b-what is the conditional end check of the loop? c-how is the loop counter modified? d-what happens in the body of the loop? Recall the ig instruction jumps if the result is greater than O. Assume there is a variable called data stored at-24(%rbp) that is initialized to a value before the code snippet. (20 points, 5 points each for a-d described above) mod $0,-32(%rbp) movi $32,-28(%rbp) jmp L2 movq mov movq mov -24(%rbp), %rdx -28(%rbp), %eax %rdx, %rbx %eax, %ecx movq %rbx,%rax movl %eax, %edx andl $1, %edx movl -32(%rbp), %eax addl %edx, %eax mov %eax,-32(%rbp) addl $1,-28(%rbp) cmpl $47,-28(%rbp) jle L3 more assembly would be here

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!