Remembering UCSD P-System, The Pascal Virtual Machine

Long before the Java Virtual Machine (JVM) was said to take the world by storm, the p-System  (pseudo-system, or virtual machine) developed at the University of California, San Diego (UCSD) provided a cross-platform environment for the UCSD’s Pascal dialect. Later on, additional languages would also be made available for the UCSD p-System, such as Fortran (by Apple Computer) and Ada (by TeleSoft), not unlike the various languages targeting the JVM today in addition to Java. The p-System could be run on an existing OS or as its own OS directly on the hardware. This was extremely attractive in the fragmented home computer market of the 1980s.

After the final release of version IV of UCSD p-System (IV.2.2 R1.1) in 1987, the software died a slow death, but this doesn’t mean it is forgotten. People like [Hans Otten] have documented the history and technical details of the UCSD p-System, and the UCSD Pascal dialect went on to inspire Borland Pascal.

Recently [Mark Bessey] also reminisced about using the p-System in High School with computer programming classes back in 1986. This inspired him to look at re-experiencing Apple Pascal as well as UCSD Pascal on the UCSD p-System, possibly writing a p-System machine. Even if it’s just for nostalgia’s sake, it’s pretty cool to tinker with what is effectively the Java Virtual Machine or Common Language Runtime of the 1970s, decades before either of those were a twinkle in a software developer’s eyes.

Another common virtual runtime of the era was CHIP-8. It is also gone, but not quite forgotten.

