www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/28/02:19:49

Date: Mon, 28 Aug 1995 07:34:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Jerry van Dijk <jerry AT jvdsys DOT nextjk DOT stuyts DOT nl>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: More optimizing trouble

On Fri, 25 Aug 1995, Jerry van Dijk wrote:

> c:/djgpp/include/sys/farptr.h: In function `main':
> c:/djgpp/include/sys/farptr.h:159: `asm' operand constraint incompatible with operand size
> 
> Please can someone help me to preserve any sanity I might have left ?
> :-))

I've bumped into this while working with v2.0 beta, but never bothered to 
check if it's also broken in v1.x.

Mat Hostetter <mat AT ardi DOT com> sent me this in reply to my gripe:


> Here's the inline asm from sys/farptr.h:
>
> >extern __inline__ void
> >_farnspokeb(unsigned long offset,
> >        unsigned char value)
> >{
> >  __asm__ __volatile__ (".byte 0x64\n"
> >      "        movb %0,(%1)"
> >      :
> >      : "r" (value), "r" (offset));
> >}
>
> The first "r" should instead be "abcd", to force the source value to
> appear in one of the four byte addressable registers.  Otherwise, gcc
> is free to generate a byte move from %esi or %edi.  "%0" should also
> be changed to "%b0", so gcc will generate "%al" instead of "%eax",
> etc. (although I think gas will do the right thing anyway because of
> the "movb").
>
> -Mat

- Raw text -


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