Draper Pascal
Back to current versionRestore this version

DRAPER PASCAL#

Version 2.1

Copyright 1989 by Norm Draper

For the Atari 400, 800, XL, or XE series computers

Disk Based Documentation#

This document contains the "Getting Started" section plus other sections from the actual Draper Pascal manual. It is designed to get you up and running and doing useful things with Draper Pascal in a very short time. It does not, however, contain a detailed description of all the Draper Pascal definitions or pretend to be a comprehensive tutorial or user's reference. Registered users will receive the actual Draper Pascal manual which does contain a complete description of all definitions plus other information. Details on registering are in the last section titled "Registration Form".

The Shareware Concept#

Draper Pascal is distributed on a Shareware basis. You may use Draper Pascal without charge for the purpose of evaluating it's suitability for your use. If you find that Draper Pascal is worth continuing to use, then you are requested to become a registered user and gain the additional benefits that go along with it. Simply complete the registration form and mail it in to us with the very reasonable payment of only $15.00. When you register your copy of Draper Pascal, you'll receive the latest version of the software if your registered version is not current, along with a comprehensive printed user manual.

If you have received this copy from a Users' Group, "Software Library" or "SIG", and have paid a small fee (usually $3 to $10), you have NOT acquired the registered rights or continued right to use Draper Pascal. This fee was for the convenience of obtaining the diskette with Draper Pascal on it. The fee does NOT apply to the registration fee.

You may freely copy Draper Pascal for distribution under the Shareware concept, without charge.

You may NOT charge any fee for the Draper Pascal program or documentation without our written approval.

You may NOT distribute Draper Pascal or it's documentation in connection with ANY commercial venture, product, publication or service unless you obtain the royalty-free license by registering.

Features#

Introduction#

Draper Software welcomes you to the world of Pascal for the Atari 400/800, XL, and XE series Computer systems.

What is Pascal?#

Pascal is a high-level structured programming language developed by Niklaus Wirth in 1971. It is easy to understand and well suited for program development and maintenance.

What is Draper Pascal?#

Draper Pascal is not a "standard" Pascal. It has a number of commands which are exactly like ISO and UCSD versions, some which are similar, and many "extensions" which bring out the true power of the Atari computer in an easy to use manner. It was designed to require only one disk drive for operation, but not be limited to only one. At this time, it has been shown to work with all hardware and software configurations where enough memory is provided. This implementation also has a number of commands which are familiar to Atari BASIC users, such as POKE, PEEK, SETCOLOR, NOTE, POINT, etc..

About this manual#

This manual is intended to familiarize you with all the features of Draper Pascal. It is not intended to teach you how to program in Pascal. However, if you already know Atari BASIC, then you can understand the Pascal statements more easily by referring to their BASIC equivalents shown after the definition of each Pascal reserved word in the complete manual provided to registered users. It is recommended that you read this manual completely to be familiarized with its features and restrictions.

What is Draper Pascal made of?#

This implementation of Pascal is made up of three main components. They are the Supervisor (sometimes referred to as runtime routines), the Compiler, and the Editor. The Supervisor is a high performance machine language program which simulates a 16-bit pseudo computer. The Compiler translates Pascal source code into pseudo-code instructions to be executed by the Supervisor. The Editor is used to enter and modify Pascal source programs. It may also be used to edit data files, or BASIC programs which have been LISTed to a disk or tape. These components are explained in detail within this manual.

For a description of the various files included on the supplied diskette, refer to the 'System Information' section.

About the DOS#

Draper Pascal can be used with most popular Disk Operating Systems. It has been tested with Atari DOS 2.5, SpartaDOS 3.2d, and MYDOS. You should format a diskette with DOS on it to contain the Draper Pascal system. Since the Draper Pascal Supervisor is named AUTORUN.SYS, it will execute immediately after the disk is booted. For XL and XE computers, you do not need to hold down the Option key while booting unless you are using SpartaDOS. If using SpartaDOS, you may want to rename AUTORUN.SYS to PASCAL.COM and create a STARTUP.BAT file containing the following two lines:

BASIC OFF 
PASCAL
This documentation file is not required to be on that same diskette.

Ramdisk support#

Draper Pascal supports the use of the "Ramdisk" capability provided by using a DOS that supports a ramdisk like Atari DOS 2.5 or SpartaDOS 3.x with an Atari computer system having sufficient memory to support the ramdisk. While using this feature, the Editor takes less than two seconds to load and the Compiler takes less than three seconds. Details on setup and use of this feature are provided in the complete manual provided to registered users.

Getting Started#

