Introduction

A.1 Materials Available

intro01 As the UCSD Pascal system has grown, we have found that to distribute all of the software which is useful to all users for all systems, has become an unbearable task. To attempt to alleviate the large number of diskettes the release software requires, and to alleviate the number of pages of documentation sent to each subscriber, we have started to split the system into a number of separately available sections.

The major section is the section which contains the operating system and all the support routines that go with it. We include a number of useful utilities which should enable the subscriber to do all types of developmental work. The master release (as from herein it shall be named) contains the interpreter for the initial system ordered, the UCSD Pascal operating system, the Pascal compiler, two text editors (one for screen devices, one for general purpose), a BASIC compiler, the Linker, the Assembler for the appropriate machine (at least). Other utilities include: a generalized file utility (the File handler), a generalize patch and dump routine, a set of programs to enable the subscriber to configure the system to run most intelligently with any terminal, a desk calculator, and a librarian.

Software which is not included in the master release is generally available from the IIS as a supplemental package at a nominal handling charge (dependent on the amount of material involved with the package). The sorts of software available are: interpreters for machines other than the machine the master release was ordered for, which will be accompanied by the assembler for that machine, in some cases we have assemblers for machines for which we do not yet have interpreters, program and data management systems, specifically a cross-referencer, and a pretty-printer. intro02

A.2.1 The First Time Through

Version II.0, March 1979

intro03 Welcome to UCSD Pascal. If you put the Advanced System 1 diskette in your booting drive, went through your normal boot-strapping procedure, and were greeted in a similar fashion, you do not need to read this section.

If this is not the case then here are a few of the problems we encountered with I.4, and I.5 coming up in strange and foreign lands:

  1. Some revisions of the LSI-11 refuse to boot with the clock running. If you have a switchable clock, turn it off to bootstrap; if and when the system greets you with the welcome message and the date, turn the clock back on.
  2. You do not have enough memory. The minimum requirement for memory is 24K 16-bit words.
  3. You have a system configured for RK-05 hard-disk and you have an unformatted disk on line. The system will hang waiting for a reply from the disk which cannot be generated if the disk is unformatted. Take the disk off-line and try again.
  4. You have a system configured for BK and RX and the RX or BK is not present. Both must be present at the standard DEC UNIBUS or QBUS addresses for these devices.
  5. We haven't encountered your problem before. Call: The number listed on the front page of this document.
intro04

A.2.2. 8080/Z80 With CP/M & 3740 Disks

Version I.5, September 1978

The CP/M Implementation of UCSD Pascal

Booting Pascal

intro05 To get Pascal running under your version of CP/M, a two-disk bootstrap is used. First, boot CP/M in the usual manner. On the CF/N disk distributed with the Pascal system is a file called PASCAL.COM. PIP this file over to the booted disk, then execute it.

When the program asks for a Pascal disk, put the disk labeled PASCAL: in drive A and any disk in drive B. The system may not boot if there is no disk in drive B, or if you have a 1-drive system and your CP/M drivers wait on a request to drive B. Then hit [return]. In about 15 seconds the Pascal welcoming message should appear. (Note: we have discovered that some drives, possibly as a result of being double-buffered, cannot keep up with a 2 to 1 interleaving and hence are extremely slow. The bootstrap then may take about 30 or 40 seconds. We intend to alleviate this problem in the next release, but persons with such drives will have to bear with slow disk accesses for the present.)

If all has gone well, Welcome to the Wonderful World of Pascal. If not, please call to notify us of your problem.

MODIFICATIONS TO CP/M

The Pascal system will operate under an unmodified CP/M system, but it is advisable to create a special CP/M for use with Pascal in order to have Pascal running in the environment for which it was designed.

  1. If there is no disk in a drive and an access is made from that disk, the driver should not wait to perform that access until a disk is inserted, as the Pascal system often attempts to read from empty drives when searching for a particular disk. Instead, simply return a 1 to indicate a bad I/O operation.
  2. If you have a keyboard interrupt handler, it should recognize the character [cntrl-f] as a “flush-output” toggle and signal the character-out routine to gobble any characters until signaled again. When it receives another [cntrl-f] the keyboard handler should signal the output handler causing the output handler to resume outputting characters sent to it.

intro06 The keyboard interrupt handler should also recognize the character [cntrl-s] as a “stop output” toggle and wait until it receives another [cntrl-s] before allowing program execution to continue.

If your keyboard has no alpha-lock, the input driver can use any character not used for some other purpose as an alpha-lock toggle. [Cntrl-p], [return], [cntrl-i], [cntrl-s], [cntrl-f], [cntrl-c] or any character in SYSCOM.CRTINFO should be excluded from consideration. We suggest [cntrl-a].