21 thoughts on “Remembering UCSD P-System, The Pascal Virtual Machine

  1. Finally.
    I remember having used it on TRS-80, C64, “CP/M hardware”, PCs and the Z80-MBC2 still comes with it as one of the pre-installed OSs.
    Meanwhile I forgot how to handle its UI. :-(
    If someone shows me a shell like UI layer for UCSD-P-S instead of the repelling menu driven one I remember only, I might give it a retry.
    And weren’t there even compilers for the native CPUs? I just heard rumours about that and about a BASIC compiler too.
    It could make a nice unified VM-OS layer for lots of microcontrollers to write assemblers and high level languages for their native ISAs.
    But the same can be about CP/M and it sure has a bigger pool of existing languages and tools.
    Maybe there is a reason that CP/M still seems to have a place in many more hearts than UCSD-P-S…

  2. Pascal on the Apple ][ would always boot in a unique way. I think it filled the screen memory with 0’s (inverse-video ampersand characters) before clearing it (to black spaces), and the disk would typically do a long seek at the same time, if I remember correctly. Of course, the reason I saw this so often was that Wizardy was written in Pascal. I remember deciding too often, upon finding the stairs to the next level down, to go down and “see what it’s like” before getting my party killed by a new kind of monster.

  3. I remember this system well: it was my first experience with that toxic slide that dooms any write once run anywhere concept where vendor specific “extensions” poison the well and once this happens why pay the overhead of the VM?

    I also remember having to wire some extra micro switches to the empty joystick controller socket on my Franklin Ace 1000 to run it since it required open and closed Apple keys which, post lawsuit, the Franklin lacked.

    1. Eee hee hee hee, our company will collaborate with others on a permissively licensed open source project, but what they don’t know is this enables us to add our own proprietary secret sauce, and our product will take over the world! Mwah hahaha it’s a perfect plan!

    1. SCUMM VM was much nicer that way because the developers had an incentive to ensure that it was portable. It was also very much domain specific which made it easier to focus how to target multiple platforms.

      Sierra had a similar setup, based on a very tight scheme interpreter and native library for graphics and sound but the high level game logic could be common across platforms.

    1. The TI99 was sort of an emulator box in itself, also.
      The firmware running it was super complicated and the Basic interpreter was basically being interpreted itself.
      Fascinating, yet very poor performing home computer.
      The best about it was the chassis and the keyboard, maybe.

  4. The two main options for operating an HP 9836 68000-based workstation before HPUX Unix came along were UCSD P-system and HP Rocky Mountain BASIC. Used both at HP from 1985 to 1990 or so when HPUX won out by offering Rocky Mountain BASIC as an X-Windows executable

  5. Well, thanks for the memories. (I was at UCSD and wrote the screen-oriented editor as well as some other bits and bobs.) My time on the project has left me with some lingering thoughts. (1) It was before its time, in that the world hadn’t worked up to open source. It would likely have been more long-lasting if it had been published with a decent license. (2) Two main technical gaps were nicely filled by Renaissance Systems (later TeleSoft): (1) native code translation from p-code to machine code (think JIT for JVMs) and (2) 32-bit instead of 16-bit addressing/math. Both too late to save UCSD Pascal. (3) Unix was able to “float down” from larger machines to micros as micros became more capable. UCSD Pascal couldn’t compete: partly just the number of devs, but really from the 56k (on an LSI-11) memory constraining what could be done. I remain proud of the UI (very easy and got out of the way), even if it wasn’t scriptable/extensible. And in the era where printer drivers are GBs, getting an entire execution + code environment of a self-hosting compiler in 56k was pretty cool…

    1. I did actually use the Screen Oriented Editor when playing around with UCSD Pascal on my Apple ][euroPlus at the beginning of the 90s.

      That wasn’t my main computer, I had a 68008-based Sinclair QL as an undergraduate at UEA UK; I bought the Apple ][ euroPlus with a whole pile of disks & manuals from the school of Chemistry for about £35 when they were disposing of them.

      So, wow – you’re the guy who wrote the screen editor! I think I was fairly impressed that they’d managed to implement that on something as primitive as UCSD Pascal, I’d only expected a line editor. I think I found it somewhat slow, but then again, UCSD Pascal on an 8-bit 6502 is slow. Having said that, Computer One’s p-code Pascal and MacPascal were also pretty slow, the only fast Pascals we had access to were VAX Pascal and MPW Pascal (Year 3, 3D graphics).

      I actually really liked UCSD’s single-letter, hierarchy of menu-driven commands. Admittedly, I find’)’ more readable than ‘(‘. e.g. “F)ile, E)edit, C)ompile” vs “F(ile, E(dit, C(ompile”. I’ve written quite a bit of test software for embedded systems using the same paradigm, because it’s a highly compact CLI; though my general parser is RPN: base-10 digits enter a number; ‘ ‘ pushes them and a single letter executes a command. As a bonus, it’s easy to then feed the text in from a serial port to perform automated testing.

  6. My main university programming course in the early 1990s used the pSystem running on top of DOS. The main course was in Pascal but later on in the “Programming and Programming Languages” module there was a section in Eiffel, written in a cross-compiler that turned your Eiffel code into Pascal that you then had to compile again and finally execute in the pSystem interpreter. An essay, sadly, in obsolete technology. Still, I did learn how to develop, test and debug large programs, which isn’t language-dependent.

  7. I was a student in 1979-81. I learned UCSD Pascal on the Apple 2. I was already spoiled by the Basic that I had used at Mesa College so Pascal was very difficult for me. I went on to learn Assembly and Fortran which I enjoyed a lot more.

  8. Back in the day (early 80s) I made a decent amount of money programming business systems for the Apple II computers using UCSD Pascal running on the p-System.

    It was heads-and-shoulders better than any other programming environment for that hardware.

    And then about 8 or so years later, I ported the same business systems to the IBM PC using Borland Pascal and it was not just “inspired on UCSD Pascal”, it was almost 100% compatible — I had to change almost nothing to get it to run.

    Good times!

    1. Turbo Pascal was really neat.
      Version 3 ran on Z80 CP/M, 8086 CP/M and 8086 DOS (MS-DOS).
      Turbo Pascal as a language also fixed several shortcomings of the Pascal language.

      Version 4 introduced EXE files and Units support and Version 6 had a real IDE (Turbo Vision).
      Version 7 was split into Turbo Pascal 7 and the more professional Borland Pascal 7.

      It could create 286 executables optionally and supported DPMI.
      The latter also included a Windows compiler,
      which was derived from earlier “Turbo Pascal for Windows” product.

      (TPW was notable for being lightweight, compiled executables could run on Windows 3.0 in Real-Mode on an 8086/8088.
      There’s also a way to run them on Windows 2.)

      Delphi 1.0 was a successor to that and could still handle OWLs of TPW, in addition to VCL.
      The Calmira project used Delphi 1 to recreate a Windows 95 explorer for 3.1x.

      Delphi 2.0 was mostly Win32s compatible, also.
      The compiled applications could run on Windows 3.1+Win32s if certain rules were followed.

      Delphi 3.0 was very popular, also because the Pro version made it onto companion CDs of books for free.
      Delphi 7 added Windows XP style support and was being popular over a 20 years period (up to early 2020s).

      The famous “Miniatur Wunderland” in Hamburg/Germany seems to have used Delphi internally, too at some point.
      https://simple.wikipedia.org/wiki/Miniatur_Wunderland
      https://www.embarcadero.com/de/case-study/miniatur-wunderland-case-study

  9. My first proper job was at Cabot software in the UK, formerly Pecan software IIRC. We had a commercial license from UCSD and a few dedicated customers along with the open university who supplied the Pascal compiler to students. I recall Modula2 also. Later came C and a port to early digital set top boxes (68K with 512K RAM). That path led to the rest of my career thus far. Cabot continued in the STB space developing MHEG-5 and later purchased by Vestel IIRC but I’d moved on by that point. Happy memories!

Leave a Reply to StephenCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.