This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en:multiasm:cs:chapter_3_11 [2026/06/23 11:52] – [Endianness] ktokarz | en:multiasm:cs:chapter_3_11 [2026/06/23 13:35] (current) – pczekalski | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Integers ===== | ===== Integers ===== | ||
| - | Integer data types can be 8-, 16-, 32-, or 64-bit long. If the encoded number is unsigned, it is stored in binary, while if the value is signed, it is stored in two's complement. A natural binary number range starts with zero. In such a case, it contains all bits equal to zero. While it contains all bits equal to one, the value can be calculated with the expression\\ | + | Integer data types can be 8-, 16-, 32-, or 64-bit long. If the encoded number is unsigned, it is stored in binary; if it is signed, it is stored in two's complement. A natural binary number range starts with zero. In such a case, it contains all bits equal to zero. While it contains all bits equal to one, the value can be calculated with the expression\\ |
| {{: | {{: | ||
| where n is the number of bits in a number. | where n is the number of bits in a number. | ||
| Line 33: | Line 33: | ||
| <figure realtypes> | <figure realtypes> | ||
| {{ : | {{ : | ||
| - | < | + | < |
| </ | </ | ||
| Line 65: | Line 65: | ||
| <figure littlebigendian> | <figure littlebigendian> | ||
| {{ : | {{ : | ||
| - | < | + | < |
| </ | </ | ||
| Big-endian is mainly used in network protocols, where the most significant bytes are sent first. In modern processors, the dominant data-placement order in memory is little-endian, | Big-endian is mainly used in network protocols, where the most significant bytes are sent first. In modern processors, the dominant data-placement order in memory is little-endian, | ||