Out of range pointers

Henry Spencer henry at utzoo.uucp
Sun Sep 25 07:27:09 AEST 1988


In article <225800073 at uxe.cso.uiuc.edu> mcdonald at uxe.cso.uiuc.edu writes:
>I don't understand this. I can understand that on certain wacko
>architectures that computing it IN A SEGMENT REGISTER would cause
>a problem. But why not do the computation in an ordinary 
>arithmetic register, presumably by casting to an integer type?

For one reason, on machines with notions of data type at the hardware
level, this may be illegal.  For another reason, pointer arithmetic
may be seriously unorthodox, to the point where doing it using integers
may be much more expensive than using the segment registers.  (One
obvious way this can happen -- it almost did happen on the 68000 --
is that a pointer might not fit in an integer register.)
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list