PDA

View Full Version : C Compiler for IBM 5150/5160



Jtterbug
September 13th, 2013, 01:05 PM
Hello everyone.

I couldn't very well find the answer to my question elsewhere, but I was wondering if anyone knew of a free C compiler for MS DOS and IBM compatible machines. Visual C++ only goes to 16 bits, I've read, and I'm not sure about the Turbo's or OpenWatcom.

If anyone knows if these are compatible, or if there's a better program to use, I'd very much like some guidance on where to go.

Thank you

dorkbert
September 13th, 2013, 01:25 PM
Turbo C is freely available, and works on 8088. Otherwise you'll need to find Microsoft C (not to be confused with Visual C++)

Chuck(G)
September 13th, 2013, 02:11 PM
Do you intend the compiler to run on a 5160, or does that matter?

krebizfan
September 13th, 2013, 05:00 PM
OpenWatcom needs at least a 386 with 8 MB to run but will target early PCs fine.

Turbo C 2.01 is a bit large to run on a floppy only 5150; designed around hard disks so trimming to a floppy setup is a pain. The debugger needs a 80386.

I think a few very old compilers were turned into freeware but I can't find a live link to any and the ones I remember were limited back when active development was being done in the 80s.

For most uses, Turbo C or its MS direct competitor QuickC are optimum. QuickC isn't free but so many copies were printed that they tend to really cheap. OpenWatcom would be better for commercial grade DOS programming.

mbbrutman
September 13th, 2013, 06:13 PM
Those are 16 bit machines ...

I write in C for 8088 class machines but I don't compile on them. I use newer machines for that - a good compiler can be a resource hog. Try the Turbo series from Borland or Open Watcom ( my current favorite ).

Jtterbug
September 13th, 2013, 10:05 PM
Thank you all for your help!


Chuck(G)


Do you intend the compiler to run on a 5160, or does that matter?

No, I do not intend the compiler to run on the 5160; The IBM is just the target machine.

I don't know if that changes much.



Thanks again in advance.

Chuck(G)
September 13th, 2013, 10:44 PM
I think it does change things a bit--you can use later versions of the more advanced compilers. For example, there's Hi Tech Pacific C (http://www.freedos.org/software/?prog=pacific-c), There were many (other than Watcom, Microsoft, Borland) C compilers, but you may have problems finding them, such as Lattice, BDS, Whitesmith or Topspeed. Digital Mars (http://www.digitalmars.com/download/freecompiler.html) has released their C for free downloading--the product used to be called Zortech C.

Power C (http://www.mixsoftware.com/product/powerc.htm) is still around--while not free, it's cheap.

If you want a real blast from the past, De Smet C apparently is still available (http://www.desmet-c.com/). It's based on PCC and so produces an assembly source as output, which is then assembled separately.

Hope this helps.

Jtterbug
September 14th, 2013, 11:29 AM
Just to recap, Open Watcom can compile programs for the machines as targets. I should like to verify this because so far, the other programs suggested won't run on my version of Windows.

Thank you all, this has made things much easier.

mbbrutman
September 14th, 2013, 11:40 AM
Open Watcom runs on Win32 (XP), Linux and DOS (386+). I think OS/2 is in there too. Any of the versions can cross compile for any of the other targets.

When I develop mTCP I use Open Watcom running natively on Windows XP. For editing I use VI - you can use the editor of your choice, probably as long as it does not save in Unicode. ;-0 For compiling I script everything using a Unix like shell (BASH under Cygwin) and Open Watcom makefiles.

Moving to this environment from Turbo C++ 3.0 for DOS on a 386 made me *far* more productive than using the IDE on that machine. I like having multiple windows open. I can also test and debug by running the programs in DOSBox, or copying them to a virtual machine running FreeDOS or MS-DOS.

Open Watcom can introduce some code bloat compared to Turbo C++, usually due to extra libraries. But it generates far better code.

billdeg
September 20th, 2013, 05:33 PM
most of my C era stuff was written and compiled on the same 286-386 class machine the code was run upon. I don't even remember what version I used. I have a collection of C compilers I am sure I can find something that will run on a 5150 with 640K RAM if you want to develop and run on the same box. It would take a while I bet compile a large program, but simple math stuff no problem.

sergey
September 20th, 2013, 10:29 PM
+1 for Open Watcom... It is free / open source, currently supported, runs on multiple OSes. I used it for SBC-188 BIOS and it was a pleasant experience. Pay attention to Watcom's parameter passing conventions though if you plan to interface it with assembly... it is different from Borland or Microsoft one...

Trixter
September 21st, 2013, 08:35 AM
Dave Dunfield's Micro-C is still available (it's what Imagedisk was written in). You can get it from http://www.classiccmp.org/dunfield/dos/index.htm (search for "Micro-C" on the page). It is a very nice little system, with the documentation even containing a small introduction to the C language itself. If you want to code on the target hardware, you could do worse.