Pascal expects the tab character ([cntrl-i]) to cause the terminal cursor to advance to the nearest eight column. If the terminal does not do this itself, then the driver in the BIOS should.

Creating a Bootstrap on a Pascal Disk

Note: These instructions are for a standard BIOS with 512-byte blocks. For instructions for a non-standard BIOS, reference file READ.ME on the CP/M disk in the distribution packet.

On the CP/M disk are two programs, PGEN.COM and PINIT.ASM. The program PGEN.COM is a program used to write out a buffer (which will be filled by boot code and BIOS) to track 0. PINIT.ASM is the boot code that reads SYSTEM.MICRO from a Pascal disk, loads the BIOS into the correct place, and starts the interpreter's boot routine.

You must create a file PBOOT.HEX, which will require a slight modification of your current BOOT program. PBOOT will reside on track 0, sector 1 and, when executed, will load track 0, sectors 2 thru 13 into memory starting at location (MSIZE-148)*1024 + 0BA00H, and jump to that location.

You then need to edit PINIT.ASM, changing MSIZE to match your system. Assemble the file, creating PINIT.HEX.

The next step is to stitch together the one-sector boot, the Pascal interpreter loader, BIOS, and the program to write this information out to sector 0. The following is a session with DDT that performs all this. This session was used to create a 48K system. User input is in lowercase, and comments are off to the right.

A>ddt pgen.com ; load PGEN.COM into memory. PBOOT, PINIT, and BIOS will be overlayed into PGEN's data area, after which a memory image will be saved.
DDT VERS 1.3
NEXT PC
0400 0100
 
-ipboot48.hex ; set PBOOT48.HEX as input file
ipinit48.hex intro07 ; set ‘PINIT48.HEX’ as input file
-h980 BA00
C380 14F80
; PINIT starts at location BA00H in a 48K system (in general (MSIZE-48)*1024 + BA00H), and we want it at location 980H
-r4f80
NEXT PC
OA7d BAC0
; read it in
-ibios48.hex
-hd80 be00
C380 4F80
-r4f80
NEXT PC
0F76 0000
; and lastly read BIOS into location D80H
-[cntrl-c] ; leave DDT...
A> save 16 pgen48.com ; ...and save the program.
A> pgen48
PGEN VI.0
PUT BOOTER?(Y/N)y
; sample execution of the program...
WRITING BOOTER TO DRIVE A, TYPE RETURN
AGAIN? (Y/N) n
GET BOOTER? (Y/N) n
; put a Pascal disk (preferably a copy of the master) in drive A before hitting [return].
REBOOTING CP/M, TYPE RETURN ; put the CP/M disk back in drive A before hitting [return].
A> 

A.3 Differences Among Implementations

Version II.0, March 1979

intro08 The following is a list of differences between PDP11 Pascal and 8080/Z80 Pascal, the items describe the way it is on the 8080/Z80, and how that differs from the documented system.

  1. The definition of div is different (thereby changing the values returned by mod):
    a div b = floor(a / b)
    a mod b = a - b * (a div b)
  2. The I/O drivers are all written for synchronous operation. This means that [break] has no effect. [Cntrl-s] and [cntrl-f] will not perform as described unless you have a keyboard interrupt handler, and this handler is modified as specified below in Modifications to CPM.

    This also means that UNITBUSY, UNITCLEAR, and UNITWAIT are meaningless. (In the future it may be possible to use the UNITBUSY and UNITCLEAR operations on the keyboard, but this is currently infeasible.)

  3. The interpreter is called SYSTEM.MICRO instead of SYSTEM.PDP-11.
  4. The CP/M implementations have bootstraps that are not accessible to Pascal, hence the program BOOTER will not work. See the appropriate section of this document for instructions on copying and/or creating a bootstrap.
  5. There are no long integer functions available with the Z80/8080 system. They will be available in a later release.

A.4 Changes Made In Recent Releases

Version II.0, March 1979

Summary Of Differences Between UCSD Pascal Releases I.5 And II.0

intro09 The following additions, improvements and/or corrections apply to Version II.0. Reference the (section II) preceding each entry for a more detailed description. For information regarding differences between previous releases refer to the system documentation for those releases.

(1.1) Operating System

