Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

16 bit c compiler

56 views
Skip to first unread message

joe.da...@gmail.com

unread,
Sep 27, 2009, 7:58:54 AM9/27/09
to
Hi, does anybody here know of a 16 bit c compiler other than bcc for
linux?

- Joe

BGB / cr88192

unread,
Sep 27, 2009, 11:51:04 AM9/27/09
to

<joe.da...@gmail.com> wrote in message
news:9b513a63-7388-4123...@z34g2000vbl.googlegroups.com...

> Hi, does anybody here know of a 16 bit c compiler other than bcc for
> linux?
>

dunno, but at least there is this.

once, I was faced with this problem, and lacking a compiler (this was before
I really had much experience in compiler writing, but all my stuff is 32 and
64 bit), just ended up writing these components in assembler.


> - Joe


Rod Pemberton

unread,
Sep 27, 2009, 3:10:11 PM9/27/09
to
<joe.da...@gmail.com> wrote in message
news:9b513a63-7388-4123...@z34g2000vbl.googlegroups.com...
> Hi, does anybody here know of a 16 bit c compiler other than bcc for
> linux?
>

A good answer?...

dev86 is supposedly an improved version of bcc used for ELKS.
http://homepage.ntlworld.com/robert.debath/

DJ Delorie's "DJGPP 16-bit Toolset" might be ported or workable on Linux.
http://www.delorie.com/djgpp/16bit/

GAS has 16-bit assembly support which also works with GCC's inline assembly.
DJGPP's webpage on the subject:
http://www.delorie.com/gnu/docs/binutils/as_270.html


Ok, now for other 32-bit C compilers for Linux. I just mention these
because some of them are simple enough they could be ported or converted.
But, of course, they are simple C compilers, i.e., have limitations. The
Simple C Compiler appears to have a single array of 32-bit instructions
which should be easy to replace. I'm not sure about adjusting the internal
integer sizes... Small C for I386 (IA-32) was ported to C but was converted
to 32-bits in the process... Most of the changes are trivial, but it also
has some bugs. With some work comparing to older Small C's, you should be
able to convert back to 16-bit.

Small C for I386 (IA-32) - 32-bit port of Ron Cain's Small C to Linux.
http://www.physics.rutgers.edu/~vitchev/smallc-i386.html

Simple C Compiler - 32-bit port of Ron Cain's Small C to Linux
http://retro.tunes.org/simplec/

Tiny C Compiler
http://bellard.org/tcc/

PCC (Portable C Compiler)
http://pcc.ludd.ltu.se/


HTH,


Rod Pemberton

Ali Ghanbari

unread,
Oct 2, 2009, 3:38:47 PM10/2/09
to
On Sep 27, 2:58 pm, "joe.davis...@gmail.com" <joe.davis...@gmail.com>
wrote:

> Hi, does anybody here know of a 16 bit c compiler other than bcc for
> linux?
>
> - Joe

Turbo C 2.0
Turbo C++ 3.0

Luciann Bennet

unread,
Oct 6, 2009, 8:27:30 AM10/6/09
to
On Sep 27, 7:58 am, "joe.davis...@gmail.com" <joe.davis...@gmail.com>
wrote:

> Hi, does anybody here know of a 16 bit c compiler other than bcc for
> linux?
>
> - Joe

Using GAS you can translate your 32 bit C/C++ programs into 16 bit
real mode programs; But the instruction set for the 8086 isn't fully
supported. You'll have to supplement with inline asm. The linux kernel
uses this method for its real mode stuff, like the E820 memory map and
whatnot.

At the top of every C/C++ file which should be output as 16 bit 8086
instructions, add the following directive to AS:

asm volatile(".code16gcc\n\t");

GCC passes all inline ASM directly to GAS. The directive will look to
GAs as if you had written out an ASM file and put the directive there
yourself.

joe.davis512

unread,
Oct 7, 2009, 1:35:39 PM10/7/09
to

Thanks for the help, I think i'll use this option for now

- Joe

0 new messages