Oppolzer - Informatik / Stanford Pascal Compiler


Home       Lebenslauf       Schwerpunkte       Kenntnisse       Seminare       Kunden       Projekte       Produkte       Blog       Stanford Pascal       Kontakt

The Stanford Pascal Compiler / Evolution Steps

Back to Compiler main page

SNAPSHOT Routine

I wondered if the SNAPSHOT routine will run successfully after the changes that I made regarding lengths of procedure names etc.

I had no experience with this so far, so I looked first how the SNAPSHOT routine is integrated with the rest of the Pascal system. It turned out that it is linked using WXTRN from the PASMONN monitor. The V-address is tested for non-zero. If the SNAPSHOT routine is present, it is called at a certain place. So I had to link the SNAPSHOT TEXT file with the rest of the application.

The SNAPSHOT routine is interesting, because it is written in Pascal completely, although it walks along the save area chains etc; it does all this, because it is closely tied to the Pascal compiler, that is, it knows all about certain addresses etc. And: it is a seperately translated external procedure. Such a procedure simply has to have a dummy (empty) main program, and then you can link it to your Pascal application. You can find further information in the Stanford Pascal 1979 paper.

On first tests, SNAPSHOT complained about problems reading QRD; this was because the symbol file created by the compiler was written on file QRR - not QRD - and there was no FILEDEF for this file. When I added that, all worked without problems.

Now: when a runtime error occurs, SNAPSHOT tells the location of the error (line number and name of procedure) and then it tells the variables and their contents in the abending procedure and in every procedure from the call stack.

To test this, I coded the Fibonacci example from the 1979 Stanford paper; it worked without problems and gave the same results.

I didn't test if there are any problems due to the fact that the procedure names now have 20 bytes in the symbol file (QRR); this still has to be done.

BTW: I observed that my emulated Hercules environment is 20 times faster than the original 1979 Stanford machine (there are some CLOCK outputs in the 1979 Stanford paper)

Back to Compiler main page