Mail Archives: djgpp/1997/08/05/16:14:52
Ben Cohee schrieb:
> Hello, i have a couple of questions about Nasm and how it passes
> parameters. Ive read that to acess the parms that you have to have
> push ebp
> mov ebp, esp
> and that from then the parms can be acessed by [ebp + 8] for the first parm
> and +4 for every parm after that. The question is does this matter what
> type of parm it is? Like char * or int or fix.
I really don't know why esp is copied to ebp (at least NASM's example code does
so). But it does matter what type of parm it is!
for example: c prototype void xxx (char a, short b, long c)
a = BYTE [esp + 4]
b = WORD [esp + 5]
c = DWORD [esp + 7]
- Raw text -