delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/01/20:50:27

Date: Mon, 1 Feb 1999 20:48:50 -0500
Message-Id: <199902020148.UAA06492@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <36B64EBA.6D55@erols.com> (johnfine@erols.com)
Subject: Re: ASM - function: what should be pushed?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990201085530 DOT 27193D AT is> <36B64AA2 DOT DDD7B659 AT cartsys DOT com> <36B64EBA DOT 6D55 AT erols DOT com>
Reply-To: djgpp AT delorie DOT com

>   I hate arguing with the experts, but I don't think...

OK, here it is from the horse's mouth (the gcc/libc sources).  Let me
know if I missed any.

ax,cx,dx,sp,st0-7,sw,cw - can be used without saving
bx,si,di,bp - must be preserved
cs,ds,es,ss - must be preserved
ip - you don't much choice about this one
fs - reserved for application use; neither gcc nor libc use this
gs - used by libc, but need not be preserved if you change it
eflags - gcc doesn't treat this as a register, so you need not save
	it.  In fact, gcc emits "cld" whenever it inlines a block move.
gdtr,ldtr,idtr,tr,cr*,dr*,tr* - not used by gcc or libc

- Raw text -


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