logoalt Hacker News

AnimalMuppet • today at 4:48 PM • 2 replies • view on HN

But (almost) every hardware has some integer type that has the same size as what is needed to represent the address space, because (almost) every hardware has some way of manipulating addresses at the assembly level, and (almost) every C implementation has some integer type that generates those assembly instructions.

I say "almost" because I am not absolutely certain that this is true of absolutely every architecture. Feel free to point out one that breaks these rules, if there is one.


Replies

cryptonector • today at 5:08 PM

In principle a pointer can be a tuple of two other things. Think of CHERI, segmented architectures, etc. In practice on current, modern, general purpose, non-embedded platforms' C ABIs pointers are equivalent to unsigned integers of the same size.

Ungh • today at 5:03 PM

Segmented 8086 is always the fun one.

➕ show 1 reply