delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/05/16:14:52

Message-Id: <m0wvpvz-0003GbC@fwd02.btx.dtag.de>
Date: Tue, 5 Aug 97 22:10 MET DST
To: djgpp AT delorie DOT com
References: <01bca0ea$65213dc0$56a333cf AT gisco DOT net DOT gisco DOT net>
Subject: Re: Help with using Nasm
MIME-Version: 1.0
From: Georg DOT Kolling AT t-online DOT de (Georg Kolling)

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019