Installing Apple II UCSD Pascal

Apple II Pascal is an implementation of a portable Pascal language system developed at University of California San Diego (UCSD) in the late 1970s by Professor Kenneth Bowles and his students. The UCSD Pascal system contained a menu-based operating system and an IDE (Integrated Development Environment) consisting of a Filer, Editor, Compiler, Linker and Assembler. The code generated by the UCSD Pascal compiler ran on a virtual p-code Machine that used an interpreter written in the host computer’s assembly language to translate p-Code to native code. This programming model had the advantage that Pascal code written on one UCSD Pascal system should run on other UCSD Pascal systems.

The porting of UCSD Pascal to the Apple II was heavily influenced by two Apple employees: Jef Raskin, who had taught computer science at UCSD and Bill Atkinson, who was a UCSD computer science graduate. Apple co-founder Steve Wozniak was  involved in the development of the Apple II Pascal BIOS which linked Pascal’s I/O (input/output) routines to the Apple II ROM I/O routines. In 1979, Apple released version 1.0 of Apple II UCSD Pascal (referred to as Apple II Pascal hereafter) at a cost of $495 (approximately $2,100 in today’s dollars). It came with a 16K hardware ‘Language Card’ (to increase the Apple II Plus’ memory from 48K to 64K), 4 reference manuals and four 5.25″ system disks. 

Apple II Pascal Box

Apple II Pascal was updated a number of times, with the final version (1.3) released in 1985. It became an important development environment for Apple II software, including: Apple Business Graphics, Apple Presents the IIe, AppleWorks Tutorials, Dollars & $ense, Incredible Jack, PFS, PSort, QuickFile, Thinktank, Smartcom, Versaform and Wizardry.

Apple II Pascal Customized Start-up Screen

The Apple II Pascal operating system ‘takes over’ the Apple II computer and the programs created in Apple II Pascal will only run under the Pascal operating system. This meant that programs written in Apple II Pascal could not be distributed as standalone applications running under DOS or ProDOS. Instead they were distributed on a disk containing an Apple II Pascal runtime system that, when booted, provided the Pascal environment in which the program would execute.

The Apple II Pascal Filer provided a set of tools for creating and managing disks and files within the Apple II Pascal operating system. Apple II Pascal disks used a block-based format that was different from the disk format used by DOS and ProDOS. Apple II Pascal disks (called Volumes) can store a maximum of 77 files and the disk blocks used by a file must be contiguous. As this could lead to significant disk fragmentation, the Apple II Pascal Filer included a defragmentation utility (‘Krunch’) that optimized file storage. The Apple II Pascal Operating System Reference Manual describes the Pascal Filer in detail.

Apple II Pascal Filer Directory Listing

The Apple II Pascal Editor provided a powerful (for the time) full-screen text editor to create and edit Pascal source code (or 6502 Assembly code) and also served as a simple word processor. While Apple II Pascal will work with either a 40 column or 80 column screen, the latter was highly desirable. The Apple II Pascal Operating System Reference Manual describes the Editor in detail.

Apple II Pascal Text Editor

The Apple II Pascal Compiler converts the source code text of a Pascal program into compressed p-code (bytecode) that will run on the Apple II Pascal p-machine. This single-pass compiler was slow, processing 150-300 lines of source code per minute, depending on the compiler settings. The Apple II Pascal Linker supported the inclusion of separately compiled code (Pascal or 6502 Assembly Language) into an Apple II Pascal program code file.

Setting up an Apple II UCSD Pascal System

Software: The final version (1.3) of Apple II UCSD Pascal was released in 1985, on five 5 1/4 disks (Apple 0,Apple 1,Apple 2, Apple 3, Attach). Version 1.3 has many advantages over earlier versions, including support for 128K of RAM plus bug fixes. If you plan on using Apple II Pascal on either an Apple IIe or Apple IIc with an Extended 80-Column Text Card, you should use the 128K system; if you have anything else, you must use the 64K version of the system.  The 128K system supports larger programs, multiple libraries and a faster compile/link/execute cycle.

Version 1.3 of Apple II UCSD Pascal is available for download (for $20) on the Apple Programmers and Developers Association (APDA) Software Library CD available from Juiced. The download includes the APDA CD in ISO format and a ZIP-compressed archive. The 5 Apple UCSD Pascal 1.3 disks are in the ‘Apple II Pascal 1.3’ folder.

