Need Help ?

Home / Expert Answers / Other / the-the-assembly-code-below-was-generated-by-compiling-the-c-code-given-below-the-assembly-code-find

(Solved): . The The assembly code below was generated by compiling the C code given below the assembly code. F ...



. The The assembly code below was generated by compiling the C code given below the assembly code. Find the values for the miC code for mystery function. Each instance of (i) e {a,b,c, d, e} represents an unknown variable or expression. long mystery

. The The assembly code below was generated by compiling the C code given below the assembly code. Find the values for the missing parts of the C code as indicated by the '(i)' and then answer the following questions: i registers hold the values for: x, n, result, and mask? (assume the 64-bit register identifier in each case) (b) Complete the table below (next page) in order to identify the missing C ex- pressions and the line of assembly code at which each C expression is defined. Assembly code for mystery function. Note that the line numbers in the first column have no functional value, but are supplied to help you answer the assignment. 1. loop: movl %esi, %ecx movl $1, %edx movl $0, %eax jmp .L2 3: In two nooos movq %rdi, %r8 anda %rdx, %r8 orq %r8, %rax salq %cl, "rdx .L2: testq %rdx, %rdx jne .L3 rep; ret C code for mystery function. Each instance of (i) e {a,b,c, d, e} represents an unknown variable or expression. long mystery (long x, long n) long result = (a) ; long mask; for (mask = (b); mask (c); mask = (d)) result = (e) ; return result; location of C expression at location unknown (of unknown line of assembly at which unknown C expression defined Show transcribed image text . The The assembly code below was generated by compiling the C code given below the assembly code. Find the values for the missing parts of the C code as indicated by the '(i)' and then answer the following questions: i registers hold the values for: x, n, result, and mask? (assume the 64-bit register identifier in each case) (b) Complete the table below (next page) in order to identify the missing C ex- pressions and the line of assembly code at which each C expression is defined. Assembly code for mystery function. Note that the line numbers in the first column have no functional value, but are supplied to help you answer the assignment. 1. loop: movl %esi, %ecx movl $1, %edx movl $0, %eax jmp .L2 3: In two nooos movq %rdi, %r8 anda %rdx, %r8 orq %r8, %rax salq %cl, "rdx .L2: testq %rdx, %rdx jne .L3 rep; ret
C code for mystery function. Each instance of (i) e {a,b,c, d, e} represents an unknown variable or expression. long mystery (long x, long n) long result = (a) ; long mask; for (mask = (b); mask (c); mask = (d)) result = (e) ; return result; location of C expression at location unknown (of unknown line of assembly at which unknown C expression defined


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to . The The assembly code below was generated by compiling the C code given below the assembly code. Find the values for t...
We have an Answer from Expert

Buy This Answer $7

Place Order