C & undefined behaviour - was Re: tumble under BSD
me at xenu.pl
Sat Apr 2 23:19:37 CDT 2016
On Sat, 2 Apr 2016 18:58:10 -0400 (EDT)
Mouse <mouse at Rodents-Montreal.ORG> wrote:
> He's assuming the "the entire address space is a single
> array of bytes (perhaps with holes)" memory model is the only possible
> one. He needs to talk with someone who wrote large-model 8086 code -
> or someone who's used the Lisp Machine C compiler I heard of that
> represents pointers as <array,index> pairs
Indeed, intel segmented memory model was weird. Near pointers were
uncomparable between the segments, but it wasn't that unintuitive.
Far pointers were insanity-inducing, though. Since there were multiple
ways to represent the same address as a far pointer, there was completely
no point in doing any comparisons (unless you normalized them, of course).
Thankfully, huge pointers behaved exactly as one would expect, i.e. just
like pointers work in the protected mode.
More information about the cctalk