This section is intended to show by example how to use the Draper Pascal system. You will edit, compile, and run a sample program. Information displayed by the computer is shown in normal type while responses to be entered by you are shown underlined with dashes (---). To begin with, make sure you have 48K RAM installed and no cartridge in place. Boot the disk now by placing it in disk drive 1 and turning on the power to the Atari computer. After the Supervisor has finished loading, you will see a screen that looks like this:

DRAPER PASCAL


1 - Run Program

2 - Disk Directory

3 - Compile Program

4 - Edit a Program

5 - Exit to DOS

6 - List a file

7 - Trace on
                 DRAPER SOFTWARE
                     EDITOR


               A - Add line(s) at end
               C - Change line(s)
               D - Delete line(s)
               E - Edit a line
               F - Filer menu
               I - Insert before line
               L - List line(s)
               M - Menu
               P - Print line(s)
               Q - Quit
               S - Scan line(s)
               X - Exit to Compiler
       A,C,D,E,F,I,L,M,P,Q,S,X,?->F           Select Filer menu
-


               A - Append file
               D - Directory list
               L - Load file
               S - Save file

               L                              Load a file
               -
       Enter filename  -> SAMPLE1             Enter the name of the file
                          -------             to be loaded. The name of
                                              the last file edited,
                                              compiled, or run will be
                                              filled in by the Editor.
                                              You may have to overtype
                                              it with the name shown.
       A,C,D,E,F,I,L,M,P,Q,S,X,?->L           List the file on the
                                  -           screen

       Line from ->                           Just press RETURN for
                   -                          'Line from' and 'Line to'.
       Line to   ->                           This will give a list of
                   -                          the entire program in
                                              memory.

         1:PROGRAM KALEIDOSCOPE;
         2:VAR I,J,K,W,X:INTEGER;
         3:BEGIN
         4: MAXGRAPH(19);
         5: GRAPHICS(19);
         6: X:=0;
         7: REPEAT
         8: FOR W:=3 TO 50 DO
         9:  BEGIN
        10:    FOR I:=1 TO 10 DO
        11:    BEGIN
        12:     FOR J:=0 TO 10 DO
        13:      BEGIN
        14:       K:=I+J;
        15:       COLOR(J*3/(I+3)+I*W/12);
        16:       PLOT(I+8,K);
        17:       PLOT(K+8,I);
        18:       PLOT(32-I,24-K);
        19:       PLOT(32-K,24-I);
        20:       PLOT(K+8,24-I);
        21:       PLOT(32-I,K);
        22:       PLOT(I+8,24-K);
        23:       PLOT(32-K,I)
        24:      END
        25:    END
        26:  END
        27: UNTIL X=99 (* UNENDING LOOP *)
        28:END.
       A,C,D,E,F,I,L,M,P,Q,S,X,?->I           Let's insert a comment
                                  -           before line 15.
       Line -> 15
               --

        15:       (* MY FIRST EDIT *)         Enter the data to be
                  -------------------         inserted when prompted for
        16:                                   line 15. Just press RETURN
            -                                 when prompted for line 16.
                                              This will terminate insert
                                              mode.

       A,C,D,E,F,I,L,M,P,Q,S,X,?->L           List again to verify that
                                  -           the change was made
                                              correctly.

       Line from ->
                   -
       Line to   ->
                   -

         1:PROGRAM KALEIDOSCOPE;
         2:VAR I,J,K,W,X:INTEGER;
         3:BEGIN
         4: MAXGRAPH(19);
         5: GRAPHICS(19);
         6: X:=0;
         7: REPEAT
         8: FOR W:=3 TO 50 DO
         9:  BEGIN
        10:    FOR I:=1 TO 10 DO
        11:    BEGIN
        12:     FOR J:=0 TO 10 DO
        13:      BEGIN
        14:       K:=I+J;
        15:       (* MY FIRST EDIT *)
        16:       COLOR(J*3/(I+3)+I*W/12);
        17:       PLOT(I+8,K);
        18:       PLOT(K+8,I);
        19:       PLOT(32-I,24-K);
        20:       PLOT(32-K,24-I);
        21:       PLOT(K+8,24-I);
        22:       PLOT(32-I,K);
        23:       PLOT(I+8,24-K);
        24:       PLOT(32-K,I)
        25:      END
        26:    END
        27:  END
        28: UNTIL X=99 (* UNENDING LOOP *)
        29:END.
       A,C,D,E,F,I,L,M,P,Q,S,X,?->F           Let's save the program
                                  -           back to disk drive 1
                                              under the same name.

               A - Append file
               D - Directory list
               L - Load file
               S - Save file


               S
               -
       Enter filename  -> SAMPLE1
                          -------
       A,C,D,E,F,I,L,M,P,Q,S,X,?->X           Now let's exit directly to
                                  -           the Compiler.


                Draper Software

                Pascal Compiler

                  Version 2.1


                Copyright 1989
                by Norm Draper



                Enter Filename:
                SAMPLE1                       Enter name of program to
                -------                       be compiled. The name of
                                              the last program edited,
                                              compiled, or run will be
                                              filled in by the
                                              Compiler.

       Enter List Output Filespec
       Default is E:                          Just press RETURN at this
                    -                         point to have the compile
                                              list directed to the
                                              screen.

       0000 PROGRAM KALEIDOSCOPE;
       0000 VAR I,J,K,W,X:INTEGER;
       0003 BEGIN
       0003  MAXGRAPH(19);
       0017  GRAPHICS(19);
       001B  X:=0;
       001E  REPEAT
       0022  FOR W:=3 TO 50 DO
       002A   BEGIN
       0035     FOR I:=1 TO 10 DO
       003D     BEGIN
       0048      FOR J:=0 TO 10 DO
       004F       BEGIN
       005A        K:=I+J;
       0062        COLOR(J*3/(I+3)+I*W/12);
       008A        PLOT(I+8,K);
       0098        PLOT(K+8,I);
       00A6        PLOT(32-I,24-K);
       00B8        PLOT(32-K,24-I);
       00CA        PLOT(K+8,24-I);
       00DC        PLOT(32-I,K);
       00EA        PLOT(I+8,24-K);
       00FC        PLOT(32-K,I)
       010A       END
       010A     END
       010C   END
       011C  UNTIL X=99 (* UNENDING LOOP *)
       0142 END.
       0147
       ADDR   NAME
       ---- --------
       0003 I
       0004 J
       0005 K
       0006 W
       0007 X
       5 Compiler table entries used
       *** Program Execution Completed ***    Press the SELECT key at
       Highest Stack Address Used = $AFF8     this point to take us to
       <START>Repeat,<SELECT>Menu,<ESC>Exit   the main menu.

                  DRAPER PASCAL

                   VERSION 2.1

               1 - Run Program

               2 - Disk Directory

               3 - Compile Program

               4 - Edit a Program

               5 - Exit to DOS

               6 - List a file

               7 - Trace on



                  Copyright 1989
                  by Norm Draper


              1                               Select '1' to run the
              -                               program that was just
                                              compiled.

         Enter name of program to be run

              SAMPLE1                         The name of the last
              -------                         program edited, compiled,
                                              or run will be filled in
                                              by the main menu program.
                                              Overtype the name if you
                                              want to run a different
                                              program.


