Setting Up A Development Enviornment

Table of Contents ] [ List of Example Programs ]

The Atari Pascal Language System is a version of the Pascal programming language released for the Atari 8-bit family of home computers in March 1982 by the Atari Program Exchange as unsupported software.

As released, the Atari Pascal Language System required an Atari 800 with 48K (or an Atari 400 with a warranty-voiding, third-party 48K RAM board installed), two Atari 810 disk drives, and the Atari Program-Text Editor. Requiring two expensive Atari 810 disk drives (or equivalent) in early 1982 greatly reduced the number of people that could actually use this product.

To make the Atari Pascal Language System and the example programs accessible to the greatest number of people, I'll show you how to set up an Atari Pascal Language System development environment using an Atari 8-bit emulator, which will also allow us to take advantage of easily accessible virtual hardware and software.

Altirra

Altirra is a Windows-based Atari 8-bit emulator. You can download the latest version from the author's website: http://www.virtualdub.org/altirra.html. I'll be using the latest version (as of this writing), Altirra 3.10 for my development environment. Screen shots and any step-by-step instructions will match this version.

If you are using physical Atari 8-bit hardware (and you should if you have it), or if you plan on using a Linux or  Macintosh based emulator, you should be able to follow along as well.

Atari Pascal Language System

As released, the Atari Pascal Language System shipped on two 5 1/4 floppy disks and included a 161-page users manual. Since we are setting up a development environment using an emulator, we need disk images rather than physical floppy disks. 

Whether you make disk images from your own physical diskettes or obtain the disk images from the Internet, that is up to you. The required software is available from multiple Internet sites. Here are two:    
It shouldn't matter where you obtain the disk images. For my development environment, I downloaded the two disk images from the Atariwiki link, and as such, I'll be referring to the disk image names using the names from the Atariwiki site:
  • Atari Pascal Version 1.0 (1982) Disk A: APXPAS1.ATR
  • Atari Pascal Version 1.0 (1982) Disk B: APXPAS2.ATR
For the most part, the Atari Pascal Language System requires that either the APXPAS1.ATR disk image or the APXPAS2.ATR disk image be in disk drive D1, as needed, and that a "prepared" source file disk image with the required (but not included) Atari Program-Text Editor MEDIT file on it, be in disk drive D2. I'll show you how to prepare and use this disk image, then we will break this rule.

Testing It Out

Once you have downloaded, installed, and configured Altirra, as well as downloaded (and unzipped, if required) the Atari Pascal Language System disk images, load disk image APXPAS1.ATR into disk drive D1 and reboot the Altirra emulator. 


The Altirra emulator should boot to the Atari DOS 2.0S menu. From the menu, enter A, then RETURN/ENTER twice to see the contents of the APXPAS1.ATR disk image in disk drive D1. 


APXPAS1.ATR contains eleven files: the two Atari DOS 2.0S files (DOS.SYS, DUP.SYS), three Atari Pascal Language System library files (PASLIB.ERL, FPLIB.ERL, GRSND.ERL), one example Pascal source file (CALC.PAS), and some of the Atari Pascal Language System files (PASCAL, MON, LINK, etc).

The FPLIB.ERL file contains the Floating Point relocatable libraries. The GRSND.ERL file contains the Atari Graphics and Sound relocatable libraries. These two libraries are optional and only need to be "linked" to your Atari Pascal program if you need resources inside them. The third relocatable library file, PASLIB, is always required.

To load the Atari Pascal Language System Monitor, enter L, then RETURN/ENTER, type PASCAL, then RETURN/ENTER. The Atari Pascal Language System Monitor will load and display.


The Atari Pascal Language System Monitor Menu displays six options: (E)dit, (C)ompile, (L)ink, (R)un, (D)OS, and (Q)uit. Both the DOS and QUIT options do the same thing, return the system to the Atari DOS 2.0S menu. The remaining four options, (E)dit, (C)ompile, (L)ink, and (R)un, in that order, are the heart of the Atari Pascal Language System.

Creating A Blank Source File Disk Image

Before we can Compile (and then Link and Run) an Atari Pascal program, we need to create a source file disk image and load it into disk drive D2.

First, create a new, blank disk image. In Atirra, click File --> Detach Disk --> All. All disk images should now be detached. Next, click File --> Disk Drives... On the Disk drives dialog box, on the disk drive D1 line, click the little Right Arrow symbol, then click New disk...


On the Create new disk dialog, leave the Disk format as Single density (720 sectors, 128 bytes/sector). Click the Filesystem drop down and select DOS 2.0/2.5, then click OK. Back on the Disk drives dialog, on the disk drive D1 line, click the little Right Arrow symbol again, click Save disk as... , and give the new disk image an appropriate name, such as “source.atr” or another appropriate name, then click Save. A new blank DOS 2.0S floppy diskette has now been created.

