Data pointers
In this section:
The size of data pointers is always 16 or 24 bits. These data pointers are available:
Keyword | Pointer size | Address range | Description |
|---|---|---|---|
2 bytes |
| The highest 64 Kbytes. | |
3 bytes* |
| Entire 1 Mbyte address area. | |
3 bytes* |
| Entire 1 Mbyte address area. Used for objects larger than 64 Kbytes. |
Table 79. Data pointers
* Because of alignment restrictions, 3-byte pointers take up 4 bytes in memory.
Segmented data pointer comparison
Note that the result of using relational operators (<, <=, >, >=) on data pointers is only defined if the pointers point into the same object. For segmented data pointers, only the offset part of the pointer is compared when using these operators. For example:
void MyFunc(char __far * p, char __far * q)
{
if (p == q) /* Compares the entire pointers. */
...
if (p < q) /* Compares only the low 16 bits of the pointers. */
...
}