Answered step by step
Verified Expert Solution
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),
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
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