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

From: gaggi AT cs DOT unibo DOT it (Nicola Gaggi)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [asm] what registers to preserve
Date: 10 Dec 1996 10:10:13 GMT
Organization: Department of Computer Science, University of Bologna, Italy
Lines: 26
Message-ID: <58jcu5$l6b@leporello.cs.unibo.it>
References: <58a7kc$1pa AT news DOT service DOT uci DOT edu>
NNTP-Posting-Host: 130.136.1.163
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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
(EAX), gcc makes large use of registers instead the old Borland C v3.1
made use only of SI and DI to store register variable. I don't know if i am
right, probably some one out there can help us, but just yesterday I have
found a big bug in my old DJGPP v2.0 code, some register (ECX, EDX and ES) were
not saved on the stack, and the machine hanged up.

Cheers,

--
--------------------------------------------------------------------
Nicola Gaggi                                  University of Bologna.
e-mail  : gaggi AT cs DOT unibo DOT it  WWW page: http://www.cs.unibo.it/~gaggi
--------------------------------------------------------------------
.. Be yourself, no matter what they say
  from "Englishman in New York" by Sting

- Raw text -


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