MS-DOS Programming (in C)
=========================
I sometimes use my MS-DOS laptop (the PSION MC600) for some
semi-serious tasks. For example, at work we have a project related to
chloride ingress in reinforced concrete. This is a complicated task but
there are also approximate solutions which use relatively simple
formulas. We are using one such approximate solution for some purposes.
There has been a simple C program which for the above mentioned
solution. Nothing special: it reads few numbers, uses some formulas and
then produces some textual output. The same thing can be done with a
spreadsheet and/or software like GNU Octave (or Matlab). The reason to
write the C code was need to use it as a plug-in for our probabilistic
software.
Well, most of these information are not important. But I wanted to test
the program (better said: to play with various inputs) and for this
task there should be no need for powerful computer. So I have started
to compile the code for my MC600 (that is, for the MS-DOS 3.3 on the
8086 CPU).
The POWER C is an ANSI89-compatible compiler, and a strict one. I was
surprised how GNU-isms we have in our code. There were things like
declarations inside procedures or stiff like (30/12) in declarations of
variables (among other things). So I had to fix these things. After
that it was possible to compile the program.
The POWER C produces relatively big executables. The - so called - disk
space on the MC600 is very limited (I have the 1 MB PSION SSD disk
here). So I often use the LZEXE [2] to compress the executables. It is
a very handy tool by Fabrice Bellard (yes, that person who wrote the
QEMU).
After all these steps the program actually runs. And it runs without
problems (even the results are correct)!
References:
[1] http://www.mixsoftware.com/product/powerc.htm
[2] https://bellard.org/lzexe.html