Retro programming in Borland Turbo Pascal 7
To build and run the Borland Turbo Pascal demos, you must first install the following tools:
$ sudo zypper install dosbox mtools p7zip-full
$ sudo apt install dosbox mtools p7zip-full
When starting dosbox
the first time, the configuration file ~/.dosbox/dosbox-0.74-2.conf
will be generated
-
Download
Borland Turbo Pascal 7.1 (3.5).7z
-
Create a directory which will contain the DOS C: drive
$ mkdir ~/DOSBox
-
Extract the downloaded Turbo Pascal archive
$ 7z x "Borland Turbo Pascal 7.1 (3.5).7z"
-
Extract the Borland Turbo Pascal disk images
$ cd "Borland Turbo Pascal 7.1 (3.5)"/ $ mkdir tpsetup $ for i in *.img; do echo $i; mcopy -m -i $i :: tpsetup; done
-
Move the extracted files to the DOS C: drive
$ mv tpsetup ~/DOSBox/
-
Configure DOSBox
Edit
~/.dosbox/dosbox-0.74-2.conf
and add the following autoexec options[autoexec] mount c ~/DOSBox path %PATH%;C:\TP\BIN c:
-
Start
dosbox
and execute the Borland Turbo Pascal installation program$ dosbox C:\> cd tpsetup C:\TPSETUP> install.exe
In the installation program, select the following options
Enter the SOURCE drive to use: C Enter the SOURCE Path: \TPSETUP Install Turbo Pascal on a Hard Drive Start Installation
Link the dos-tpdemos
git repository to the DOS C: drive
$ ln -s ~/git/github/dos-tpdemos ~/DOSBox/tpdemos
-
Execute build script
C:\TPDEMOS> buildall.bat
The demos will be located in the
C:\TPDEMOS\BUILD
directory -
Run demo
C:\TPDEMOS> build\demo01.exe
-
Start Borland Turbo Pascal IDE
C:\TPDEMOS> turbo
-
Configure Borland Turbo Pascal
Press
ALT+O
for optionsSelect
Directories
and type in the following directoriesEXE & TPU directory: C:\TPDEMOS\BUILD Include directories: C:\TPDEMOS\ASSETS Unit directories: C:\TP\UNITS;C:\TPDEMOS\SRC\LIB
Select
Compiler
and the following options[X] 286 instructions
Select
Environment
,Preferences
and the following options[ ] Auto save [ ] Change dir on open
Select
Environment
,Editor
and the following options[ ] Create backup files
Select
Save
-
Open demo source file
Press
F3
to open file -
Build demo source file
Press
F9
to build file -
Run demo
Press
ALT+R
andR
to run demo
Licensed under MIT license. See LICENSE for more information.
- Johan Gardhage