From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Plan9 16bit C compilers From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020218174402.D613419A6E@mail.cse.psu.edu> Date: Mon, 18 Feb 2002 17:43:59 +0000 Topicbox-Message-UUID: 52531162-eaca-11e9-9e20-41e7f4b1d025 The original question from steve.simon@snellwilcox.com was > Are there any 16bit ports of the plan9 C compiler? I've ported (more accurately: retargeted) it for a 16-bit CPU which is embedded in a smartcard. Because registers are 16 bits and I could live within a 64KB address space, I chose to make sizeof(int) = 2, sizeof(int*) = 2, sizeof(long) = 4. This avoided the need to keep pointers in pairs of registers, but required some extra rewriting because the existing compilers have some implicit assumptions that sizeof(register) = sizeof(long) = sizeof(int*). There is also one place in the "machine independent" part of the compiler (/sys/src/cmd/cc/dcl.c:/^contig) which assumes sizeof(long) = sizeof(int*). Nothing else in cc needed to be touched. -- Richard