Apple II Pascal Disks

Documentation: The definitive manual for Apple II Pascal version 1.3 is the Apple // Pascal 1.3 Workbench. This 950-page book includes detailed information on the Filer, Editor, Compiler, Linker and Assembler. It also includes a comprehensive reference for the UCSD Pascal language dialect.

There are also two Apple-published Apple II Pascal manuals that periodically pop up on eBay: The Language Reference Manual and The Operating system Manual. However, they are not as comprehensive as the Workbench manual.

Apple II Pascal Manuals

If you would like to learn more about programming in Apple II UCSD Pascal, I recommend The UCSD Pascal Handbook – A Reference and Guidebook for Programmers by Clarke & Koehler (link is to the table of contents only) and Apple Pascal: A Hands-On Approach by Luehrmann & Peckham. An excellent source for information about Apple II UCSD Pascal is here.

Hardware: While you can run Apple II UCSD Pascal on any member of the Apple II family of computers, I recommend using an Apple II simulator to take advantage of virtual hard disks and CPU acceleration. I use Virtual ][ ,the amazing Apple II, II+,IIe and IIc emulator for the Macintosh written by Gerard Putter. My Apple II UCSD 128K Pascal development machine under Virtual ][ is configured as follows:

  • Under Machine -> Configure -> Components -> CPU select ’65C02′.
  • Under Machine -> Configure -> Components -> CPU Speed select ‘1 MHz’.
  • Under Machine -> Configure -> Components -> Keyboard select ‘Backspace acts as left-arrow key’.
  • Aux Slot: A 1024K RAMWorks card, configured as a 960K RAM disk. This also provides an 80-column display. Note that Apple II Pascal does not support RAMWorks virtual disks greater than 4096K.
  • Slot #1: A Serial Printer Card connected to an ImageWriter II printer (Apple II Pascal expects to find a printer in Slot #1).
  • Slot #5: Two 5 1/4 inch disk drives.
  • Slot#6: Two Apple II Pascal-compatible 10 MB Profile-like hard disks (called ‘Omnidisks’ in Virtual ][).
  • Slot #7: A Thunderclock card, so that the UCSD Pascal operating system will automatically time stamp the creation and modification dates of files (this requires a patch to Apple UCSD Pascal version 1.3 that I cover in a seperate post).
Apple II UCSD Pascal (customized startup screen) running in the Virtual ][ Simulator

Once this hardware simulator configuration has been created, do the following:

  • Insert Apple II Pascal version 1.3 disk ‘Apple 1’ into 5 1/4″ disk drive #1.
  • Type ‘PR#5’ and press the RETURN key to boot into Apple II Pascal.
  • The Apple II Pascal operating system should appear.
  • Click on OmniDisk Drive 1 and select ‘Create Blank OmniDisk…’.
  • Create and save a 10 MB hard disk named ‘PASBOOT’.
  • Click on OmniDisk Drive 2 and select ‘Create Blank OmniDisk…’.
  • Create and save a 10 MB hard disk named ‘PASDATA’.
  • In Apple II Pascal type ‘X’ (eXecute) and then type ‘formatter’
  • In response to ‘Format which volume # ?’ type ‘11‘ and then ‘Y’.
  • When prompted for a volume name, enter ‘PASBOOT’
  • Now format volume # 12, creating a hard disk named ‘PASDATA’
  • Press the ESC key to exit the formatter utility.
  • Next, type ‘F’ and ‘V’ to confirm that the two new hard disks were created.
  • We now copy the contents of the ‘Apple 1’, ‘Apple 2’ and ‘Apple 3’ disks to the ‘PASBOOT’ hard drive. To do so, insert (in turn) the ‘Apple 1’, ‘Apple 2’ and ‘Apple 3’ disks into the first 5 1/4 disk drive and from the Filer type ‘T’ (Transfer). When prompted for ‘Transfer what file ?’ enter ‘#4:=’ (copy all files on device #4) and when prompted with ‘To where ?’ enter ‘PASBOOT:$’ (copy the selected files to device ‘PASBOOT’ using the same file names. When asked to overwrite any existing file, answer ‘N’.
  • Finally, as the simulated Apple IIe is a 128K computer we need to install the 128K version of the files ‘System.Apple’ and ‘System.Pascal’. To do so type ‘F’ to enter the Filer and then type ‘T’ (Transfer) to replace the default versions of ‘System.Apple’ and ‘System.Pascal’ on the hard disk ‘PASBOOT’ as follows: In response to ‘Transfer what file ?’ type ‘PASBOOT:128K.Apple’ and when prompted with ‘To where ?’ type ‘PASBOOT:System.Apple’. This replaces the file ‘System.Apple’ with the contents of the file ‘128k.Apple’, while keeping the ‘System. Apple’ file name. When asked ‘Remove old PASBOOT:System.Apple’, answer ‘Y’. Follow the same procedure to replace ‘System.Pascal’ with the contents of the file ‘128k.Pascal’.
  • Quit the Filer, eject any floppy disks from the 5 1/4″ inch floppy drives and select ‘Restart Virtual Machine’ from the Virtual ][ ‘Machine’ menu. This will reboot the Apple II Pascal system using the ‘PASBOOT’ hard disk as the startup device.
  • After rebooting, enter the Filer and type ‘V’. You will see that the device number assignments have changed and the hard disk ‘PASBOOT’ is now device #4 (the Apple Pascal boot disk is always device #4).
  • Type ‘F’ and ‘D’ to enter today’s date. Type ‘Q’ to quit the Filer.
  • Finally we need to apply an Apple II Pascal 1.3 patch to the Apple II boot disk to fix two Apple II Pascal 1.3 bugs. Insert the Apple II Pascal ‘Attach’ disk (found in the Apple Pascal 1.3 folder on the APDA Software Library disk) into the first 5 1/4″ disk drive. Type ‘X’ (Execute) in the Apple II Pascal operating system. When prompted, type ‘#11:Patch’. When prompted with ‘Please enter the number of the unit containing the diskette with the System.Apple file to be updated’, type ‘4’ and press RETURN. After the patches are applied reboot Apple II Pascal.
  • It is necessary to defragment the ‘PASBOOT’ hard disk after installing the files. To do so type ‘F’ to enter the Filer and type ‘K’ to launch the Krunch utility. When prompted with ‘Crunch what volume ?’ type ‘PASBOOT:’ and answer ‘Y’ when asked ‘From end of volume, block 20480 ?’. You may be prompted to reboot Apple II Pascal after the Crunch utility has finished.

Testing: To test the Apple II Pascal system that you have installed, type ‘E’ to launch the Editor. When prompted with ‘Edit what file’, type ‘hilbert’. When the source code for the Hilbert program has been loaded into the editor, type ‘U’ (to update the current project) and ‘E’ to exit. Now type ‘R’ to compile and run the Hilbert program. When prompted for a ‘Listing file’, press RETURN. The Apple II Pascal compiler will now compile the Hilbert source code and run the program. The Hilbert program will ask ‘ORDER:’, type 6 and RETURN to see some Apple II Pascal graphics in action. Press the Space bar to try another ORDER (1-6 or 0 to exit), but this time select ‘maximum Speed’ from the Virtual ][ ‘Machine’ menu.

Simulator CPU Speed: One advantage of using an Apple II hardware simulator is the ability to use CPU acceleration. This is important when using Apple II Pascal, which is quite slow when run at standard CPU speed. I choose either ‘High Speed’ or ‘Maximum Speed’ from the Virtual ][ ‘Machine’ menu when editing, compiling or linking, and switch back to ‘regular Speed’ when running a Pascal program.

A Computing Time Machine

The same year (1983) that Apple released the Lisa computer I discovered the Pascal programming language. In 1980 I learned to program using BASIC on an Apple II Plus computer. I had taken an introductory class in programming while working as a medical intern and became ‘hooked’. Following my internship I worked as lead designer and programmer on a medical research project to develop an Apple II based endoscopy data management system – more to come on that later.

In 1979 Apple Computer released version 1.0 of Apple Pascal (which was based on UCSD Pascal) to run on the new Apple II Plus computer. As discussed in a prior post, Pascal was to be of enormous importance to the company’s future. Apple Pascal was more than a programming language. It was a complete software development environment (compiler, linker, assembler and editor) embedded within a unique menu-driven operating system.

Version 1.0 of Apple Pascal cost $495 (approximately $2100 in today’s dollars) and came in a box containing a 16K hardware ‘Language Card’ (to increase the Apple II Plus’ memory from 48K to 64K), several reference manuals and five 5.25″ system disks. The first release of Apple Pascal was an expensive professional programmer’s tool that I could not afford at the time.

When I finally purchased Apple Pascal in early 1983 it was at version 1.2 and cost considerably less. I installed it on my Franklin Ace 1000 (an Apple II Plus clone) with 64K of memory, an 80-column display card, 12 inch monochrome amber display monitor, two 5.25″ floppy disk drives and a noisy dot-matrix printer.

The Pascal language was transformative, facilitating structured programming, that produced modular re-usable code that was easier to read, understand and maintain. Pascal became the default language for teaching college-level computer science in the 1980s and influenced the design of many of the programming languages that followed.

So, 40 years later I thought that it would be fun to recreate the Apple Pascal programming environment in which I learned structured programming. To do so I would need an Apple II computer, disk drives, a display monitor, Pascal system disks and manuals. Where to begin? See these posts:

Acquiring an Apple II computer and Installing Apple II Pascal

How Pascal Changed the World

This year marks the 40th anniversary of the 1983 debut of Apple’s Lisa computer, the first commercially available personal computer to use a graphical user interface (GUI). In late 1979, Steve Jobs and a group of Apple engineers visited Xerox PARC in Palo Alto, California. Jobs was impressed by the Xerox Alto computer (which had a mouse-driven GUI, windows and desktop). Many of the Alto’s interface elements were incorporated into the Lisa.

Given its high price ($9,995 – approximately $30,000 in 2023 dollars) and a variety of hardware and software issues, the Lisa was not a commercial success.

The remarkable impact of computer technology on our lives and culture in just a few decades is the result of progressive improvements in two major building blocks of computing – hardware and software. The evolution of computer hardware processing power is often linked to Moore’s Law: the number of transistors in an integrated circuit doubles every two years while the cost is halved over the same time period. Computing hardware advances have resulted in powerful devices, with huge storage capacity and fast network access. Indeed, the ultimate expression of this computing hardware is the Internet itself, fulfilling the prophesy of John Gage of Sun Microsystems, who declared in 1984 that “the network is the computer”.

Hardware provides the physical platform upon which software (the instructions that tell computers what to do) performs its magic. Software is written using computer languages that contain instructions for the computer’s hardware in the form of a program. Until the 1950’s computer programs were written in ‘Machine Language’ – complex low-level hardware instructions that a computer would execute directly. In 1954 IBM developed FORTRAN, one of the first ‘high-level’ programming languages used for scientific computing. This was followed by the COBOL programming language in the early 1960s. Both of these languages used natural language elements that made computer programs easier to write, maintain and document.

In 1970, Niklaus Wirth (1934-2024) at the Swiss Federal Institute of Technology released the Pascal programming language. Pascal is a high-level, structured programming language that had a profound impact on computing, as it was used for much of the programming involved in the development of the Lisa and early Macintosh computers. Pascal also became the default programming language for teaching university computer science in the 1980s.

In 1976 Kenneth Bowles, a professor at the University of California San Diego (UCSD) developed a version of Pascal (UCSD Pascal) that could run on personal computers. In 1979 Apple released a version of UCSD Pascal for the Apple II computer, called Apple Pascal.  The creation of Apple Pascal was heavily influenced by two Apple employees: Jef Raskin, who had taught computer science at UCSD and Bill Atkinson, who was a UCSD computer science graduate. In 1979 Raskin started the Macintosh project at Apple (later taken over by Steve Jobs). Atkinson was a key member of the Macintosh development team and the author of QuickDraw, the core computer graphics code used to create the Lisa and Macintosh GUI.

Apple later developed Lisa Pascal, which was used to write much of the software powering the Lisa and Macintosh computers between 1979 and 1984. Apple’s Pascal was arguably one of the most powerful software development tools available for personal computers in the late 1970’s and early 1980s. Without Pascal it is unlikely either the Lisa or Macintosh could have been developed. Without the Macintosh, Apple would likely have slowly declined, as its Apple II-based products were overtaken by more powerful personal computers, such as the IBM PC. Without the Macintosh, there would likely have been no iPhone. Nor would Apple have become the first publicly traded U.S. company to be valued at over $2 trillion in 2023.