HP Forums

Full Version: HP 200 LX 2MB and Borland Turbo C 2.01
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Questions have been asked about the HP 95/100/200LX family earlier on, so here we go.

I have finallly managed to install Turbo C on my HP 200 LX. And it works. Well, almost, since the memory runs out when truing to compile the tiniest little program.

#include <stdio.h>
main()
{
printf("Hello HP 200LX!");
return 0;
}

The compiler acceppted the code but ran out of RAM. I just had some 20KB free RAM indicated initially but things went sour at some 10KB indicated. (The compiler shows the RAM status during compilation.)
I tried these variants in order to get it running.
A. TC via File Manager.
B. TC from DOS 5.0 prompt.
C. TCC as A above.
D. TCC as B above.

All variants gave the same result. I fiddeled with the RAM setup, and was able to run from DOS prompt when the DOS portion of system RAM was about 400 KB.

My two questions are:
1. Have anyone ever gotten to the point of compiling "anything" with the Turbo C on a HP 200 LX?
2. If so, I would much appreciate a clue or perhaps an answer to my little mystery.

Regards,
Matti Sweden
Have you tried it without the stdio.h?
First, what does "mem" show for free memory prior to launching TurboC? You might need to close System Manager entirely if you want to use the IDE (More, Menu, Application, Terminate All). You might be able to squeeze out just enough to use it under System Manager if you configure DOS to run with all available memory. The default "DOS" icon in More will only give you as much as you've specified in Setup/System/Advanced (probably 64-96 KB or so).

You can create additional "DOS" icons in More that allocate different amounts of memory. Simply create a new icon, and set the program path to "D:\DOS\COMMAND.COM|", with the pipe (shift+backslash) character at the end. This will give you a DOS icon that grabs all available RAM (probably around 400 KB if nothing is running). If you want to be a bit more conservative, put a desired number of KB after the pipe character, e.g. "|256" to reserve 256 KB for DOS programs.

I have "DOS (All Mem)" and "DOS (256 KB)" icons on mine, the former grabbing whatever RAM is leftover depending on what else I've got running, and the latter targeting 256 KB.

On a slightly related note, I'd suggest taking a look at Turbo Pascal 5.5. The IDE runs great on the palmtop, and the language, libraries, and surviving documentation are more suitable for developing on old DOS machines these days.
Thanks for the fast reply.
I do not really remember the details. However I´ll try to find the mentioned software.

Regards,
Matti
(02-04-2019 05:06 PM)KeithB Wrote: [ -> ]Have you tried it without the stdio.h?

stdio.h contains the prototype for printf() so you'll find it difficult compiling that!

This said, you could try omitting it but providing a prototype yourself. Something like this (untested):

Code:
int printf(char*);

int main()
{
  printf("Hello HP 200LX!");
  return 0;
}
I should have been a bit more clear.

stdio.h might include a lot of baggage that uses a lot of memory. Try an even simpler program:

int main()
{
return 0;
}
printf() has a lot of baggage you don't need. Try puts()
The 200LX has the full 640KB of RAM available to DOS so there is no reason why it shouldn't be able to compile such a simple C program if contemporary PCs of the time could.

Try exiting File Manager completely (Menu -> Application -> Terminate All) and try compiling from the DOS command line.

Make sure you have a reasonable amount of space available on the C: drive - the compiler will need to create temporary files.
FYI, the 200LX has a 80186 processor, which mean that it does not support high memory (himem) but do support the expanded memory (EMS).
This memory, activated by a EMM driver loaded in config.sys, reserve a 64 KB space in the upper memory area (between 640K and 1024K) to do RAM bank switching.
Turbo C 2.0 automatically detect and use EMS memory if found, freeing up space in the lower memory area. (0K..640K)
Is Turbo C available for download aywhere? I would like to give it a try on my 1000Cx as well.

Cheers,
Harald
Turbo C 2.X:

https://winworldpc.com/product/borland-turbo-c/2x

Turbo Pascal 5.5:

https://winworldpc.com/product/turbo-pascal/5x

Loads of Borland manual scans:

http://www.bitsavers.org/pdf/borland/
(Drill down into the subdirectories.)
Look for MASM or TASM also. We used Turbo C and Pascal and assembly using MASM in college. I always wanted a 95/100/200lx and finally got a 200lx a couple years ago but it has a bad display.
(02-06-2019 04:56 PM)Dave Britten Wrote: [ -> ]Turbo C 2.X:

https://winworldpc.com/product/borland-turbo-c/2x

Turbo Pascal 5.5:

https://winworldpc.com/product/turbo-pascal/5x

Loads of Borland manual scans:

http://www.bitsavers.org/pdf/borland/
(Drill down into the subdirectories.)

Thanks a lot for the links!
Reference URL's