delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/25/21:13:05

To: djgpp AT delorie DOT com
Subject: Re: Inline assembly - rotate left
References: <4125673F DOT 005E129F DOT 00 AT derumg01 DOT cyberlink DOT eds DOT com>
From: Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su>
Date: 26 Mar 1999 07:59:13 +0600
In-Reply-To: david.stegbauer@cz.opel.com's message of "Thu, 25 Mar 1999 18:19:58 +0100"
Message-ID: <207ls5huz2.fsf@Sky.inp.nsk.su>
Lines: 18
X-Mailer: Gnus v5.5/Emacs 19.34
Reply-To: djgpp AT delorie DOT com

david DOT stegbauer AT cz DOT opel DOT com writes:

> #ifdef __DJGPP__
>     #define roll(val,cnt) asm volatile (\
>         "movl %2, %%ecx \n\t" \
>         "roll %%cl, %1" \
>             :"=r" (val) \
>             :"r"(val), "r"(cnt) \
                ^
                this must be 0.  You need to use the same register for
input and output of rotated value.  As Nate said it would be better to
use "c" constraint for cnt and get rid of clobbering.

>             :"%ecx")
> #endif /*__DJGPP__*/

-- 
Michael Bukin

- Raw text -


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