VOGONS


Development on a 286, for a 286

Topic actions

First post, by keenmaster486

User metadata
Rank l33t
Rank
l33t

I'm interested in getting into real mode 16-bit DOS development, for 8088/8086/286 platforms, with everything done natively on those platforms i.e. no cross-compilation. Not that I have anything against cross-compilation, but I want to get the experience of developing on those old systems.

So far in my research I have found OpenWatcom, which seems to be the latest thing that targets 16-bit DOS.

But here is what I'm looking for:

  • C (or C++) language (probably with support for inline assembly)
  • Good documentation
  • Compiles for real mode 16 bit DOS without adding bloat, produces fast, efficient, and compatible executables
  • Good IDE for DOS available
  • Doesn't take more than several seconds to compile on an 8088/286/386 (is this realistic?)

Can anyone tell me whether OpenWatcom is the tool that best fits these criteria, or whether something else such as Borland Turbo C would serve me better?

I have trouble finding good IDEs for DOS. I prefer minimalist style, as in "just the text editor and file tree, please" but I don't know if that's something that existed for DOS.

World's foremost 486 enjoyer.

Reply 2 of 43, by Scali

User metadata
Rank l33t
Rank
l33t

In short, OpenWatcom doesn't run on a 286. It does have a DOS environment, but it requires a 386 or better.
It can cross-compile to 8086 and 286 though (I've used it for 8088 MPH and some other 16-bit DOS demos).

Borland Turbo C will actually run on a 286. It's incredibly slow though. Compiling any non-trivial bit of code will likely take minutes on a 286 (the main reason why Turbo Pascal was so popular in those days was that it was extremely fast at compiling code).
OpenWatcom generates far smaller and more efficient code though. But if you put in enough inline assembly, that might not matter to you.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 3 of 43, by Jo22

User metadata
Rank l33t++
Rank
l33t++
keenmaster486 wrote:
. […]
Show full quote
  • C (or C++) language (probably with support for inline assembly)
  • Good documentation
  • Compiles for real mode 16 bit DOS without adding bloat, produces fast, efficient, and compatible executables
  • Doesn't take more than several seconds to compile on an 8088/286/386 (is this realistic?)

.

Well, not exactly what you're looking for, but..
There used to be Mix Power C. My father used it many, many years ago.
It created small code for 8086, 80186, 80286 and had got support for several memory models.

In the 90s, I used it to learn a bit of C. And by that I mean pure C, K&R C.
Not that weird ANSI stuff that took out the fun. 😀

Edit: Just remembered that Power C is part of one of my earlier videos.
The compiling of a rather complex project on a 4,77MHz XT is visible at https://youtu.be/KE648YNe2Ag?t=691
By comparison, on an 80286-16 or -25, this task would have been a matter of seconds..

Last edited by Jo22 on 2019-03-06, 19:42. Edited 1 time in total.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 5 of 43, by brostenen

User metadata
Rank l33t++
Rank
l33t++
keenmaster486 wrote:
I'm interested in getting into real mode 16-bit DOS development, for 8088/8086/286 platforms, with everything done natively on t […]
Show full quote

I'm interested in getting into real mode 16-bit DOS development, for 8088/8086/286 platforms, with everything done natively on those platforms i.e. no cross-compilation. Not that I have anything against cross-compilation, but I want to get the experience of developing on those old systems.

So far in my research I have found OpenWatcom, which seems to be the latest thing that targets 16-bit DOS.

But here is what I'm looking for:

  • C (or C++) language (probably with support for inline assembly)
  • Good documentation
  • Compiles for real mode 16 bit DOS without adding bloat, produces fast, efficient, and compatible executables
  • Good IDE for DOS available
  • Doesn't take more than several seconds to compile on an 8088/286/386 (is this realistic?)

Can anyone tell me whether OpenWatcom is the tool that best fits these criteria, or whether something else such as Borland Turbo C would serve me better?

I have trouble finding good IDEs for DOS. I prefer minimalist style, as in "just the text editor and file tree, please" but I don't know if that's something that existed for DOS.

How about diving into assembler? There were 8086/88 specific assembler tools, and there might have been for 80286 as well. I know of a site on were you can find old abandonware. Though technically it is still piracy, so I am not really sure if I can post a link here.

Don't eat stuff off a 15 year old never cleaned cpu cooler.
Those cakes make you sick....

My blog: http://to9xct.blogspot.dk
My YouTube: https://www.youtube.com/user/brostenen

001100 010010 011110 100001 101101 110011

Reply 6 of 43, by Scali

User metadata
Rank l33t
Rank
l33t
brostenen wrote:

How about diving into assembler? There were 8086/88 specific assembler tools, and there might have been for 80286 as well. I know of a site on were you can find old abandonware. Though technically it is still piracy, so I am not really sure if I can post a link here.

Borland released the old Turbo C++, Turbo Pascal and Turbo Assembler (TASM) into the public domain years ago.
So at the very least you could use TASM freely, older versions work on 8088 and 286, and those were the tools that people actually used back in the day.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 7 of 43, by brostenen

User metadata
Rank l33t++
Rank
l33t++
Scali wrote:
brostenen wrote:

How about diving into assembler? There were 8086/88 specific assembler tools, and there might have been for 80286 as well. I know of a site on were you can find old abandonware. Though technically it is still piracy, so I am not really sure if I can post a link here.

Borland released the old Turbo C++, Turbo Pascal and Turbo Assembler (TASM) into the public domain years ago.
So at the very least you could use TASM freely, older versions work on 8088 and 286, and those were the tools that people actually used back in the day.

Yup... I had to learn x86 assembler, Turbo Pascal and C languages, back in 1995 at the school. I was too young, and I had extreme issue concentrating back then. And whenever I tried to listen and concentrate in school, I fell asleep. Yet I clearly remember that we had to program in those 3 languages, using MS-Dos based tools. And yeah.... We had to look up chips, CPU's and so on, in order to do assembly, and program directly to the hardware. Well.... At least I spend 70% of the school day getting my rest, because it was only when everyone else slept at night, it was quiet enough for me to be able to do my homework. 🤣

Don't eat stuff off a 15 year old never cleaned cpu cooler.
Those cakes make you sick....

My blog: http://to9xct.blogspot.dk
My YouTube: https://www.youtube.com/user/brostenen

001100 010010 011110 100001 101101 110011

Reply 8 of 43, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Thanks for the tips!

Maybe my last criterion of not compiling very slowly cannot be met on a 286. Perhaps I'm better off developing on a late DOS machine and testing on the 286.

World's foremost 486 enjoyer.

Reply 9 of 43, by Scali

User metadata
Rank l33t
Rank
l33t
keenmaster486 wrote:

Maybe my last criterion of not compiling very slowly cannot be met on a 286. Perhaps I'm better off developing on a late DOS machine and testing on the 286.

Yes, compiling C/C++ code is inherently a CPU- and memory-intensive process. Even on my 486DX2-80, Turbo C++ is still quite slow.
Compile-and-run just wasn't a thing in the DOS age.
If you want the full DOS experience I suppose you could go for a late DOS machine (Pentium or PII?) and run OpenWatcom on that in a 32-bit DOS extender environment.
I personally use the WinNT variation of OpenWatcom under Windows 10, to compile 8088 code. I then test it in DOSBox, and eventually move to real hardware.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 10 of 43, by noshutdown

User metadata
Rank Oldbie
Rank
Oldbie

indeed there are less options on 286. as already mentioned, djgpp and openwatcom won't work, older version of watcom shall work though.
i think the options are:
borland c++ 3.1
microsoft c++ 7
zortech c++/symantec c++(seems pretty rare, i have yet to find)
older version of watcom(not sure which version is latested to support 286)

Reply 11 of 43, by Damaniel

User metadata
Rank Newbie
Rank
Newbie

If I was going to code on real hardware, I'd probably use something period-specific like Turbo/Borland C++. Those are real mode applications that generate real mode code and were designed around the time that the 286 was a mainstream CPU.

Personally, I'd avoid doing the work directly on a 286 since they're so slow, but if you have a decent 386 or even 486 then compile times will be much more bearable. I do most of my work (when not cheating and using DosBox) on my 486 - it's got the right balance of speed and real/protected mode support to support building code for everything down to an 8088 (and Turbo Pascal code compiles lightning quick on it).

Reply 12 of 43, by Scali

User metadata
Rank l33t
Rank
l33t

Lattice C and Aztec C are two early brands of C available for DOS.
Lattice C was licened by Microsoft for their versions of C/C++. Microsoft kept using the Lattice-based compilers up to and including Visual C++ 6.0. Visual Studio.NET was the first to include a C/C++ compiler entirely written by Microsoft.
Aztec C can be found here: http://www.aztecmuseum.ca/compilers.htm#msdos
Lattice C is here: WinWorldPC
And Microsoft C here: WinWorldPC
PowerC is here: WinWorldPC

Last edited by Stiletto on 2020-03-02, 07:28. Edited 1 time in total.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 13 of 43, by Hamby

User metadata
Rank Member
Rank
Member
Scali wrote:
Lattice C and Aztec C are two early brands of C available for DOS. Lattice C was licened by Microsoft for their versions of C/C+ […]
Show full quote

Lattice C and Aztec C are two early brands of C available for DOS.
Lattice C was licened by Microsoft for their versions of C/C++. Microsoft kept using the Lattice-based compilers up to and including Visual C++ 6.0. Visual Studio.NET was the first to include a C/C++ compiler entirely written by Microsoft.
Aztec C can be found here: http://www.aztecmuseum.ca/compilers.htm#msdos
Lattice C is here: WinWorldPC
And Microsoft C here: WinWorldPC
PowerC is here: WinWorldPC

I remember when I was developing for the Amiga, the two main C-compiler competitors were Lattice and Aztec. I went with Aztec at the time.
Thanks for providing these links; I may see what the development environments for DOS looked like.

The Aztec C has versions supporting CPM/86 and rommable code... interesting...

Last edited by Stiletto on 2020-03-02, 07:28. Edited 1 time in total.

Reply 14 of 43, by Scali

User metadata
Rank l33t
Rank
l33t
Hamby wrote:

I remember when I was developing for the Amiga, the two main C-compiler competitors were Lattice and Aztec.

Yea, I still use SAS/C on Amiga, which is Lattice, after they changed the name (Lattice was bought by SAS Institute in 1987).
Funny enough some of the 'quirks' of SAS/C are also present in VC++ 6.0.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 15 of 43, by Scali

User metadata
Rank l33t
Rank
l33t

Here's an interesting article that compares 9 early C compilers for DOS:
https://archive.org/stream/byte-magazine-1983 … e/n135/mode/2up

Lattice is considered the best. And the other 8 compilers are ones that weren't mentioned before.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 16 of 43, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Wow, this is a lot of great information! Thanks guys!

Part of the reason I asked this question is because I have an interesting 286 machine coming in the mail soon. I'll be doing research on what compiler I'll try.

I have also found Microsoft Quick C, which I am very tempted to use because I very much like the IDE. Having grown up using Quick Basic, it's intuitive for me. But I am a little wary of it; I wonder whether Quick C produces as terrible executables as Quick Basic does.

World's foremost 486 enjoyer.

Reply 17 of 43, by .legaCy

User metadata
Rank Oldbie
Rank
Oldbie
brostenen wrote:

Yup... I had to learn x86 assembler, Turbo Pascal and C languages, back in 1995 at the school.

I wish that was my case, i had to learn by myself with 12 years, but i didn't dived right into asm and c, i firstly did stuff using dBase(cause thats is what my dad made living of, then he teached me basic stuff), then i went to pascal(and then object pascal, a.k.a. Delphi, and i still to this day use Object Pascal(Delphi), including professionally, people often make jokes, but i code for linux,windows,mac os, android and iOS with delphi, and native code.
After all i learned C by myself, college only served to teach me the right methodology to apply on projects, and to be honest it isn't a big deal.

Reply 18 of 43, by noshutdown

User metadata
Rank Oldbie
Rank
Oldbie
keenmaster486 wrote:

Wow, this is a lot of great information! Thanks guys!

Part of the reason I asked this question is because I have an interesting 286 machine coming in the mail soon. I'll be doing research on what compiler I'll try.

I have also found Microsoft Quick C, which I am very tempted to use because I very much like the IDE. Having grown up using Quick Basic, it's intuitive for me. But I am a little wary of it; I wonder whether Quick C produces as terrible executables as Quick Basic does.

i also used quickbasic a lot when i was young, but didn't know much about dos executables, how terrible is it?
borland c was the dominant c product at around 1990, and microsoft c was considered inferior for a long time until 7.0 when it finally became comparable. however i just became extremely bored with borlandc.
and if you want fastest executables, maybe you can try older versions of watcom which should work on 286, beware its a barebone compiler without any ide.

Reply 19 of 43, by bakemono

User metadata
Rank Oldbie
Rank
Oldbie

I always thought the biggest problems with QuickBASIC were the dumb things like poor file I/O functions and lack of unsigned integer support. (If you tried to use an integer as a pointer you would get an overflow error whenever it went above 32767. But that was only when you executed the program within the IDE, if you made an EXE it would run without the error). Inline asm would have been nice too. (All fixed in FreeBASIC but it requires 32/64-bit)

Without those sort of issues maybe Quick C isn't bad for a 286.

again another retro game on itch: https://90soft90.itch.io/shmup-salad