delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/08/12:43:16

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Fri, 8 Feb 2002 12:42:21 -0500
Message-Id: <200202081742.g18HgL008217@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <5563ab859c72dffdd2ded7c0f0edf714.62691@mygate.mailgate.org>
(jbs30000 AT aol DOT com)
Subject: Re: Uhm, nobody knows the answer or...
References: <6e0d77f39bba940fee0e0149fb76a996 DOT 62691 AT mygate DOT mailgate DOT org> <a40i4b$oil$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <5563ab859c72dffdd2ded7c0f0edf714 DOT 62691 AT mygate DOT mailgate DOT org>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> #define Mov_Byte(Src, Dest, Mov_Size)\
>         __asm__ __volatile__(\
>                 "cld\n\t"\
>                 "rep\n\t"\
>                 "movsb"\
>                 : :"S" (Src), "D" (Dest), "c" (Mov_Size)\
>                 :"%ecx", "%esi", "%edi"
> And try the same thing, then when making the program, I get this error:
> Error: Can't find a register in class `CREG' while reloading `asm'.

You can't clobber a register you're also using for in/out.  What you
need to do here is have an output entity as well, which is "c"
(Move_Size), and have the input that used to be "c" be "0" (edit as
needed).  That tells gcc that ecx is used as input *and* changed as
output.

- Raw text -


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