At this point you should have a nice kaleidoscope pattern being displayed on your television screen. To stop it, press the BREAK key. To repeat execution, press the START key. To return to the main menu, press the SELECT key. To exit to DOS, press the ESC key.

Another program, SAMPLE2, is also provided for you to practice with. It will display Roman numerals for powers of two between 1 and 4096. Compile it, turn on the trace via the main menu, and run it. After it is finished, press CTRL-T to display the trace table, and CTRL-S to display the stack contents. When prompted for 'Where? Filespec', enter 'E:'. For a description of the stack display line, refer to the 'DUMPSTK' command in the 'Pascal Definitions' section of the manual provided to registered users.

Main Menu#

The Main Menu is the initial program to be run by the Supervisor. It is written in Pascal. The source code is provided for it and you may customize it as you see fit. The disk filename for the source is 'INIT.PAS'. The pseudo code program that is initially executed is 'INIT.PCD'. It would be wise to copy 'INIT.PCD' to another name to be used in case your compile of the menu program is not successful. Or, you could rename INIT.PAS to something else, like NEWINIT.PAS, and compile it to produce NEWINIT.PCD. Then you can use the 'run' option (mentioned below) to test your modified program.

The Main Menu appears as follows:


                  DRAPER PASCAL

                   VERSION 2.1

               1 - Run Program

               2 - Disk Directory

               3 - Compile Program

               4 - Edit a Program

               5 - Exit to DOS

               6 - List a file

               7 - Trace on



                  Copyright 1989
                  by Norm Draper

Each of the menu options will now be explained:

Run Program#

Use this option to execute a program that has previously been successfully compiled. You will see the following prompt:

       Enter name of program to be run
The Main Menu program will fill in the name of the last program edited, compiled, or run. If this is the one you want, all you have to do is press RETURN. If it is not the one you want, just overtype the name shown with the one you want.