In Altirra, load the APXPAS1.ATR disk image in disk drive D1, and load the new "SOURCE.ATR" disk image in disk drive D2, then reboot the Altirra emulator. The Atari DOS 2.0S menu should load.

From the menu, enter A, then RETURN/ENTER twice to see the contents of the APXPAS1.ATR disk image in disk drive D1. Enter A, then RETURN/ENTER, then D2:, then RETURN/ENTER to see the contents of the SOURCE.ATR disk image in disk drive D2. The SOURCE.ATR disk image should be blank with 707 free sectors.



Compiling, Linking, And Running From The Monitor

While we can't yet create a new or edit an existing Atari Pascal source file, we should be able to Compile, Link, and Run the existing example program CALC.PAS.

Copy the CALC.PAS file from the APXPAS1.ATR disk image in disk drive D1 to the SOURCE.ATR disk image in disk drive D2. From the Atari DOS 2.0S menu, enter C, then RETURN/ENTER, then enter D1:CALC.PAS,D2:CALC.PAS, then RETURN/ENTER. There should now be a copy of CALC.PAS on the SOURCE.ATR disk image in disk drive D2. Use the DOS option A to confirm.

To load the Atari Pascal Language System Monitor, enter L, then RETURN/ENTER, type PASCAL, then RETURN/ENTER. The Atari Pascal Language System Monitor will load and display.

From the Atari Pascal Monitor menu, enter C, then RETURN/ENTER. When prompted with "Source file name?", enter D2:CALC.PAS, then RETURN/ENTER. When prompted with "Token file name? Enter <return> for default:", press RETURN/ENTER. When prompted with "Code file name? Enter <return> for default:", press RETURN/ENTER. You will then be prompted to load the Atari Pascal Language System Compiler disk. In Altirra, load the APXPAS2.ATR disk image in disk drive D1, then press RETURN/ENTER.       


When prompted with "Listing file, P: or E: <return> for none", press RETURN/ENTER. 

The example program CALC.PAS will start compiling. To speed up the compilation process, in Altirra, click System --> Warp Speed. When prompted with "REPLACE D1 THEN Type <return> to continue", turn off the Warp Speed option, replace the APXPAS1.ATR disk image in disk drive D1, then press RETURN/ENTER. The Altirra Warp Speed option lets us overcome a serious drawback of the Atari Pascal Language System, the very slow compilation and link processes.

Return to the DOS menu and look at the disk directory of disk drive D2. You should now see the CALC.PAS source file, and the compiled CALC.ERL relocatable file.

From the DOS menu, load the Pascal system. To Link the the CALC program, use the L command from the Pascal Monitor. At the asterisk prompt (*), enter D2:CALC.ERL,FPLIB, PASLIB/S, then press RETURN/ENTER. The linking process with commence. Once again, the Altirra Warp Speed option is your friend, and can be used to speed up the linking process. Just don't forget to turn it off when the linking process completes.



Here are a few notes about the linking parameters, "D2:CALC.ERL,FPLIB, PASLIB/S". The name of the first parameter will be used as the final filename, In this case, "CALC", will be used to create the "CALC.COM" file. The D2 in front of CALC.ERL is required. The linker needs to know what drive the CALC file is on. The .ERL filename extension is optional. If you do not supply it, the Atari Pascal Linker will assume it. The second parameter "FPLIB" (or FPLIB.ERL) is the floating point library. This is required for the CALC program as it uses some of the floating point libraries resources. The third parameter "PASLIB/S" is always required. Every Atari Pascal program that you link will at least include "D2:[FILENAME](.ERL),PASLIB/S", with the up to eight character filename at your discretion and the .erl filename extension optional. 

When prompted with "Link complete type <return>", press RETURN/ENTER. You will return to the Atari Pascal Language System Monitor menu. 

Return to the DOS menu and use the disk directory option to view the contents of disk drive D2. You should now see a third program on the SOURCE.ATR disk image, "CALC.COM". This is the newly compiled and linked Atari Pascal CALC program. 

To Run the CALC.COM program, load the Pascal system. Enter R, then press ENTER. When prompted with "Enter program name Then type <return>:", enter D2:CALC.COM, then press ENTER. The Atari Pascal Monitor will run the CALC.COM program.


It is left up to the reader as an exercise to explore the use, if any, of the CALC.COM program. We will briefly look at the source code of this program later.

At this point, we have used a few Atari DOS 2.0S menu options. We have also used or discussed five of the six Atari Pascal Monitor menu options. If you try the last option, EDIT, you will likely get a "D2:MEDIT not found" warning. We will fix that in the next section where we will look at editing a new program, first with the recommended Atari Program-Text Editor, then, later, with the AtariWriter 80 word processing program in conjunction with the (virtual) Atari XEP80 interface, so that we can make full use of an 80 column display.

For more information on using Atari DOS, see:

No comments:

Post a Comment