Last changes: 2018-02-24
New compiler release 2018.02 available for MVS (TK4-), VM/CMS, Windows and OS/2.
The VM/CMS version is in fact a premature 2018.03 version
and contains some enhancements;
for example CHAR (n) types with lengths greater than 254 -
and the lengths can be symbolic constants (constant identifiers), not only integer constants.
Top features of the new release:
- almost full implementation of the Pascal/VS string datatype
- almost all string functions of Pascal/VS are now implemented
- and some more (VERIFY and TRANSLATE, from PL/1)
- the string feature is documented here: Strings in New Stanford Pascal
- const parameters
- the string datatype still does not work on the mainframe (only Windows etc.)
- some errors with procedure and function parameters (from 1982) have been resolved
- the compiler now works correctly with respect to Knuth's Man-or-Boy problem
- procedure and function parameters (passed to other procedures) only work on the mainframe - at the moment
The compiler compiling itself to 370 machine code on VM/CMS:
I am currently the maintainer of an improved version of the Stanford Pascal compiler.
It runs on VM/370 Rel.6 and on MVS 3.8j on the
And it runs on today's z/OS, too (tested first by Rene Jansen in 05.2017, thanks!).
It will sure run on modern zVM, too (at the moment limited to AMODE 24, RMODE 24).
The VM and MVS versions can be downloaded from this site (including source codes), see "Resources" below.
It also runs (tested) on Windows, OS/2, Linux (x86)
and Mac OS.
On these platforms the P-Code generated by the first compiler pass is interpreted by a P-Code interpreter written in ANSI-C,
so it will probably run on every platform that has a C compiler. Please contact me, if you want to test it on other platforms.
The Windows (and OS/2) version is available from this site, too; see "Resources" below.
This page tells the story, how I started working on this compiler (in 2011), what I did so far, and what I will do next (if I get the spare time to do it).
You can follow the development process more closely on this Facebook page:
Stanford Pascal on Facebook
This picture shows the Pascal compiler compiling itself on Windows
(only pass 1 needed, Pascal to P-Code; the P-Code is interpreted by the P-Code interpreter PCINT).
The compiler version is a very early working version of the 2018.01 release
(in fact, it's the 2017.12 release with the new "hello" message).
Topics with this icon are not yet completed ... maybe implemented, but documentation is missing.
Warning: no warranty at all for the software contained here; I don't recommend that you use it for any production work. The AWS Tape file may contain an older version, which is not as current as the development stories from above. The source codes will be more current, but maybe you will not be able to compile them using the older versions on the AWS Tape, because it is sometimes necessary to apply incompatible extensions to the compiler. If I have time, I will put the new version to the AWS Tape, too (if the new version is stable enough).
If you have difficulties running or compiling the actual versions, contact me directly. I will help you as soon as I can, and I would like it if you test this compiler using some Pascal sources you maybe have.
The source code of the first pass: PASCAL1.PAS
The source code of the second pass: PASCAL2.PAS
The symbol scanner module: PASSCAN.PAS
Backup version 2018.01 first pass: PASCAL1A.PAS
Backup version 2018.01 second pass: PASCAL2A.PAS
To start Pascal programs using VM/CMS: XRUNPARM.ASS
The Pascal monitor and runtime: PASMONN.ASS
The source code of the LIBX library routines: PASLIBX.PAS
The source code of the UTILS library routines: PASUTILS.PAS
The source code of the MVS snapshot routine: PASSNAP.PAS
The source code of the CMS snapshot routine: PASSNAPC.PAS
The source code of the PASFORM source formatter utility: PASFORM.PAS
The source code of the XCOMP compare utility: XCOMP.PAS
Usage Notes for the MVS version:
the ZIP file contains an "Installation Guide" PDF, where you can find detailed instructions. You can also find it here.
The most recent version is available at GitHub:https://github.com/StanfordPascal/Pascal
Usage Notes for the Windows and OS/2 version:
Unzip the ZIP file from GitHub to a directory of your choice (or simply pull it).
The non-Mainframe versions of New Stanford Pascal are based on the P-Code interpreter PCINT.
I removed the precompiled executables PCINT.EXE (for Windows) and
PCINT2.EXE (for OS/2) from this site.
PCINT.EXE can easily be retrieved from the GitHub repository, too.
PCINT2.EXE for OS/2 is not contained in the GitHub repository any more.
The OS/2 variant of PCINT can be built from the Windows source in the GitHub repository,
using any C compiler. Look at aw.cmd to see, how to do it. If you need a OS/2 EXE
of the current PCINT, please contact me offline.
Recompiling PCINT is another option; use any C compiler you like.
I used IBM's C compiler on OS/2 and the Open Watcom C compiler on Windows (gcc on Linux, BTW).
Use PP <program> to call the Pascal compiler; the program should be stored in a file <program>.PAS
Use PRUN <program> to run the program
set DD_<logical_filename>=<physical_filename_including_path> to assign files
please contact me directly
(or: try to build a version of PCINT on the system you are interested in ...
take the sources from the GitHub repository above.
Please keep me informed, if you have successfully ported PCINT to another platform).
The Programming Language Pascal (Niklaus Wirth, 1972)
Stanford Pascal/360 Implementation Guide (1974)
P-Code Description (1978)
The Stanford Pascal compiler (1979)
The Implementation of Case Statements in Pascal (1981)
Pascal/VS Language Reference Manual (1981)
The Pascal ISO 7185 Standard (1991)
LE Stack and Heap Implementation (IBM 2005)
P-Code Description (2016)
External Procedures in Stanford Pascal - written in Pascal, FORTRAN or Assembler (2017)
P-Code Description (2017) - work in progress
Strings in New Stanford Pascal
New Stanford Pascal Installation Guide for MVS (2018.02)