www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/30/22:04:32

Sender: nate AT cartsys DOT com
Message-ID: <36B3C8B1.8665F181@cartsys.com>
Date: Sat, 30 Jan 1999 19:06:25 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.36 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: ASM - function: what should be pushed?
References: <36b31ff4 DOT 0 AT news DOT zeitung-online DOT net>
Reply-To: djgpp AT delorie DOT com

Florian Janoschek wrote:
> 
> Hello everyone!
> 
> Could someone please tell me, which registers an assembly language function,
> that is called by djgpp, should push and which needn't to be pushed. (Of
> course, I know that I have to push only the registers, which I'm going to
> use...) Does this differ, if the function takes any arguments or has a
> return value?

(Should this be an FAQ?)

You have to save ebx, esi, edi, ebp, ds and es.  Args are passed on the
stack and so this has no effect on the registers used.  The return value
goes in eax, if there is one; otherwise you can clobber it.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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