Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Is this a correct translation of what the IA 32 assembly language is portraying [in blue text after //] ? Sum.c contents: int add (int

Is this a correct translation of what the IA 32 assembly language is portraying [in blue text after //] ?

Sum.c contents:

image text in transcribed

int add (int x, int y) { int z; z = x + y; return z; } If this is in sum.c we can produce assembly code with: gcc -01 -s sum.c This generates the following: .file "sum.c" .text .globl add .type add, @function ada: pushi Sebp push long 32 bit operand value movl fesp, febp move long value 'ebp' to value 'esp' 12 ( ebp), feax // ebp stored at ebp+12 goes into eax addl 8( febp), feax }}ebp long value stored at [ ebp+8 ] adds eax long value popl febp || pop and return long value ebp movl ret return int add (int x, int y) { int z; z = x + y; return z; } If this is in sum.c we can produce assembly code with: gcc -01 -s sum.c This generates the following: .file "sum.c" .text .globl add .type add, @function ada: pushi Sebp push long 32 bit operand value movl fesp, febp move long value 'ebp' to value 'esp' 12 ( ebp), feax // ebp stored at ebp+12 goes into eax addl 8( febp), feax }}ebp long value stored at [ ebp+8 ] adds eax long value popl febp || pop and return long value ebp movl ret return

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

Question

Question Can employees make contributions to a profit sharing plan?

Answered: 1 week ago