When I compile the function below: gcc -S teste.c
void readInput() {
int buf;
}
teste.S becomes:
readInput:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
leave
ret
My doubt is: why is% esp subtracted from 16 bytes, shouldn't it be 4 bytes for int? Does he have a todo with alignment?
Similar things happen when I compile this:
void readInput() {
char buf;
}
and the output is the same as above.
source
share