3 ms·
> A pointer is literally a stored memory address, i.e. an integer. This is not correct in general. In x86 real mode, addresses consist of a segment and an offs
by adwn 8y ago
> A pointer is literally a stored memory address, i.e. an integer.
This is not correct in general. In x86 real mode, addresses consist of a segment and an offset. The linear address is computed as segment * 16 + offset. This is very different from a single integer, and even somewhat different from a pair of integers: Two different segment/offset-pairs can refer to the same linear address, so a pointer comparison has to behave differently than an integer-pair comparison.
- raverbashing 8y agoYou're not wrong, but the segment/offset model is such a farce it's not even worth using as an example (also you would have had to distinguish between far and near pointers) At the processor level, pointers are distinguished either by the type of register or by the type of operation used on them (when they're more orthogonal, still there are "pointer only" registers like stack, ip, etc)