Showing posts with label PASCAL. Show all posts
Showing posts with label PASCAL. Show all posts

Tuesday, November 8, 2022

Apple IIe - Apple Fortran/Pascal 1.1 - How to Format and Name a Disk

This took a while to sort out. It applies to Pascal 1.1 as well, since you need the Pascal APPLE3 disk FORMATTER program to do this with Apple Fortran.

A handy command to check to see what disks you have mounted, is the "V" command.

To list the volumes:

  1. Press "F" for the Filer command.
  2. Press "V" for the volume command.
  3. It responds by listing the volumes.
Vols on-line:
    1    CONSOLE:
    2    SYSTERM:
    4 # FORT1:
    5 # FORT2:
    6    PRINTER:
    7    REMIN:
    8    REMOUT:
11   # APPLE3:
12   # BLANK:
Root vol is - FORT1:
Prefix is     - FORT1:

Now, to format a disk:

  1. Put the APPLE3 disk into the first drive and an unformatted disk in the second drive.
  2. Run the FORMATTER program with the command.
  3. Press "X" to X)ecute a program.
  4. At the Execute what file? prompt, type in APPLE3:FORMATTER and press enter.
  5. At the Format which disk (4, 5, 9..12)? prompt, type in the disk number that matches the second drive. In my two drive system this is 5. In my Apple //e Emulator with four drives enabled, it is 12.
  6. If this is a formatted disk, you will be asked if you want to DESTROY DIRECTORY OF DISKNAME?. Type Y.
  7. It will respond with NOW FORMATTING DISKETTE IN DRIVE 12 
  8. You are prompted to format another disk. Either format another disk, or press Return to skip.
  9. It will respond with THAT'S ALL FOLKS...
You now have a formatted disk named "BLANK" in the second drive.

To rename the disk:

  1. Start the Filer, type "F".
  2. Change, type "C".
  3. At the "Change ?" prompt, enter the name of the disk followed by ":" to indicate it's the volume name and not a file, type BLANK: and press enter.
  4. At the "Change to what?" prompt, enter the new volume name, type FCODE: and press enter. If you forget to add the ":", it will ignore the command.
  5. It responds with "BLANK:                          --> FCODE:"
  6. You can check by using the Filer command "V" to view the volumes.



Friday, November 4, 2022

Apple IIe - Apple Pascal 1.3 - Getting to "Hello, World!"

Now that we have an Apple Pascal 1.3 setup going, see Apple IIe - Apple Pascal 1.3 - Setup & Configuration for getting started, let's create the classic "Hello, World!" program.

So, you go through some interesting steps to create a program file to compile and run. Instead of the more familiar UNIX or DOS command line command structure I'm used to using, the Pascal OS has a menu system to execute commands.

I won't go into great detail here. The reference, https://archive.org/details/apple-ii-pascal-1.3, explains file management. I will go through the commands for a basic hello world program.

You may recall the startup screen is as follows:

Command: F(ile, E(dit, R(un, C(omp, L(ink, X(ecute, A(ssem, ? [1.3]


Welcome APPLE1, to Apple II Pascal 1.3

Based on UCSD Pascal II.1

Current date is 10-Apr-90

Pascal system size is 68K


Copyright Apple Computer 1970,1980,1983,1984,1985

Copyright U.C. Regents 1979

The top line is the command menu. 

1. Type "E" to edit a file. This opens the work file for editing. 
2. Type "I" to change to insert mode.
2. Type in your program:

PROGRAM HELLO;
BEGIN
    WRITELN('HELLO, WORLD!')
END.

3. When you have completed typing, press CTRL+C to exit insert mode.
4. Type "Q" to quite the editor.
5. Type "U" to update the work file.
6. Type "E" to leave the editor to the command line. 

To compile, type "C". You will be prompted to list the file. Press Return for none.
Compiling will start.

Here is where I ran into problems. I received a stack overflow error for a simple one line program. I tried adding a switching compiler directive by adding "{$S+}" as the first line of the source. The stack overflow went away, but I received a "Error in factor (bad expression)" error on the "END." statement. Nothing I tried would get it to compile. I typed in a small example program from the reference above, same issue.

So, I tried other sets of disks hoping that the issue was a corrupted disk set. I tried leaving the OS set for 64K instead of 128K. I tried it on my Apple IIe and on AppleWin with the same results.

Finally, I downloaded Apple Pascal 1.1 and tried it. The same program that would not compile, compiled just fine under version 1.1.

I don't know what the problem is. I'll continue using Apple Pascal 1.1 until I can sort it out.

Tuesday, November 1, 2022

Apple IIe - Apple Pascal 1.3 - Setup & Configuration

My notes for setting up Apple Pascal 1.3 on an Apple IIe with two 5 1/4" disk ][ drives.

Download disk images for the four Apple Pascal 1.3 disks. I went here https://mirrors.apple2.org.za/Apple%20II%20Diskware/Pascal/

The following was a "good enough" reference. It required jumping around a bit to understand the command structure. https://archive.org/details/apple-ii-pascal-1.3. The following description of the four disks was found in this reference.

APPLE0: contains all the files needed to edit and run Pascal programs, especially on a one-drive system; it includes SYSTEM.COMPILER, but not SYSTEM.APPLE, which is needed to start up the system. This is the second of two disks used for a two-stage boot on a one-drive system. 

APPLEl: contains all the files you need to edit text and to start up the system. It is used in conjunction with the APPLE2: disk to compile or run Pascal programs. 

APPLE2: contains the Compiler, Linker, Assembler, and other program development tools. It is used for program development. 

APPLE3: contains SYSTEM.APPLE, the Formatter program, several other utility programs, a few demonstration programs for the general user, and the 128K.APPLE and 128K.PASCAL files needed to use additional memory. It also contains the .MISCINFO files needed for use on an Apple II or II Plus. This is the first of two disks used for a two-stage boot. 

First, create the four floppy disks needed for Apple Pascal 1.3. This proved to be harder than I thought. ATDPro was too picky about audio levels to work. I ended up using the command line program c2t used by X found on GitHub here https://github.com/datajerk/c2t. I converted the disk images to low bit rate wave files and moved them to the Apple II using the "LOAD" command.

Once I had all four disks (named "APPLE0",  "APPLE1", "APPLE2", and "APPLE3"), I inserted disk APPLE1 into drive 1 and booted.

I was greeted with this screen:

Command: F(ile, E(dit, R(un, C(omp, L(ink, X(ecute, A(ssem, ? [1.3]


Welcome APPLE1, to Apple II Pascal 1.3

Based on UCSD Pascal II.1

Current date is 10-Apr-90

Pascal system size is 68K


Copyright Apple Computer 1970,1980,1983,1984,1985

Copyright U.C. Regents 1979


My Apple IIe has the 80 column 64K expansion card, so the first thing I did was duplicate the APPLE1 disk and modify it to support 128K. 

First, you need to format a disk. 

  1. Insert disk APPLE3 into drive 1.
  2. Insert an unformatted disk into drive 2.
  3. Type "X" to start the execute command.
  4. At the prompt "Execute what file ?", type "APPLE3:FORMATTER" and press Enter.
  5. At the prompt "Format which volume # ? (4, 5, 9..12, <esc> to exit) ==>", type "#5" and press Enter for the second drive. 
  6. At the prompt, "Enter new volume name for this disk. (<ret> for default name of BLANK:, <esc> to exit) ==>", press Enter.
  7. Press ESC to return to the command line.
Then you will need to transfer disk APPLE1 to the newly formatted disk.
  1. Insert disk APPLE1 into drive 1.
  2. Insert the formatted blank disk into drive 2. 
  3. Type "F" to enter Filer from the command line.
  4. Type "T" to enter Transfer from the command line. 
  5. At the prompt "Transfer what file?", type "APPLE1:" and press Enter.
  6. At the prompt "To where?", type "#5" and press Enter.
  7. At the prompt, "Transfer 280 blocks ? (Y/N)", type "Y" and press Enter.
Now, copy the files 128K.SYSTEM and 128K.PASCAL from APPLE3 to APPLE1 overwriting SYSTEM.APPLE and SYSTEM.PASCAL respectively. 
  1. Insert disk APPLE1 into drive 1.
  2. Insert disk APPLE3 into drive 2.
  3. Type "F" to enter Filer from the command line.
  4. Type "T" to enter Transfer from the command line.
  5. At the prompt "Transfer what file?", type "APPLE3:128K.SYSTEM" and press Enter.
  6. At the prompt "To where?", type "APPLE1:SYSTEM.APPLE" and press Enter.
  7. At the prompt "Delete APPLE1:SYSTEM.APPLE", type "Y" and press Enter.
  8. Repeat steps 5 and 6 for SYSTEM.PASCAL.
Remove disk APPLE3 and reboot. You should now see the start up screen with the following:

Pascal system size is 128K