Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: IsUnsigned() function? Message-ID: <1990Jul31.182252.20162@zoo.toronto.edu> Organization: U of Toronto Zoology References: <1990Jul27.161339.14712@kfw.COM> <8118@ncar.ucar.edu> <1990Jul30.162449.19240@kfw.COM> <17181@haddock.ima.isc.com> Date: Tue, 31 Jul 90 18:22:52 GMT In article <17181@haddock.ima.isc.com> karl@kelp.ima.isc.com (Karl Heuer) writes: >>Side note: can anyone out there give a good explanation as to why >>chars were *ever* signed in the first place, > >The pdp11's byte-to-word instruction did sign extension, so it was cheaper to >have chars be signed... I've heard Dennis express some doubts about this decision in retrospect, but it was a sensible thing to do at the time. The cost penalty for doing unsigned chars on the 11 is fairly high unless you do enough optimization to discover that the expression in question ignores the high bits anyway (e.g. by assigning the value to another char variable). -- The 486 is to a modern CPU as a Jules | Henry Spencer at U of Toronto Zoology Verne reprint is to a modern SF novel. | henry@zoo.toronto.edu utzoo!henry