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

To: beppu AT rigel DOT oac DOT uci DOT edu
Cc: djgpp AT delorie DOT com
Subject: Re: [asm] what registers to preserve
Message-ID: <19961213.161851.5007.1.chambersb@juno.com>
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>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Thu, 12 Dec 1996 19:16:20 EST

On 11 Dec 1996 10:42:16 GMT beppu AT rigel DOT oac DOT uci DOT edu (John Beppu) writes:
>In article <58jcu5$l6b AT leporello DOT cs DOT unibo DOT it>,
>Nicola Gaggi <gaggi AT cs DOT unibo DOT it> wrote:
>
>>John Beppu (beppu AT rigel DOT oac DOT uci DOT edu) wrote:
>>
>>:   When linking a function written in assembly, which
>>:   registers should be preserved?  I think ebp should,
>>:   but are there any others?
>>
>>
>>Hello,
>>
>>The answer is simple, every register your function clobbers excluding 
>AX
>
>
>  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.

- Raw text -


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