Well I have here an issue that involves assembly and C.
The variable format
has more than 4 bytes, but I can still push
of it without casting and returning the old ESP value after pushing. How is it possible?
ASM
segment .data
format db "oleeee %d",10,0;tem muito mais que 4 bytes
segment .text
global _my_func
extern _printf
extern _soma
_my_func:
push ebp
mov ebp, esp ;inicio
push dword [numero]
push dword format
call _printf
add esp, 8 ;remover
push dword 5
push dword 200
call _soma
add esp,8 ;remover
push eax
push dword format
call _printf
mov esp,ebp
pop ebp ;fim
ret
C
int soma(int a, int b){
return a+b;
}
int main()
{
int ret_status;
ret_status = my_func();
return ret_status;
}