Mail Archives: djgpp/1999/02/01/16:39:05
> one thing i want to do is rotate a char value's bits, like
> the x86 assembly instruction ROR/ROL does.
> is this possible with an operator, or do i have to use inline
> assembly for that?
>
#define ROL(a,b) ((a) << (b) | (a) >> (8-(b)))
#define ROR(a,b) ((a) >> (b) | (a) << (8-(b)))
I'm almost certain that gcc is smart enough to generate the rotate
opcode for this.
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
- Raw text -