Bit twiddling functions 
Author Message
 Bit twiddling functions

Regular binary <-> Gray code         perhaps?
--
Kevin G. Rhoads, Ph.D. (The Cheshire Cat for official Internet mascot.)



Thu, 25 Jul 2002 03:00:00 GMT  
 Bit twiddling functions
On 4 Feb 2000 07:22:12 -0500, in comp.lang.asm.x86 Ari Lukumies

[...]

Quote:
>This is not strictly bit manipulation, but one common thing is to
>convert values between endians (byte/word/dword swapping, so to speak).
>For example (value 12345678h):

>ofs:        0       1       2       3
>big:        12      34      56      78
>lit:        78      56      34      12
>?:  56      78      12      34

>The last one I don't know what it is, but I ran into it recently (it's
>used in Modbus/TCP PLCs). Of course, there are others than integer
>types, too, in IEC-1131.

A bit off-topic, maybe, but the PDP-11 is a little-endian 16-bit
processor that, nonetheless, ordered words big-endian when dealing
with 32-bit values, i.e., in your table above would be represented by

PDP-11: 34      12      78      56

I've heard this ordering referred to as "middle-endian."

Regards,

                          -=Dave
--
Just my (10-010) cents
I can barely speak for myself, so I certainly can't speak for B-Tree.
Change is inevitable.  Progress is not.



Fri, 26 Jul 2002 03:00:00 GMT  
 Bit twiddling functions

Quote:

> A bit off-topic, maybe, but the PDP-11 is a little-endian 16-bit
> processor that, nonetheless, ordered words big-endian when dealing
> with 32-bit values, i.e., in your table above would be represented by

  Very off-topic, and also incorrect.  The PDP-11 had no significant
built-in support for 32-bit values.  Such support as the later ones had
was little-endian, just like a 386.

  All user visible support for 32-bit values (such as long's in C) was
determined by software, not by the CPU design.  All such support that I
ever saw was little endian.  You may have seen some aberrant software
that did it wrong.  That certainly doesn't mean the CPU design did.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/



Fri, 26 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Bit twiddling functions

2. Bit Twiddling??

3. Bit twiddling on Parallel port

4. UUDECODE - Bit-twiddling in Arexx

5. SIMD-like bit-twiddling on odd-sized quantities

6. New Mathematical bit-twiddle - stage on of a isPerfectSquare()

7. Crazy bit-twiddle algorithms needed!

8. Byte/Bit Twiddling in Ada

9. Bit Twiddling in IBM (LE) COBOL

10. help - bit twiddling anomoly

11. Twiddle binary bit in Cobol?

12. Bit Twiddling

 

 
Powered by phpBB® Forum Software