![]() |
| | #1 |
| Registered User Join Date: Feb 2009
Posts: 278
| Which Compiler? Oh, and the compiler needs to be free too :P Thanks in advance |
| Bladactania is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Unfortunately, if all you have is DOS, then you are stuck with 16-bit compilers, and whilst Turbo C is not great (and in particular, it is not MODERN), it is still one of the few easily available DOS compilers. Doubt you will find something MUCH better. Microsoft Visual C 1.52 used to be another 16-bit compiler. Don't know if it's available anywhere. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Registered User Join Date: Feb 2009
Posts: 278
| That is what I was afraid of... |
| Bladactania is offline | |
| | #4 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Of course, if you are not using too much "DOS stuff" (or the "DOS stuff" is isolated enough), you could always compile the whole project for Windows in a modern compiler, and then recompile it only when you have it working for the target system. This doesn't work if you are using special hardware on the SBC, of course. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #5 |
| and the hat of sweating Join Date: Aug 2007 Location: Toronto, ON
Posts: 3,120
| Aren't there any 16-bit versions of gcc around?
__________________ "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008 |
| cpjust is offline | |
| | #6 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Not that I'm aware of. For Xen, which needs a BIOS built to do hardware supported virtual machines, we used bcc (which is NOT the Borland compiler) to compile the BIOS code. But for a DOS type environment, Turbo C is probably better. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #7 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,381
| You can use GCC to build 16-bit code, but it's hacky. Insert this at the very beginning of the .c file (outside of all functions, and before anything else): Code: __asm__(".code16");
EDIT: Of course, gas is going to produce ELF output unless you're running a weird version of gas. This ELF will have to be massaged into a flat binary: Code: gcc -c foo.c ld -o foo foo.o objcopy -O bin foo foo.bin
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot Last edited by brewbuck; 02-10-2009 at 06:31 PM. |
| brewbuck is offline | |
| | #8 |
| Registered User Join Date: Feb 2009
Posts: 278
| What is the newest version of Turbo C that would work for me? |
| Bladactania is offline | |
| | #10 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
| > Maybe you could try this this is a command line compiler. It's Borland C++ compiler 5.5 But it doesn't produce 16-bit executables. These also generate 16-bit DOS code http://www.openwatcom.org/index.php/Main_Page http://www.digitalmars.com/ DJGPP generates 32-bit DOS code, but you would also need a DOS extender running as well to support that.
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline | |
| | #11 |
| Registered User Join Date: Sep 2006
Posts: 2,509
| I'm no expert on Turbo C, but I have used it (as Turbo C/C++ ver. 1.01), quite a bit, and still do, sometimes. I've been told that Turbo C ver 2.n (not the same as Turbo C/C++), was buggy, and to avoid it. Turbo C/C++ on the other hand, is fine. You'll want to set it up to compile your *.c programs, with the C compiler, rather than the C++ one. (it's a simple option you choose in the IDE). I like ver. 1.01 of Turbo C/C++. Oddly, it's newer than Turbo C ver. 2.n, I've been told. It's available at the Borland legacy site, google for the url. If your console screen buffers are too small, you'll only get a 1/2 size of the IDE window, which is horrid. Once you set up the screen buffers, and make your properties for the shortcut to it that you'll want, show full screen, then you'll be fine. |
| Adak is online now | |
![]() |
| Tags |
| compiler |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiler Paths... | Cobra | C++ Programming | 5 | 09-26-2006 04:04 AM |
| C Compiler and stuff | pal1ndr0me | C Programming | 10 | 07-21-2006 11:07 AM |
| I can't get this new compiler to work. | Loduwijk | C++ Programming | 7 | 03-29-2006 06:42 AM |
| how to call a compiler? | castlelight | C Programming | 3 | 11-22-2005 11:28 AM |
| Bad code or bad compiler? | musayume | C Programming | 3 | 10-22-2001 09:08 PM |