I've been using macros for most of this time, but I'm pretty sure using them too much could cause certain problems, and I see people using mostly procedures anyway, so i decided to give procedures a go.
Here is the procedure:
foo:
pop dword [eax]
mov ecx, eax
mov edx, 1
mov eax, 4
mov ebx, 1
int 80h
add esp, 4
ret
and here is how i envoke it:
push num
call foo
Here, I'm trying to pass num as a parameter, but when run this program, I get a segfault. It might be because of cleaning the stack. Any help would be greatly appreciated.