| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| en:multiasm:papc:chapter_6_4 [2026/02/27 01:40] – [Table] jtokarz | en:multiasm:papc:chapter_6_4 [2026/03/29 18:50] (current) – [Data Types and Encoding] ktokarz |
|---|
| ====== Data Types and Encoding ====== | ====== Data Types and Encoding ====== |
| | The x86 family of processors allows for computations on integer, floating-point, and vector data. This data is stored in memory as binary strings of varying lengths. In this chapter, we will present fundamental data types, as well as the types based on them found in assembly language programs. |
| ===== Fundamental data types ===== | ===== Fundamental data types ===== |
| Fundamental data types cover the types of data elements that are stored in memory as 8-bit (Byte), 16-bit (Word), 32-bit (Doubleword), 64-bit (Quadword) or 128-bit (Double quadword), as shown in figure {{ref>fundamentaldata}}. Many instructions allow for processing data of these types without special interpretation. It depends on the programming engineer how to interpret the inputs and results of instruction execution. The order of bytes in the data types containing more than a single byte is little-endian. The lower (least significant) byte is stored at the lower address of the data. This address represents the address of the data as a whole. | Fundamental data types cover the types of data elements that are stored in memory as 8-bit (Byte), 16-bit (Word), 32-bit (Doubleword), 64-bit (Quadword) or 128-bit (Double quadword), as shown in figure {{ref>fundamentaldata}}. Many instructions allow for processing data of these types without special interpretation. It depends on the programming engineer how to interpret the inputs and results of instruction execution. The order of bytes in the data types containing more than a single byte is little-endian. The lower (least significant) byte is stored at the lower address of the data. This address represents the address of the data as a whole. |
| |
| <figure fundamentaldata> | <figure fundamentaldata> |
| {{ :en:multiasm:cs:fundamental_data_types.png?700 |Illustration of fundamental data types}} | {{ :en:multiasm:cs:fundamental_data_types.png?600 |Illustration of fundamental data types}} |
| <caption>Fundamental data types</caption> | <caption>Fundamental data types</caption> |
| </figure> | </figure> |
| |
| <figure packedint128> | <figure packedint128> |
| {{ :en:multiasm:cs:packed_integers_128.png?750 |Illustration of 128-bit packed integer data types}} | {{ :en:multiasm:cs:packed_integers_128.png?600 |Illustration of 128-bit packed integer data types}} |
| <caption>128-bit packed integer data types</caption> | <caption>128-bit packed integer data types</caption> |
| </figure> | </figure> |
| |
| <figure packedint256> | <figure packedint256> |
| {{ :en:multiasm:cs:packed_integers_256.png?800 |Illustration of 256-bit packed integer data types}} | {{ :en:multiasm:cs:packed_integers_256.png?600 |Illustration of 256-bit packed integer data types}} |
| <caption>256-bit packed integer data types</caption> | <caption>256-bit packed integer data types</caption> |
| </figure> | </figure> |
| |
| <figure packedint512> | <figure packedint512> |
| {{ :en:multiasm:cs:packed_integers_512.png?800 |Illustration of 512-bit packed integer data types}} | {{ :en:multiasm:cs:packed_integers_512.png?600 |Illustration of 512-bit packed integer data types}} |
| <caption>512-bit packed integer data types</caption> | <caption>512-bit packed integer data types</caption> |
| </figure> | </figure> |
| |
| <figure floattypes> | <figure floattypes> |
| {{ :en:multiasm:cs:floating_types.png?700 |Illustration of floating point data types}} | {{ :en:multiasm:cs:floating_types.png?600 |Illustration of floating point data types}} |
| <caption>Floating point data types in x64 architecture</caption> | <caption>Floating point data types in x64 architecture</caption> |
| </figure> | </figure> |
| <table tablefloattypes> | <table tablefloattypes> |
| <caption>Floating point data types</caption> | <caption>Floating point data types</caption> |
| ^ Name ^ Bits ^ Mantissa bits ^ Exponent bits ^ Min value ^ Max value ^ | ^ Name ^ Bits ^ Mantissa bits ^ Exponent bits ^ Min value ^ Max value ^ |
| | Double extended | 80 | 64 | 15 | {{ :en:multiasm:cs:float_ep_min.png?105 }} | {{ :en:multiasm:cs:float_ep_max.png?105 }} | | | Double extended | 80 | 64 | 15 | {{:en:multiasm:cs:float_ep_min.png?105 }} | {{:en:multiasm:cs:float_ep_max.png?105 }} | |
| | Double precision | 64 | 52 | 11 | {{ :en:multiasm:cs:float_dp_min.png?100 }} | {{ :en:multiasm:cs:float_dp_max.png?95 }} | | | Double precision | 64 | 52 | 11 | {{:en:multiasm:cs:float_dp_min.png?100 }} | {{:en:multiasm:cs:float_dp_max.png?95 }} | |
| | Single precision | 32 | 23 | 8 | {{ :en:multiasm:cs:float_sp_min.png?100 }} | {{ :en:multiasm:cs:float_sp_max.png?90 }} | | | Single precision | 32 | 23 | 8 | {{:en:multiasm:cs:float_sp_min.png?100 }} | {{:en:multiasm:cs:float_sp_max.png?90 }} | |
| | Half precision | 16 | 10 | 5 | {{ :en:multiasm:cs:float_hp_min.png?90 }} | {{ :en:multiasm:cs:float_hp_max.png?80 }} | | | Half precision | 16 | 10 | 5 | {{:en:multiasm:cs:float_hp_min.png?90 }} | {{:en:multiasm:cs:float_hp_max.png?80 }} | |
| | Brain Float | 16 | 7 | 8 | {{ :en:multiasm:cs:float_bf_min.png?100 }} | {{ :en:multiasm:cs:float_bf_max.png?90 }} | | | Brain Float | 16 | 7 | 8 | {{:en:multiasm:cs:float_bf_min.png?100 }} | {{:en:multiasm:cs:float_bf_max.png?90 }} | |
| </table> | </table> |
| |
| |
| <figure packedfloattypes> | <figure packedfloattypes> |
| {{ :en:multiasm:cs:packed_floats.png?800 |Illustration of packed floating point data types}} | {{ :en:multiasm:cs:packed_floats.png?600 |Illustration of packed floating point data types}} |
| <caption>Packed floating point data types in x64 architecture</caption> | <caption>Packed floating point data types in x64 architecture</caption> |
| </figure> | </figure> |