Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the following assembly code compiled with gcc -O1 -S, given the pseudocode and the ASM output, fill in the blanks for the following C

For the following assembly code compiled with gcc -O1 -S, given the pseudocode and the ASM output, fill in the blanks for the following C function.

The first blank is obviously a 7 and the loop counter is i

image text in transcribed

image text in transcribed

main: movl $0, %eax movabsq $-2679396940471402103, %rsi movl $7,%r10d movl $255, %rSd L2: leal 0(%rdx,8), %rBd movi %r10d, %edi subl %edx, %edi sall $3, %edi movq %r9, %rax movl %edi, %ecx salq %edi, %rax notq %rax andq %rsi, %rax movq %r9, %r11 movl %rBd. %ecx sall $3, %ecx salq %ecx, % 11 andq %r11,%rsi sarq%ecx, %rsi andq %r11,%rsi movl %edi, %ecx salq %edi, %rsi orq addi $1, %edx cmpl $4, %edx jne L2 %rax, %rsi #include int main long int x- long int mask Oxff, int i,n,m; for(i=0;K n=i; long int n8 nn8) & long int left_over- x= left over main: movl $0, %eax movabsq $-2679396940471402103, %rsi movl $7,%r10d movl $255, %rSd L2: leal 0(%rdx,8), %rBd movi %r10d, %edi subl %edx, %edi sall $3, %edi movq %r9, %rax movl %edi, %ecx salq %edi, %rax notq %rax andq %rsi, %rax movq %r9, %r11 movl %rBd. %ecx sall $3, %ecx salq %ecx, % 11 andq %r11,%rsi sarq%ecx, %rsi andq %r11,%rsi movl %edi, %ecx salq %edi, %rsi orq addi $1, %edx cmpl $4, %edx jne L2 %rax, %rsi #include int main long int x- long int mask Oxff, int i,n,m; for(i=0;K n=i; long int n8 nn8) & long int left_over- x= left over

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

4. Are there any disadvantages?

Answered: 1 week ago

Question

3. What are the main benefits of using more information technology?

Answered: 1 week ago

Question

start to review and develop your employability skills

Answered: 1 week ago