(1.1) C(ompile will now prompt the user for the file to compile, as well as the output file, if the workfile is empty.

(1.2) File Handler

Substantial modifications have been made in the syntax of user responses to filer prompts. The symbol "$" means ‘same name’. This symbol may be used on the right-hand side of a transfer command expression. If the filer detects as some time that two volumes on line have the same name, the warning message:
Warning: units N and M have the same name
will appear beneath the prompt line. This message will remain until some action is taken to convince the filer that this is no longer true.

R(emove command prompts for verification always.

K(runch command allows space to be opened anywhere on the disk.

The bad block scan allows for scanning of any number of blocks.

Editors (Sections 1.3 And 1.4)

intro10 Three different editors are currently provided with the UCSD PASCAL system: YALOE, “EDITOR” (E.6), and the new L.2 EDITOR. EDITOR is a substantially more powerful (and even easier to use) editor than YALOE, but it makes some assumptions about the run-time environment. The L.2 EDITOR (eventually to become the standard release editor) will handle files of arbitrary size, however it is in its experimental form and recommended for brave users only.

EDITOR requires a reasonably powerful CRT terminal with the following features:

XYADRESSING
go directly to a given row and column on the screen

NDFS
non-destructive forward space (the inverse of back-space)

LF
down one line (and if at the bottom of the screen scrolls up)

RLF
reverse line feed (up one line; not required to reverse scroll)

Typing “E” at the main command level will execute the file SYSTEM.EDITOR. Selection of either YALOE or EDITOR (E.6 or L.2) as the system editor is made in the Filer by C(hanging the selected file's name to SYSTEM.EDITOR.

Proper use of EDITOR requires that the system disk be left online while editing.

When prompted with the no work file prompt, typing <escape return> will return you to the system command level.

Purpose

intro11 The main purpose of release II.0 is to establish compatibility at the P-code level among all the interpreters maintained by the Pascal Project. This requires changing the P-machine supported on the PDP-11 and Z80/8080 processors, thereby invalidating all I.5 or earlier codefiles. No functional enhancements in the system software have been planned for II.0, although a number of evolutionary improvements have been made. Only two changes have been made which may affect I.5 level source programs:
  1. the volume ‘REMOTE:’ has been split into two volumes — ‘REMIN:’ and ‘REMOUT:’. Programs using ‘REMOTE:’ will have to be modified to reflect this change.
  2. User programs (rather sophisticated ones presumably) which called the system procedure FBLOCKIO must be changed to accommodate an additional parameter. Uses of BLOCKREAD and BLOCKWRITE are unaffected.

Evolutionary enhancements provided in II.0 are intended largely to improve the ability of the system to operate in in small memory (48K), and small disk (160 block mini-floppy) environments. These improvements include:

  1. The Pascal compiler will run in swapping mode automatically (without the (*$S+*) directive) if it determines that no useful program could be compiled without swapping.
  2. Codefiles for system programs are no longer required to reside on the system disk. The operating system will, at initialize time, (looking first on ‘*’ volume) scan on-line volumes for the files: SYSTEM.EDITOR, SYSTEM.FILER, SYSTEM.COMPILER, SYSTEM.LINKER, and SYSTEM.ASSMBLER, and remember where they were found. Furthermore, if one of these files cannot be found when it is actually invoked by the user, the system will look again at that time.

The issue of byte-sex (high order byte numbered 0 or 1?) has also been addressed. If the programmer wishes to have the compiler generate code for a machine of the opposite sex to the one he is running on, the pseudo-comment (*$F+*) (flip) will cause the codefile to be generated for a machine of the opposite sex (see section 3.6).

The rest of this document concerns only those users who find themselves concerned with the P-Machine internals. A few instructions have been removed, a few have been replaced. The problems solved are those concerning word addressed machines, specifically: Addressing 128K bytes, word boundary troubles with strings and packed arrays, and byte-sex difficulties.

Byte addresses, which are specified by a 16 bit quantity in I.5 systems, are now specified with an address couple. A word base and a byte offset, each of which are 16 bits.

intro12 P-Code Changes

Decimal value I.5 II.0 Description
157 S2p unused
166 LCA LSA Load String Address
167 LDO unused
169 MVB LDO Load Global
208 S1P LPA Load Packed array Address
209 IXB unused
210 BYT unused

Operators with new or changed functional behavior:

LSA
puts address of length byte of string constant, which compiler has aligned to a word, on top-of-stack.

LPA
puts address of first data byte of string constant, which compiler has aligned to a word, on top-of-stack.

INC
now adds its parameter (# of words) to the top of stack, and is now used only for addresses.

LDB, STB, MVR, MVL, SCN, FLC, UNITREAD, UNITWRITE, BLOCKIO
Other operators/standard procedures affected. These now use address couples wherever one word byte addresses were used in I.5.

This page last regenerated Sun Jul 25 01:09:10 2010.