0 0 defaultprogram.xml 0 0 Default (empty program, code your own) Squares example (from a PL/0 exercise by Michael Neumann) Squares example (from Susan Stepney, High Integrity Compilation) Calculation of the volume of a sphere (from Peter Grogono, Programming in Pascal) Factorial example

A PL/0 p-code virtual machine

This page illustrates the behavior of a simple stack machine specified by Nicklaus Wirth in his book Algorithms + Data Structures = Programs.

Select one of the sample programs. Then click Step to step through it.

A short description of the PL/0 virtual machine and its machine language is available on another page. [Further explanation and commentary would probably be useful, and will be provided eventually.]

Registers

B (base register)
T (stack top register)
Step
P (program counter)
I (instruction register)

Stack

Code area

Say hello Hello! Number the instructions manually

Some sample programs are available; select one from the list and load it.

Select a program
Load selected program
Edit code

Show XML form of machine program

Show XML
Last updated 3 December 2011