This page has notes about some DOS-based compilers and interpreters that I tried on the QuickPAD Pro. This is not meant to be a comprehensive list, just a list of the ones that I tried myself, and that might be useful to most QuickPAD Pro users.
The primary goal was to find compilers and interpreters that allow you to write programs directly on the machine itself (on-board programming), as opposed to "cross compilers" where you create the executable on a PC and transfer it to the QuickPAD Pro.
For all the compilers and interpreters I tested, I made some notes on how they were installed. Some had to be installed on my PC (running Windows 98), and then copied to the QuickPAD Pro.
I also noted the disk space that was required. Some use a lot of disk space, and the only way they would run on the QuickPAD Pro is from the D: CompactFlash drive.
Terminology: In the notes below, an "integrated environment" means you can both edit programs and run them from the text editor, without having to exit to DOS.
On most of the compilers and interpreters I ran a similar small program as a final test. I wanted to run something a little more substantial than the classic "Hello, world" program, but yet keep it simple. This is the algorithm of the test program:
Input a character string from the user Open a text file called test.txt and write the string there. Open the text file test.txt and read back the string. Print the string on the screen.The purpose of the test program was to do a simple test of both console I/O and file I/O. Also, to keep things simple, there is no error checking (file open errors, buffer overflows, etc.).
Here is a sample run of the test program, where the user types in 'abc' at the first line:
Input a string: abc String is: abcThe test program will also create an output file called test.txt that also contains 'abc'.
Here is a description of Awk from the GNU Awk home page:
Awk may not be as well-known as some of the other programming languages on this page, so I'll add some extra explanation around the Awk test program below.
Since Awk only runs in text mode, you can use the QuickPAD Pro word processor (edit.exe) to write Awk scripts and data files, and then run the scripts with gawk.exe.
Here is a text file called grades.txt with a list of students and their grades:
John 85 92 78 94 88 Andrea 89 90 75 90 86 Jasper 84 88 80 92 84Let's write an Awk script that will calculate the average grade for each student.
Think of the data file this way: each line of the data file contains "words" and we want to find the average of the second through sixth "word" on each line (add them and divide by 5).
Here is the resulting Awk script called 'test.awk' that I wrote on the QuickPAD Pro:
{ total = $2 + $3 + $4 + $5 + $6 print $1, total / 5 }That calculation will be applied to every line of the data file.
This is the command line to run the script:
gawk -f test.awk grades.txtHere is the output:
John 87.4 Andrea 86 Jasper 85.6The Awk test program worked fine on the QuickPAD Pro.
To learn more about Awk:
GW-Basic is a BASIC interpreter that came with some versions of DOS. It does NOT create standalone executable files. It is an integrated environment; you can write and edit BASIC programs and run them without exiting to DOS.
When gwbasic.exe is executed on the QuickPAD Pro, it runs fine, except for one small problem with scrolling. On my machine, it assumes that you are using a 24-line screen. That means that it won't scroll the output until it reaches the twenty-fourth line. Lines 16 to 23 will just write over each other on the last line of the screen.
For example, this program prints integers 1 to 25, one number per line:
10 for i=1 to 25:print i:nextOn MS-DOS on a PC, the output looks fine. But on the QuickPAD Pro, the output contains only 1, 2, 3, ..., 14, 15, then 24, 25. Line 16 to 23 were overwritten by line 24.
Therefore, it's a good idea to start every program with 25 blank lines so that all subsequent lines will print and scroll correctly:
10 for i=1 to 25: print " ": next
10 for i=1 to 25: print " ": next 20 input "Input a string: ",s$ 30 open "test.txt" for output as #1 40 print #1, s$ 50 close #1 60 open "test.txt" for input as #2 70 input #2, t$ 80 close #2 90 print "String is: ", t$ 100 endThe command line to run it was:
gwbasic test.basThe test program ran fine.
QBasic 1.1 was a BASIC interpreter that came with the later versions of DOS and was included on the Windows 95 installation CD in the 'oldmsdos' directory.
Unfortunately, QBasic 1.1 did not run on my machine. It hung the machine and I had to use the Reset button to recover.
I'm including QBasic 1.1 here just to warn you that it may hang your machine.
Perl4 uses less disk space than Perl5, the latest version of Perl. If you don't need a specific routine from the Perl5 libraries, Perl4 might be sufficient for your needs.
You can use the QuickPAD Pro word processor (edit.exe) to write Perl scripts, and then use perl.exe to run them.
#!perl print "Input a string: "; chop($s = <STDIN>); open(OUTFILE, ">test.txt"); print OUTFILE "$s\n"; close(OUTFILE); open(INFILE, "<test.txt"); chop($t = <INFILE>); close(INFILE); print "String is: $t\n";The command line was:
perl test.plThe program ran fine.
I have been informed that XLisp works on the QuickPAD Pro. I haven't had time to test it yet, but here are the links.
XLisp is available free from this link. It is in the Microsoft MS-DOS section, where it says "Otherwise, you will need to run the generic MS/DOS (138k) version which will run on just about anything."
Here is a direct link to the ZIP file.
It can support structured (indented) BASIC programs and you don't need to number each line as you did with earlier versions of BASIC.
The qbasic.exe program (the full-screen integrated environment) did not work on the QuickPAD Pro. The machine got hung and I had to press the Reset button to recover.
The bc.exe program (the command line compiler) worked fine. Therefore, you can use the QuickPAD Pro word processor (edit.exe) to write programs, and then compile them with bc.exe.
input "Input a string: ",s$ open "test.txt" for output as #1 print #1, s$ close #1 open "test.txt" for input as #2 input #2, t$ close #2 print "String is: ", t$
The command lines were:
bc test.bas link test.objand it created an executable file called test.exe, that requires that the runtime module brun45.exe be in the DOS path.
The test program worked fine.
WARNING: Executables created with QuickBasic 4.5 require the brun45.exe runtime module. On a PC, the 'bc' command can also create executables that do not requirement brun45.exe with the command line 'bc test.bas /o'. However, the resulting test.exe executable caused my QuickPAD Pro to hang and it required a reset to recover.
The installation program will create a directory on your hard disk called C:\TC, and it will print instructions on how to modify your autoexec.bat to include C:\TC in your DOS path.
Since it was installed to hard disk on the PC as "C:\TC", and on the QuickPAD Pro it is now in "D:\TC", I had to edit the configuration file D:\TC\turboc.cfg and replace two occurrences of 'C:' with 'D:'.
The tc.exe program (the full-screen integrated environment) did not work on the QuickPAD Pro. The screen went blank and I had to press the ESCAPE key a few times to return to the DOS prompt.
The tcc.exe program (the command line compiler) worked fine. Therefore, you can use the QuickPAD Pro word processor (edit.exe) to write programs, and then compile them with tcc.exe.
Here is the test program I wrote on the QuickPAD Pro, called test.c:
#include <stdio.h> int main() { FILE *fp; char s[80], t[80]; printf("Input a string: "); fgets(s, 80, stdin); fp = fopen("test.txt", "w"); fprintf(fp, "%s\n", s); fclose(fp); fp = fopen("test.txt", "r"); fgets(t, 80, fp); fclose(fp); printf("String is: %s\n", t); return 0; }
The command line I used was:
tcc test.cand it created an executable called test.exe.
The test program compiled on the QuickPAD Pro and ran fine.
The installation program print instructions on how to modify your autoexec.bat to include C:\TC in your DOS path.
By the way, C:\TC is also the default install directory used by Turbo C 2.01. If you want to install both Turbo C 2.01 and Turbo C++ 1.01, you'll have to install one of them to a different directory.
Since it was installed to the hard disk on the PC as "C:\TC", and on the QuickPAD Pro it is now "D:\TC", I had to edit the configuration file D:\TC\BIN\turboc.cfg and replace two occurrences of 'C:' with 'D:'.
The tc.exe program (the full-screen integrated environment) did not work on the QuickPAD Pro. The screen was garbled and I had to press Alt-F then Alt-X, to return to the DOS prompt.
The tcc.exe program (the command line compiler) worked fine. Therefore, you can use the QuickPAD Pro word processor (edit.exe) to write programs, and then compile them with tcc.exe.
#include <iostream.h> #include <fstream.h> int main() { char s[80], t[80]; cout << "Input a string: "; cin.getline(s, 80); ofstream fpo("test.txt", ios::out); fpo << s << endl; fpo.close(); ifstream fpi("test.txt", ios::in); fpi.getline(t, 80); fpi.close(); cout << "String is: " << t << endl; return 0; }And the command line was:
tcc test.cppIt created an executable called test.exe.
The test program compiled on the QuickPAD Pro and ran fine.
To bypass the full-screen interface, you can add Forth words to the command line to open and load a program. For example:
f open test.seq 1 load runtest byeIt will then execute those words in text mode.
F-PC comes with many help files and sample programs, which is very useful if you are learning Forth. But if you don't need those extra files, you can remove those directories to save disk space.
Actually, all you need is f.exe (if it is configured correctly) and kernel.com. Together they use only about 200K of disk space.
The full-screen interface of f.exe produced garbled characters on the QuickPAD Pro screen, so I had use the 'bye' command to end the program.
At first, F-PC didn't run in text mode either, because it was trying to do fast screen writes to the screen. I had to edit the f-pc.cfg configuration file and replace the 'FAST' word with 'SLOW'. Then I reloaded the configuration file with this command:
f-pc - fsave f byeAfter that change, the 'f' command ran fine in text mode.
Therefore, you can use the QuickPAD Pro word processor (edit.exe) to create scripts and run them using the 'f' command, or you can open and load a program from the 'f' command line and use the Forth text-mode environment interactively from that point on.
handle outhcb handle inhcb variable s 40 allot variable t 40 allot create filebase ," test" create fileext ," txt" : TESTQPP cr ." Input a string: " \ print prompt s 40 2dup erase expect \ read string s filebase outhcb $>handle \ set up outfile basename fileext outhcb $>ext \ set up outfile ext outhcb hcreate drop \ open outfile handle s 40 outhcb hwrite drop \ write string s outhcb hclose drop \ close output file filebase inhcb $>handle \ set up infile basename fileext inhcb $>ext \ set up infile ext inhcb hopen drop \ open infile handle t 40 inhcb hread drop \ read string t cr ." String is: " \ print output label t 40 type cr \ output string t inhcb hclose drop \ close input file ;Here is the command line and the results:
[D:\FPC] f open testqpp 1 load testqpp bye of 910 bytes. Loading.. Input a string: qwerty String is: qwerty Leaving..[D:\FPC]The test program worked fine.
To learn F-PC Forth, there are some good links at this page:
Turbo Pascal 3.0.2 is an integrated environment for Pascal that creates very small and fast *.COM executables. You run the integrated environment by running 'turbo.com'.
It does NOT include a compiler that can be run from the command line, and I wasn't able to get the full-screen editor working on the QuickPAD Pro, so I don't think it is suitable for on-board programming. However, it works fine for compiling on a PC and then transferring the executable to the QuickPAD Pro.
If you want to experiment with on-board compiling, note that the 'tinst' program didn't work on my machine when the files were on the D: compactFlash drive. I had to copy them to the B: RAM drive in order for 'tinst' to save the configuration changes without an error message.
Turbo Pascal 3.0.2 is available at this link.
Manuals are available at this link
The installation program will create a directory on your hard disk called C:\TP, and it will print instructions on how to modify your autoexec.bat to include C:\TP in your DOS path.
Since it was installed to the hard disk on the PC as "C:\TP", and on the QuickPAD Pro it is now in "D:\TP", I had to edit the configuration file D:\TP\tpc.cfg and replace two occurrences of 'C:' with 'D:'.
The turbo.exe program (the full-screen integrated environment) did not work on the QuickPAD Pro. The screen went blank and I had to press the ESCAPE key a few times to return to the DOS prompt.
The tpc.exe program (the command line compiler) worked fine. Therefore, you can use the QuickPAD Pro word processor (edit.exe) to write programs, and then compile them with tpc.exe.
program TestQPPRO; var s, t : string[80]; fp : text; begin Write('Input a string: '); Readln(s); Assign(fp, 'test.txt'); Rewrite(fp); Writeln(fp, s); Close(fp); Assign(fp, 'test.txt'); Reset(fp); Readln(fp, t); Close(fp); Writeln('String is: ', t); end.And the command line was:
tpc test.pasIt created an executable called test.exe.
The test program compiled on the QuickPAD Pro and ran fine.
Manuals are available at this link