3 ms·
Say, you run on 8051. What should the comparison result be for idata pointer with value 4, and xdata pointer 4? What about kernels (Linux, Windows — doesn't ma
by vardump 9y ago
Say, you run on 8051. What should the comparison result be for idata pointer with value 4, and xdata pointer 4?
What about kernels (Linux, Windows — doesn't matter)... how do you compare physical address pointer with virtual address pointer?
Sure, they have values. But that might not mean much. Pointers can point to entirely different address spaces.
- ajross 9y agoExactly. The behavior of the actual machine matters! The C language standard defines (pretty imperfectly in the case of processors with multiple address spaces like the 8051 scratchpad RAM) something like a least common denominator you can rely on to "write portable C". But that's not truth, nor is "portable C" the goal to all engineering efforts. Pointers are numbers. Scratchpad registers can't have pointers taken to them. Those are truths, even if inconvenient.