Mail Archives: djgpp/1998/06/30/14:20:25
>>I have noticed, though, that the PC only has one type of shifting command.
>>On the Motorola, there's ASL, ASR (arethmetic), LSL and LSR (logical),
along
>>with the rolling commands ROL and ROR and all the shifting commands that
>>change different bits depending on the values entered into them. Are there
>>any of these on the PC?
>
>This is rather machine dependent. Don't know how this is on the PC, but on
my
>Amiga it depended on the type of the variable you used. I'm not sure which
on
>were really used but when you declared "unsigned int" then the >> used ASL
and
>with "signed int" it used LSL (or vice versa, I'm not sure exactly anymore
>about this). 80x86 has also a logical and an arithmetic shift and I guess
that
>compilers use this as well.
It was probably the case on my ST; but I skipped C because ASM on the M68k
is FAR easier. :^)
If you'd tried graphics programming on your Amiga, you'd have used the
shifting a LOT more.
In case anybody's wondering why I need to know about data shifting in C, I
don't. I'm simply curious and when the subject came up I wanted to fill a
gap in my knowledge...
James Arthur
jaa AT arfa DOT clara DOT net
- Raw text -