Mail Archives: djgpp/1997/05/19/18:16:52
In article <1997051321301977565 AT zetnet DOT co DOT uk>,
Keith Hull <keithh AT zetnet DOT co DOT uk> wrote:
>Hi everyone,
>
>I would like some help with GCC and inline asm (i've looked at
>Brennan's Guide to Inline ASM - it seems to make sense ;) .... heres
>my problem..
>
>asm ("rorl _val, _num_of_rotates");
>asm ("roll _val, _num_of_rotates");
>asm ("sall _val, _num_of_rotates");
>asm ("sarl _val, _num_of_rotates");
>asm ("shll _val, _num_of_rotates");
>asm ("shrl _val, _num_of_rotates");
>
>none of the above statements compile under GCC!! They seem to have a
>problem with the first operand!
>
>Can anyone shed any light, i'm completely baffled.
You can't have that many memory operands, and you have them backwards.
You could have done "rorl $4, _val" or "rorl %cl, _val".
movb _num_of_rotates, %cl
rorl %cl, %ecx
Would do what I think you want.
Brennan
--
brennan AT rt66 DOT com | vi rules.
Riomhchlaraitheoir|
Rasterfarian | <http://brennan.home.ml.org> -O
- Raw text -