From: brennan AT mack DOT rt66 DOT com (Brennan "The Rev. Bas" Underwood) Newsgroups: comp.os.msdos.djgpp Subject: Re: Bitwise ASM with DJGPP GCC Date: 18 May 1997 17:52:06 -0600 Organization: Acid Brain Lines: 35 Distribution: world Message-ID: <5lo4n6$apu$1@mack.rt66.com> References: <1997051321301977565 AT zetnet DOT co DOT uk> NNTP-Posting-Host: mack.rt66.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <1997051321301977565 AT zetnet DOT co DOT uk>, Keith Hull 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 | -O