Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (8 points) Write C code for the following assembly code foo: pushl movl movl addl movl movl ???? %ebp %esp, %ebp 12(%ebp) ,%ecx 8(%ebp),

image text in transcribed

1. (8 points) Write C code for the following assembly code foo: pushl movl movl addl movl movl ???? %ebp %esp, %ebp 12(%ebp) ,%ecx 8(%ebp), %ecx $1, %eax $1,%edx $1,%ecx L7 %ecx, test1 %ecx L6 L8 : mu11 addi %eax, %eax $1,%eax jge jmp .L8 .L6 .L7: L6 : popl %ebp ret LCO: string "%d %d" test: pushl movl subl leal movi leal movi mov1 mov! movl call movl movl movl movl call leave ret %ebp %esp, %ebp $40,%esp -16(%ebp), %eax %eax, 12(%esp) -12(%ebp) ,%eax %eax ,8(%esp) $..LCO , 4(%esp) 8(%ebp), %eax %eax ,(%esp) sscanf -16 (%ebp), %eax %eax, 4(%esp) 12(%ebp), %eax ,(%esp) foo %eax 1. (8 points) Write C code for the following assembly code foo: pushl movl movl addl movl movl ???? %ebp %esp, %ebp 12(%ebp) ,%ecx 8(%ebp), %ecx $1, %eax $1,%edx $1,%ecx L7 %ecx, test1 %ecx L6 L8 : mu11 addi %eax, %eax $1,%eax jge jmp .L8 .L6 .L7: L6 : popl %ebp ret LCO: string "%d %d" test: pushl movl subl leal movi leal movi mov1 mov! movl call movl movl movl movl call leave ret %ebp %esp, %ebp $40,%esp -16(%ebp), %eax %eax, 12(%esp) -12(%ebp) ,%eax %eax ,8(%esp) $..LCO , 4(%esp) 8(%ebp), %eax %eax ,(%esp) sscanf -16 (%ebp), %eax %eax, 4(%esp) 12(%ebp), %eax ,(%esp) foo %eax

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago