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

Changes for the MVS compiler

Compiler version: 05.2017

In fact, nothing had to be changed for the MVS version of the compiler. The XRUNPARM.ASS startup module for CMS which converts the CMS (tokenized) command line into an OS type parameter is needed no longer for MVS. That means, the generated Pascal modules can be started directly at their $PASENT entry points.

There were some issues with the runtime which had to be resolved, that is, errors that did not show up on CMS but had to be fixed for MVS.

The major effort began when I tried to support the PASSNAP snapshot utility on MVS, too. PASSNAP works for applications which consist of different source files. For every procedure or function, the name of the source file is recorded in the procedure meta data in the load module. In case of a snapshot, PASSNAP reads the source file name from there and opens the appropriate DBGINFO file to get the debug information.

With CMS, PASSNAP does this by issuing a dynamic FILEDEF for a file called <source> DBGINFO. If it finds such a file, debug information can be used from there, otherwise processing continues without debug information.

With MVS, I decided that there should be a PDS library (for example PASCALN.DBGINFO) which contains members for each sourcefile, DBGINFO member name = source name. This DBGINFO library must be kept in sync with the load module library (maybe some sort of timestamp checking will be etablished later).

Now the problem arose: the runtime must be able to open files on PDS libraries with member names known at runtime and to return "not found" conditions (and not abend) when members are not present. Because PASSNAP is written in Pascal completely, this had to be provided as an extension to the normal Pascal I/O functions (that is: RESET and REWRITE).

After some thinking, I decided that it would be best to allow this for all Pascal programs, not just PASSNAP.

I extended the Pascal File control block (FCB) to make room for the 8 byte member name. Then I provided a new function ASSIGNMEM to set the member name in the FCB to a value other than blank (which is the default).

ASSIGNMEM is defined inside PASUTILS at the moment, and there is no definition for it, so that it is limited to TEXT files. This will be corrected later.

Definition of ASSIGNMEM:


procedure ASSIGNMEM ( var X : TEXT ; MEMBNAME : CHARPTR ; LEN : INTEGER ) ; var FCB : VOIDPTR ; CPT : -> CHAR ; begin (* ASSIGNMEM *) if PLATF = PLATF_UNKNOWN then CHECK_PLATFORM ; if PLATF = PLATF_INTEL then begin end (* then *) else begin FCB := FILEFCB ( X ) ; CPT := PTRADD ( FCB , 40 ) ; MEMSET ( CPT , ' ' , 8 ) ; if MEMBNAME <> NIL then if LEN > 8 then MEMCPY ( CPT , MEMBNAME , 8 ) else MEMCPY ( CPT , MEMBNAME , LEN ) end (* else *) end (* ASSIGNMEM *) ;

Usage example of ASSIGNMEM:


var PDS : TEXT ; MEMBERNAME : CHAR8 ; P : VOIDPTR ; CP : -> CHAR ; ... MEMBERNAME := 'TEST' ; ASSIGNMEM ( PDS , ADDR ( MEMBERNAME ) , 8 ) ; RESET ( PDS ) ; P := FILEFCB ( PDS ) ; CP := PTRADD ( P , 32 ) ; if CP -> = '0' then return ;

Successful execution of the RESET is indicated by a value other than zero in the open flag at the FCB offset 32.

There is still some work to be done, but using ASSIGNMEM, a first version of PASSNAP could be implemented for MVS which seems to work and gives the same results as the CMS version.

The CMS version of PASSNAP has been renamed to PASSNAPC; the only difference is in fact the open logic of the DBGINFO files.

Later on the wish list: PASSNAP for Windows, OS/2 and Linux.

Back to Compiler main page