www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/23/12:30:36

From: viktor DOT lundstrom AT mailbox DOT swipnet DOT se (Viktor Lundstrom)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: is this an inline asm bug?
Date: Mon, 23 Mar 1998 17:14:29 GMT
Organization: A customer of Tele2
Lines: 29
Message-ID: <3516978c.33819073@nntpserver.swip.net>
References: <199803230554 DOT VAA24614 AT adit DOT ap DOT net>
NNTP-Posting-Host: mn8.swip.net
Mime-Version: 1.0
Cache-Post-Path: mn8!s-13642 AT dialup185-2-36 DOT swipnet DOT se
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 22 Mar 1998 21:54:35 -0800 (PST), Nate Eldredge
<eldredge AT ap DOT net> wrote:

>At 08:43  3/22/1998 GMT, Jason Stratos Papadopoulos wrote:
>>Hello. In the course of writing some high-speed modular multiplication
>>I came across this problem with gcc's inline assembly.
>>
>>The full code is too lengthy to post, but I have some inline assembly
>>for which eax is on the clobber list. More specifically, the function
>>it's in looks like this:
>[deleted]
>>Why is gcc using eax to address memory when I specifically put it on
>>the clobber list?! This has actually happened once or twice before, the
>>only way around it is to use all the register names directly, rather than
>>leave it up to the compiler.
>>
>>Is this a bug?
>
>I think this is a bug, especially since the documentation says:
>
>"The input operands are guaranteed not to use any of the clobbered registers..."
>
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 GPF´s... 
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. 

- Raw text -


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