I am trying to translate the following:
Action:
push %ebp #function prolog
mov %esp, %ebp
sub $0x10, %esp
mov 0x8(%ebp), %eax #first line compiles to these 4 lines
imul 0x8(%ebp), %eax
sub $0x7, %eax
mov %eax, -0x4(%ebp)
addl $0x8, 0xc(%ebp) #second line
mov -0x4(%ebp), %eax #third line
mov 0xc(%ebp), %edx
mov (%edx, %eax, 4), %eax
add $0x3, %eax
movb $0x41, (%eax)
leave
ret
So far I have the following:
//What am I missing?
void Action(int x, char **y)
{
int z = x * x - 7;
y+=8;
//missing third line
}
What is the best way to translate this?