| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| en:multiasm:cs:chapter_3_11 [2026/02/27 14:18] – [Table] jtokarz | en:multiasm:cs:chapter_3_11 [2026/03/29 18:24] (current) – [Endianness] ktokarz |
|---|
| <table binarynumbers> | <table binarynumbers> |
| <caption> Integer binary numbers</caption> | <caption> Integer binary numbers</caption> |
| ^ <fs small>Number of bits</fs> ^ <fs small>Minimum value (hexadecimal)</fs> ^ <fs small>Maximum value (hexadecimal)</fs> ^ <fs small>Minimum value (decimal)</fs> ^ <fs small>Maximum value (decimal)</fs> ^ | ^ Number of bits ^ Minimum value (hexadecimal) ^ Maximum value (hexadecimal) ^ Minimum value (decimal) ^ Maximum value (decimal) ^ |
| | <fs small>8</fs> | <fs small>0x00</fs> | <fs small>0xFF</fs> | <fs small>0</fs> | <fs small>255</fs> | | | 8 | 0x00 | 0xFF | 0 | 255 | |
| | <fs small>8 signed</fs> | <fs small>0x80</fs> | <fs small>0x7F</fs> | <fs small>-128</fs> | <fs small>127</fs> | | | 8 signed | 0x80 | 0x7F | -128 | 127 | |
| | <fs small>16</fs> | <fs small>0x0000</fs> | <fs small>0xFFFF</fs> | <fs small>0</fs> | <fs small>65 535</fs> | | | 16 | 0x0000 | 0xFFFF | 0 | 65 535 | |
| | <fs small>16 signed</fs> | <fs small>0x8000</fs> | <fs small>0x7FFF</fs> | <fs small>-32 768</fs> | <fs small>32 767</fs> | | | 16 signed | 0x8000 | 0x7FFF | -32 768 | 32 767 | |
| | <fs small>32</fs> | <fs small>0x0000 0000</fs> | <fs small>0xFFFF FFFF</fs> | <fs small>0</fs> | <fs small>4 294 967 295</fs> | | | 32 | 0x0000 0000 | 0xFFFF FFFF | 0 | 4 294 967 295 | |
| | <fs small>32 signed</fs> | <fs small>0x8000 0000</fs> | <fs small>0x7FFF FFFF</fs> | <fs small>-2 147 483 648</fs> | <fs small>2 147 483 647</fs> | | | 32 signed | 0x8000 0000 | 0x7FFF FFFF | -2 147 483 648 | 2 147 483 647 | |
| | <fs small>64</fs> | <fs small>0x0000 0000 0000 0000</fs> | <fs small>0xFFFF FFFF FFFF FFFF</fs> | <fs small>0</fs> | <fs small>18 446 744 073 709 551 615</fs> | | | 64 | 0x0000 0000 0000 0000 | 0xFFFF FFFF FFFF FFFF | 0 | 18 446 744 073 709 551 615 | |
| | <fs small>64 signed</fs> | <fs small>0x8000 0000 0000 0000</fs> | <fs small>0x7FFF FFFF FFFF FFFF</fs> | <fs small>-9 223 372 036 854 775 808</fs> | <fs small>9 223 372 036 854 775 807</fs> | | | 64 signed | 0x8000 0000 0000 0000 | 0x7FFF FFFF FFFF FFFF | -9 223 372 036 854 775 808 | 9 223 372 036 854 775 807 | |
| </table> | </table> |
| |
| <caption>Illustration of Little and Big Endian data placement in the memory</caption> | <caption>Illustration of Little and Big Endian data placement in the memory</caption> |
| </figure> | </figure> |
| | |
| | Big-endian is mainly used in network protocols, where the most significant bytes are sent first. In modern processors, the dominant order of data placement in memory is little-endian, although some processors (including ARM) can support both modes. Big endian is more human intuitive, but little endian makes it possible to access the same data with different sizes at the same address. It is important for fast data type casting (for example, treating a 32-bit integer as a 16-bit integer) because the starting address doesn't change. Some processors support conversion between little- and big-endianness with special instructions. |