delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/24/20:55:18

Date: Tue, 24 Mar 1998 13:14:59 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Viktor Lundstrom <viktor DOT lundstrom AT mailbox DOT swipnet DOT se>
cc: djgpp AT delorie DOT com
Subject: Re: is this an inline asm bug?
In-Reply-To: <3516978c.33819073@nntpserver.swip.net>
Message-ID: <Pine.SUN.3.91.980324131430.21946I-100000@is>
MIME-Version: 1.0

On Mon, 23 Mar 1998, Viktor Lundstrom wrote:

> Something similar happened to me before... I used an inline asm
> function to write to the text-mem (ie. 0xb8000), and the inline asm 
> function overwrote a pointer to a struct, resulting in GPFs... 
> I replaced the inline asm function with _farpokeb (or whatever - a
> DJGPP function in any case), and it worked. I guess the DJGPP 
> function restored all the registers it clobbered, but my inline asm
> function listed all the clobbed registers. 

Well, `_farpokeXX' functions are implemented in inline assembly, and
they rely on GCC to reload any registers they clobber.  See the header
<sys/farptr.h>.  You might compare the code there with your version,
to see what exactly did you do differently.  Perhaps there *is* a bug
in GCC, but it is only limited to certain registers and not to all of
them.  Or perhaps you used a different constraint letter(s).

- Raw text -


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