www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/12/20:19:41

Message-ID: <32B0C833.3D0E@gbrmpa.gov.au>
Date: Fri, 13 Dec 1996 11:06:29 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: Benjamin D Chambers <chambersb AT juno DOT com>
CC: beppu AT rigel DOT oac DOT uci DOT edu, djgpp AT delorie DOT com
Subject: Re: [asm] what registers to preserve
References: <58a7kc$1pa AT news DOT service DOT uci DOT edu> <58jcu5$l6b AT leporello DOT cs DOT unibo DOT it>
<58m368$12a AT news DOT service DOT uci DOT edu> <19961213 DOT 161851 DOT 5007 DOT 1 DOT chambersb AT juno DOT com>

> >  Damn.  I didn't want to see that.  When I dump the assembler output
> >  of a function written in C, it doesn't look as if it preserves every
> >  register it uses.
 
> Is that with or without optimization?
> GCC sometimes tries to avoid pushes and pops by 'remembering' what's in
> which registers, and leaving them alone if the contents are needed later.

Hmmm...I wrap my functions in a C subroutine, and generally don't have
to push or pop everything at all... everything is taken care of for
me...
ie: the whole routine is

void foo()
{
	asm volatile ("
	...
	");
}

Leathal.

- Raw text -


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