Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem B (30 points) Consider the following assembly code main: movl $0,%edx movabsq $-2679396940471402103, %rsi movl $7, %r10d movl $255, ar9d L2 leal 0(,%rdx,8), %rBd
Problem B (30 points) Consider the following assembly code main: movl $0,%edx movabsq $-2679396940471402103, %rsi movl $7, %r10d movl $255, ar9d L2 leal 0(,%rdx,8), %rBd movl %r10d, %edi subi %edx, %edi sall $3, %edi movq %r9, %rax movl %edi, %ecx salq %edi, %rax notq % rax andq %rsi, %rax movq %r9, %r11 movl %18d, %ecx sall $3, %ecx sala %ecx, %r11 andq %r11,%rsi sara%ecx, %rsi andq %r11,%rsi movl %edi, %ecx sala %edi, %rs. orq %rax addl $1, %edx cmpl $4, %edx ne , %rsi This code came from skeleton C file below after optimizing with 01. This means gcc -01-S command was used to convert C File into assembly file Complete the C code given below using the provided assembly code Step 1 might be to ignore the skeleton file and create a equivalent C code from the assembly code, and then rewrite the code to fit the skeleton file int main( long int x- long int mask = 0xff; int i,n,m; for(i=0; i++)f m7-i long int n8 n n8) & long int left_over- x left over Problem C (40 points) Given the following initial values for the registers and memory (values are reset back to the values shown in the table before each operation), determine the result of the following operations and state where the result is stored. (40 points, 2 points for destination, 3 points for result) Address 0x100 0x108 0x110 0x58 Value 0xFF 0xAB 0x13 0x11 Register Value 0x100 0xAB001 0x50 %rsi %rdx Instruction addq %rdx,%rax decq 8(%rdx) salq 6,%rbx xorq %rbx, %rsi movl %eax, %esi leaq 4(%rax, %rsi, 4), %rdx negl 81%eax) salw 3%si Destination Result
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started