delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/03/16:27:10

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199706032025.AA133499524@typhoon.rose.hp.com>
Subject: Re: Nasm and DJGPP
To: Anders DOT Ohrt AT swipnet DOT seV (Anders \Vhrt)
Date: Tue, 03 Jun 1997 13:25:23 PDT
Cc: djgpp AT delorie DOT com
In-Reply-To: <33943044.153380@nntpserver.swip.net>; from "Anders \Vhrt" at Jun 03, 97 3:08 pm

> little problem. I used to write:
> void func(int a, char b){
> 	asm{
> 		...
> 	}
> }
> 
> How do I get the parameters when using 100% nasm instead of inline
> asm? And how do I return structs? I need to return 3 values (chars)...

The easiest way to see how the compiler expect things to work is
to write C code, and then compile with the -S option and look
at the assembly listing given. GCC passes parameters on the stack,
from right to left.  So, at entry to your function, [ESP+4] = left most
argument.  Normally, return values go in EAX.  Floats are different of 
course.  Sorry I can't help with returning structs, check the assembly
output



> And what is a coff file?
Common Object File Format

- Raw text -


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