On 04/12/2018 09:55 AM, Toby Thain via cctalk wrote: > On 2018-04-12 7:48 AM, Bill Gunshannon via cctalk wrote: >> >> On 04/12/2018 02:45 AM, Chuck Guzis via cctalk wrote: >>> On 04/11/2018 06:38 PM, Chuck Guzis via cctalk wrote: >>>> On 04/11/2018 02:48 PM, ben via cctalk wrote: >>>> >>>>> I have a nice 18 bit cpu here, with only a few hardware bugs. >>>>> Hmm would it work better if I change that around ideas. >>>>> >>>>> Care to point to a nice 18 bit version of unix or C. >>>>> BTW The cpu has a frame pointer S but no S++ --S operations >>>>> so pushing and popping wild data is not a option. >>>> Well, the Univac 1100/2200 series mainframes ran V7 Unix--and they're >>>> 36-bit machines, so probably not far from your 18-bitter--and they're >>>> ones' complement machines. >>>> >>>> Univac called it "SX1100", so you have a search term. >>> Remarkably, Unisys keeps a lot of old documentation around. Here's the >>> reference manual for their "C" on th 1100: >>> >>> https://public.support.unisys.com/2200/docs/cp14.0/pdf/78310422-011.pdf >>> >>> Looks pretty much like standard C until you get into the minutiae, such >>> as "A character constant is 1 to 4 characters" ... > Apple also used this extension in their Mac C compilers. > >>> (9 bit characters and 36 bit ints and 18 bit short ints). >>> >>> So, it should be pretty straightforward unless you assume that a char is >>> 8 bits, with a signed char having a range of +/-255. >>> >> Signed 8 bits would be -128 to +127. > Yes, but Chuck was describing the Univac, where char is a 9-bit type, > and a signed char is 1 sign bit and 8 magnitude bits, giving +/- 255. > I'm familiar with Univac's having worked on the 1100 many moons ago, But look at the line above my comment: "you assume that a char is 8 bits, with a signed char having a range of +/-255".
An 8 bit signed char has the values -128 to +127, as I stated. even a 9 bit signed char would not be +/-255 but -256 to +255. bill