Untyped pointers have no declared explicit memory type. They may point to any memory area on the 8051. These pointers are stored using 3 bytes (24 bits). The first byte contains a value that indicates the memory area or memory type. The remaining two bytes contain the address offset with the high-order byte first. The following memory format is used:
Address |
+0 |
+1 |
+2 |
Contents |
Memory
Type |
Offset |
Offset |
The memory type byte may have one of the following values:
|
|
|
|
data |
|
Value |
1 |
2 |
3 |
4 |
5 |
Use of any other memory type values may lead to unpredictable program behavior.
The following example shows the memory storage of an untyped pointer that references address 0x1234 in the xdata memory area.
Address |
+0 |
+1 |
+2 |
Contents |
0x02 |
0x12 |
0x34 |