Hello ,

I am asking for a little explanation about "Mixing" Assembly and C programs together on Ubuntu with the Code : gcc assembly.s main.c . The question is , What is 4(%esp) in here ? where does it point to ?

##in file main.c

#include <stdio.h>
int main(){
int i = assembly(7);
return 0; }

##in file assembly.s
.global gaus
movl 4(%esp), %eax
movl %eax , %ebx
inc %ebx
imull %ebx , %eax
movl $2,%ebx

And please if anyone can explain this method of c program to call an assembly , and whether it is wrong or not, as its a homework I have done and want to know how to discuss about it.