This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_4 [2025/05/15 11:35] – [Floating point values] ktokarz | en:multiasm:papc:chapter_6_4 [2025/05/18 19:02] (current) – [Pointers] ktokarz | ||
|---|---|---|---|
| Line 66: | Line 66: | ||
| ===== Floating point values ===== | ===== Floating point values ===== | ||
| - | Floating point values store the data encoded for calculation on real numbers. Depending on the precision required for the algorithm, we can use different data sizes. Scalar data types are supported by the FPU (Floating Point Unit), offering single precision, double precision or double extended precision real numbers. In C/C++ compilers, they are referred to as float, double and long double data types, respectively. Vector (packed) floating-point data types can be processed by many SSE and AVX instructions, | + | Floating point values store the data encoded for calculation on real numbers. Depending on the precision required for the algorithm, we can use different data sizes. Scalar data types are supported by the FPU (Floating Point Unit), offering single precision, double precision or double extended precision real numbers. In C/C++ compilers, they are referred to as float, double and long double data types, respectively. Vector (packed) floating-point data types can be processed by many SSE and AVX instructions, |
| <figure floattypes> | <figure floattypes> | ||
| Line 75: | Line 75: | ||
| <table tablefloattypes> | <table tablefloattypes> | ||
| < | < | ||
| - | ^ Name ^ Bits ^ Mantissa | + | ^ Name ^ Bits ^ Mantissa |
| - | | Double extended | + | | Double extended |
| - | | Double precision | + | | Double precision |
| - | | Single precision | + | | Single precision |
| - | | Half precision | + | | Half precision |
| - | | Brain Float | 16 | 7 | + | | Brain Float | 16 | 7 | 8 | {{: |
| </ | </ | ||
| - | Single precision | + | |
| - | Double precision | + | ===== Floating point vector data types ===== |
| - | Double extended | + | Floating point vectors are formed with single or double |
| - | Half precision | + | It is worth mentioning that some instructions operate on a single floating-point value, using only the lowest elements of the operands. |
| - | Brain Float | + | |
| + | <figure packedfloattypes> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | ===== Bit field data type ===== | ||
| + | A bit field is a data type whose size is counted by the number of bits it occupies. The bit field can start at any bit position in the fundamental data type and can be up to 32 bits long. MASM supports it with the RECORD data type. The bit field type is shown in figure {{ref> | ||
| + | |||
| + | <figure bitfieldtype> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Pointers ===== | ||
| + | Pointers store the address of the memory which contains interesting information. They can point to the data or the instruction. If the segmentation is enabled, pointers can be near or far. The far pointer contains the logical address (formed with the segment and offset parts). The near pointer contains the offset only. The offset can be 16, 32 or 64 bits long. The segment selector is always stored as a 16-bit number. Illustration of possible pointer types is shown in figure {{ref> | ||
| + | |||
| + | <figure pointertypes> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | The offset is often the result of complex addressing mode calculations and is called an effective address. | ||
| + | </ | ||