(*** PAGE 0 *** misp-015.png **********************************************) # Introduction Parts 1, 2, and 3 of this text are the three programs which comprise the Model Implementation of Standard Pascal. Throughout the text the term "standard Pascal" is used to mean the programming language Pascal as defined by standard BS 6192 and ISO 7185, and the term "the Pascal standard" refers to these definitions. These programs are: 1 a model compiler which enforces all mandatory requirments of the Pascal standard on each program input to it, and generates an equivalent "P-code" object program; 2 a P-machine which interprets a P-code program to simulate its executable effect, including detection of all errors defined by the Pascal Standard; 3 a post-mortem generator which examines the "corpse" of an executed P-code program to determine its cause of termination and to re-create the program's final state in source language terms; The Model Compiler ts a conventional one-pass Pascal compiler comprising a machine-independent program analyser cleanly interfaced to a target machine-dependent code generator. It accepts an ISO Standard Pascal source program and generates an equivalent P-code object program for interpretive execution on the P-machine. A high degree of run-time security is provided by generating error-checking code for each of the distinct errors defined in the Pascal Standard. The P-machine program should be regarded as an operational definition rather than a production interpreter. Being written in Pascal, it relies on a host Pascal processor for all arithmetic functions and fixed and floating-point I/O. If these host functions are deviant, the Model Implementation may exhibit deviant behaviour also. Moreover, an implementation of files and program parameters cannot be given a general expression in Standard Pascal. Consequently, the P-machine as published here provides communication with the external environment only via the program parameters Input and Output, together with an interface for the implementation of file I/O in general. The Postmortem Generator supplements each error report with a trace-back of all active blocks, together with a symbolic variable dump of each. It is called whenever the P-machine detects an error, but the means by which this is achieved is necessarily system-dependent.