www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/01/07:44:52

From: nikki AT gameboutique DOT co (nikki)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Possible bug/misfeature in GCC
Date: 1 Feb 1997 11:03:25 GMT
Organization: GameBoutique Ltd.
Lines: 24
Message-ID: <5cv7tt$4b2@flex.uunet.pipex.com>
References: <32F1A438 DOT 5509 AT rangenet DOT com>
NNTP-Posting-Host: www.gameboutique.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> unsigned char inportb (int port)
> {
>   unsigned char c;
>   asm ("inb     %%dx, %%al"
>      : "=a" (c)
>      : "d" (port));
>   return c;
> }
> 

just a thought, would marking a and d as clobbered help at all?
ie. asm volatile ("inb %%dx,%%al"
		: "=a" (c)
		: "d" (port)
		: "al", "dx" ); ?
perhaps if gcc was forced to reload d each time it wouldn't be able to
optimise it by assuming the value in it was constant? mind you it might just
push it on a stack instead :)

regards,
nik
-- 
Graham Tootell           
nikki AT gameboutique DOT com  

- Raw text -


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