Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain and fill in c pogram and fill in the table. thank you dont forget to explain your steps. for Part A has you

Please explain and fill in c pogram and fill in the table. thank you image text in transcribed
dont forget to explain your steps.
for Part A has you fill in some C code from assembly and match registers/addresses to variables
x86
Assembly Code: C Code .file "hw4a.c" .text int main(){ unsigned x = int c = 0; int sa for(int i = 0; ifl globl main .type main, @function main: pusha %rbp movq%rsp, %rbp movl $1889785064,-16(%rbp) movl $0.-12(%rbp) movl $-1,-4(%rbp) movl $0,-8(%rbp) jmp.L2 .L4: movl -16%rbp), %eax andl $1, %eax movl %eax, -4(%rbp) cmpl$0,-4(%rbp) jne .L3 addl $1, -12%rbp) .L3: shrl $4,-16(%rbp) addl $1,-8(%rbp) return 0; .L2: cmpl $7,-8(%rbp) jle L4 movl $0,%eax popq %rbp ret The assembly code on the left came from the skeleton C file on the right after optimizing with-00. ("gcc-00-S-fno- asynchronous-unwind-tables", the last option was used to disable cfi directives). Complete the C code based on the Assembly code given. It may help to first fill out the table below to map the registers/addresses to the C variables Assembly address/register C variable

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

More Books

Students also viewed these Databases questions