best 16bit C compiler

Programming, for all ages and all languages.
Post Reply
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

best 16bit C compiler

Post by FlashBurn »

I´m looking for a good (better the best) 16bit C compiler for writing a bootloader (2nd stage). I have somewhere an old version of turbo c++, but I think there are newer ones, maybe also free? I also thought about writing it in pascal. I still didn´t manage to look at fpc, is it possible to produce 16bit code and how good does it optimize.

A nice features would be good optimizing. At the moment I´m writing the bootloader in asm, but as I have a 3rd stage which I would like to get into the 2nd stage I like to change the language to C.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: best 16bit C compiler

Post by 01000101 »

I think borland C++ does it and GCC can do it with some researching. I have a few experimental C bootloaders written in GCC C.
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

Re: best 16bit C compiler

Post by FlashBurn »

Ok, but maybe you can tell where to look what I have to do, to get gcc to outbut 16bit code.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: best 16bit C compiler

Post by 01000101 »

I'm really short on time right now, I'll post more help links later, but here's a thread that I started about it a while ago:
http://forum.osdev.org/viewtopic.php?f=1&t=17618
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: best 16bit C compiler

Post by Combuster »

I would use GCC+binutils, because I know how it can be done. I don't know how (or even if) it can be done with Turbo C.

If you really want a 16 bit compiler, use bcc (famous for being used for bochs' bios)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: best 16bit C compiler

Post by Ready4Dis »

Umm... bcc == borland c compiler. Which was the best C compiler of it's time (16-bit dos) and can be used for real-mode programming. It even gives you different memory modes to work with depending on how you're OS is setup, one may be better than another (or worse, if it relies on things like extended memory managers). Just do some reading, and you'll be fine. I have not used gcc for 16-bit, my OS stays in 16-bit just long enough to enable a20, get memory map, and load my kernel image, then switches to 32-bit (no need for c code, since code to load disk image is pretty simplistic in my boot loader). Anyways, I used Turbo C/C++ a lot when Dos was in (I even still use it today to make things like disk management tools that I can run under dos, for example, I used it to write my master bootsector writing program, so I could write my MBR out to disk under Dos, formating drives, etc). Pretty neat, mostly featured, and a nice text based UI. There are free versions available, I think Turbo C 2.0 is free, I used Turbo C/C++ 3.0, I think the latest version was 3.1.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: best 16bit C compiler

Post by AndrewAPrice »

I'm sure GCC could do it aswell, since GCC targets many exotic architectures. I don't know if 16-bit would be an extension of x86 or it's own architecture entirely.
My OS is Perception.
froggey
Member
Member
Posts: 38
Joined: Tue Oct 17, 2006 10:21 pm
Location: Hampshire, UK

Re: best 16bit C compiler

Post by froggey »

bcc can also refer to Bruce Evans' C Compiler, another 16-bit C compiler. Part of the Dev86 package
Post Reply