Double_Word - peregrineshahin/ChessProgrammingWiki GitHub Wiki


title: Double Word

Home * Programming * Data * Double Word

According to Intel's definition of a x86 16-bit Word, a Double Word refers a 32-bit entity, while IBM 360 and successors with 32-bit words have double words with 64-bit.

Integer and long

Even in x86-64, double words are still considered as default word size. x86 and and x86-64 C-Compiler use double words as signed and unsigned integers, Java integers as well. Microsoft 64 bit compiler long is a 32-bit Double word as well, while with 64-bit GCC uses 64-bit Quad Words as longs.


typedef unsigned int DWORD;

Ranges

| language | type | min | max | | --- | --- | --- | --- | | C, C++ | unsigned int | 0 | 4,294,967,295 | | hexadecimal | 0x00000000 | 0xFFFFFFFF | | C, C++,Java | int | -2,147,483,648 | 2,147,483,647 | | hexadecimal | 0x80000000 | 0x7FFFFFFF |

Alignment

Double Words stored in memory should be stored at byte addresses divisible by four. Otherwise at runtime it will cause a miss-alignment exception on some processors, or a huge penalty on others.

Endianness

Main article: Endianness.

Litte-endian Layout

The little-endian memory layout, as typical for Intel x86 cpus. For instance the double word integer 16909060 or 0x01020304:

| Address | Byte | Significance | | --- | --- | --- | | 0x0000 | 0x04 | LS Byte | | 0x0001 | 0x03 | | | 0x0002 | 0x02 | | | 0x0003 | 0x01 | MS Byte |

Big-endian Layout

The big-endian memory layout, as typical for Motorola cpus. For instance the double word integer 16909060 or 0x01020304:

| Address | Byte | Significance | | --- | --- | --- | | 0x0000 | 0x01 | MS Byte | | 0x0001 | 0x02 | | | 0x0002 | 0x03 | | | 0x0003 | 0x04 | LS Byte |

See also

External Links

Up one Level