Menu

[Solved]Converting X86 Assembly C Please Don T Answer Unless Confident Don T Copy Work Put Runtime Q37173924

Converting x86 Assembly to C… Please don’t answer unless youare confident. And don’t copy work. I put runtime but I’m notcertain.

#include <stdio.h> typedef struct Point int xi int yi Point int func(Point pl, Point p2) int main(O Point pl, p2; pi.y -1O p2

func: pushl %ebp movl %esp, %ebp pushl %esi subl $20, %esp movl 20(%ebp ) , %eax movl 16(%ebp ) , %ecx movl 12 ( %ebp), %eax

#include <stdio.h> typedef struct Point int xi int yi Point int func(Point pl, Point p2) int main(O Point pl, p2; pi.y -1O p2.x2 p2.y 6 printf (“%dn”, return func ( p1, p2 )); func: pushl %ebp movl %esp, %ebp pushl %esi subl $20, %esp movl 20(%ebp ) , %eax movl 16(%ebp ) , %ecx movl 12 ( %ebp), %eax movl 8(%ebp), %esi movl %esi, -16(%ebp ) movl %edx, -12(%ebp ) movl %ecx, -24(%ebp ) movl %eax, -20(%ebp ) movl -12(%ebp ) , %eax add 1-24(%ebp ), %eax addl $20, %esp popl %esi popl %ebp ret Given the assembly code for func, the output of the program is: Show transcribed image text #include typedef struct Point int xi int yi Point int func(Point pl, Point p2) int main(O Point pl, p2; pi.y -1O p2.x2 p2.y 6 printf (“%dn”, return func ( p1, p2 ));
func: pushl %ebp movl %esp, %ebp pushl %esi subl $20, %esp movl 20(%ebp ) , %eax movl 16(%ebp ) , %ecx movl 12 ( %ebp), %eax movl 8(%ebp), %esi movl %esi, -16(%ebp ) movl %edx, -12(%ebp ) movl %ecx, -24(%ebp ) movl %eax, -20(%ebp ) movl -12(%ebp ) , %eax add 1-24(%ebp ), %eax addl $20, %esp popl %esi popl %ebp ret Given the assembly code for func, the output of the program is:

Expert Answer


Answer to Converting x86 Assembly to C… Please don’t answer unless you are confident. And don’t copy work. I put runtime but I’m… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *