@L3 COUK1247
80
@V9 0
@YMUSS PASCAL IMP MANUAL
@R6 - PROCEDURES OF THE COMPILER
@V10 1 9 1
@S26.1 DESCRIPTION OF COMPILER PROCEDURES
@BIn this description the compiler procedures appear in the same
order as in the compiler.@
@T# 6
@
 1.
@IPASCAL@
@IThe main program@
@
 2.
@IINITSTACK@
@IInitialises the hypothetical stack pointer to NIL.
The use of the hypothetical stack in code generation for
expressions is described in Chapter 5.@
@
 3.
@ISTACK(ENTRY:STACKENTRY)@
@IStacks ENTRY^ (on the hypothetical stack).@
@
 4.
@IUNSTACK:STACKENTRY@
@IReturns an entry pointing to the top of the stack and moves the
stack pointer to next element of the stack.@
@
 5.
@IFREESTACK(ENTRY:STACKENTRY)@
@IDISPOSEs ENTRY and frees MUTL register if appropriate.@
@
 6.
@ISTACKDEFAULT@
@ICreates a new STACKENTRY of DEFAULT kind and stacks it.@
@
 7.
@IFREEREGISTERS@
@IFrees all of the MUTL registers (i.e. ENTRYUSING[REG]:=NIL)@
@
 8.
@IOPENBODY@
@IInitialises the stack and frees the registers in preparation for
processing the body of a procedure@
@
10.
@IOPENSTATEMENT@
@IPrepares for procesing a statement by:@
@ICalling TRACEPROC.@
@ICreating a new STACKENTRY of STATEMENTBASE
kind and stacking it.@
@
11.
@ICLOSESTATEMENT@
@IUnstacks and DISPOSES all entries which were added to the
stack while procesing the current statement.@
@
12.
@ISTACKVARIABLE(NAME:INTEGER,SDESC:DESCRIPTOR)@
@ICreates a new STACKENTRY of VARIABLE kind with TLNAME and
DESCriptor as given by the parameters, and stacks it.@
@
13.
@ISTACKREFERENCE(NAME:INTEGER,SDESC:DESCRIPTOR)@
@ICreates a new STACKENTRY of REFERENCE kind with SELVARTLNAME
and DESCriptor as given by the parameters, and stacks it.@
@
14.
@ISTACKDATA(REG:REGKIND,SDESC:DESCRIPTOR)@
@ICreates a new STACKENTRY of DATA kind with REGISTER and DESC
as given by the parameters.@
@IAssigns this ENTRY to the register
given by the first parameter, and stacks it.@
@
15.
@ISTACKCONSTANT(C:CONSTREC,D:DESCRIPTOR)@
@ICreates a new STACKENTRY of KONSTANT kind with VALUE as given
by the parameter, and stacks it@
@
16.
@ISTACKBOOLCONSTANT(VAL:BOOLEAN)@
@ICreates a new CONSTREC of BOOLKIND kind with BVAL as given by
the parameter, and stacks it.@
@
17.
@ISTACKCHARCONSTANT(VAL:CHAR)@
@ICreates a new CONSTREC of CHARKIND kind with CVAL as given by
the parameter, and stacks it.@
@
18.
@ISTACKINTCONSTANT(VAL:INTEGER)@
@ICreates a new CONSTREC of INTKIND kind with IVAL as given
by the parameter, and stacks it.@
@
19.
@ISTACKREALCONSTANT(VAL:REAL)@
@ICreates a new CONSTREC of REALKIND kind with RVAL as given
by the parameter, and stacks it.@
@
20.
@ITLNAMEALLOCATION(NAMEALLOCATED:INTEGER)@
@IAllocates the next TLNAME.@
@
21.
@IDESCTYPENAME(DESC:DESCRIPTOR):INTEGER@
@IReturns the MUTL type name corresponding to DESC.@
@
22.
@IXXPLANT(OPCODE,OPERAND:INTEGER)@
@IGenerates code for the operation defined by the parameters.@
@Q 4
@
23.@IXXSTARTTYPEDEFINITION(SYMBNAME:SYMBOLICNAMENTRY,@
@INATURE:INTEGER,NEWNAME:INTEGER)@
@IBegins the definition of an aggregate type.@
@
24.@IXXSTATICSTOREALLOCATION(SYMBNAME:SYMBOLICNAMENTRY,@
@ITYPENAME,DIMENSION:INTEGER,NEWNAME:MUTLNAME)@
@IDeclares a variable of type given by the
parameters, and gives it the next TLNAME.@
@
25.
@IXXSELECTVARDECLARATION(NEWNAME:MUTLNAME)@
@Ieclares a select variable and gives
it the next TLNAME.@
@
26.@IPLANTINTCONSTANT(OPCODE:INTEGER,REG:REGKIND,@
@IVALUE:INTEGER)@
@IGenerates code to perform the operation given by
OPCODE using the REG register on an operand which is
an integer constant equal to VALUE.@
@
27.
@IXXNAMECLIT(NEWNAME:MUTLNAME)@
@IAllocates the next TLNAME to a literal with the
value and type of the current literal.@
@
28.
@IXXSTRINGASLIT@
@IDeclares a variable with character
elements ansd to assign its value.@
@
29.
@IXXPROCSPECIFICATION(ID:IDENTRY)@
@IDeclares a procedure and its parameters.
Allocates the next TLNAME to the procedure.@
@
30.
@IXXSTARTPROCDEFINITION(ID:IDENTRY)@
@IGenerates code to start the definition of a procedure.@
@
31.
@IXXLABELSPECIFICATION(SYMBNAME:SYMBOLICNAMENTRY,@
@ILABELTYPE:INTEGER;LABELNAME:MUTLNAME)@
@ISpecifies a label and gives it the next TLNAME.@
@
32.
@IXXENDPROCCALLSEQ(TLNAME:INTEGER)@
@IGenerates code to end the procedure calling sequence.@
@
33.
@IXXSETAREGMODE(MODE:INTEGER)@
@ISets the mode of the A register to the
MODE given by the parameter.@
@
34.@IXXCONVAREGMODE(ENTRY:STACKENTRY;KIND:INTEGER;@
@IRESTYPE:TYPENTRY)@
@IConverts a variable from one type to another using the A register.@
@
35.@IXXTLINITIALISATION@
@IPlants initialisation code.@
@
36.
@IXXRETAINREG(REG:REGKIND)@
@IGenerates code to retain the register given by the
parameter in current use.@
@
37.@IXXPOINTERTYPEDECL(NAME)@
@IDeclares a MUTL type consisting of one field of pointer type
to enable pointers-to-pointers and vectors of pointers to be declared.@
@
37A.
@IXXCONVSETTYPE@
@IPerforms conversions between different sizes of SETs.@
@
38.
@IPLANTNAME(OPCODE:INTEGER,REG:REGKIND,OPDNAME:INTEGER)@
@IGenerates code to perform the operation given by the parameters
using the appropriate register.@
@
39.
@IRELEASEREGISTER(REG:REGKIND,ONSTACK:BOOLEAN)@
@IGenerates code to release the register given by the 1st
parameter by stacking or storing the contents of the register.@
@
40.@ICHOOSETLCLIT(NAME:INTEGER):INTEGER@
@IDeclares as the current literal an empty set
of the appropriate size given by NAME unless > 64 bits
required. Returns 0 indicating current literal or the MUTL
name of the 128-bit empty set.@
@
41.
@IOPERANDTLNAME(ENTRY:STACKENTRY):MUTLNAME@
@IReturns the appropriate TLNAME to describe ENTRY^ for use as the
operand in a MUTL procedure.@
@
42.@IPLANTENTRY(OPCODE:INTEGER,REG:REGKIND,@
@IENTRY:STACKENTRY)@
@IGenerates code to perform the operation given by OPCODE using the
REG register with operand = OPERANDTLNAME(ENTRY).@
@IIf necessary the appropriate register is released and the mode
of the A register modified before performing the operation.@
@
43.
@IJUMPONFALSE(LABELNAME:INTEGER)@
@IGenerates code for conditional jump to label given by parameter.@
@
44.
@IFLOAT(ENTRY:STACKENTRY)@
@IPerforms integer/real conversion.@
@
45.
@INEGATE(OP:OPKIND)@
@INegates the operand at compile-time in the case of a constant.
Generates code to do this in the case of a variable.@
@
46.
@ISTACKNAMEDPARAM(TLNAME,MODE:INTEGER)@
@IGenerates code to stack a parameter in a procedure
call sequence.@
@
47.
@ISTACKDESCRIBEDPARAM@
@IGenerates code to stack TOPSTACKENTRY as a parameter in a procedure call
sequence.@
@
48.
@ITRACEPROC@
@IGenerates code to print out the line numbers reached during
run-time. (If compiler directive indicates that this is required).@
@
49.
@IRUNTIMERROR(ERRCODE:INTEGER)@
@IGenerates code to
enter a trap at a run-time error.@
@
50.
@ICHECK(DESC:DESCRIPTOR);@
@IGenerates code for run-time checking of subranges and indices.@
@
50A.@ICONSTVAL(C:CONSTREC):INTEGER;@
@IReturns the integer value associated with a constant record.@
@
51.
@IPERFORMOPERATION(OPERATION:OPKIND,OPERATOR:OPTYPE,@
@IRESTYPE:TYPENTRY)@
@IPerforms various operations on the top two stack entries
at run-time (unless they are both constants in which case
at compile-time).@
@
52.
@ICOMPILETIMEOPERATION@
@IPerforms operations on constants at compile-time.@
@
53.
@IBOOLARITHMETIC(LEFT,RIGHT:BOOLEAN)@
@IPerforms arithmetic operations on boolean constants at compile-time
and stacks the result.@
@
54.
@IINTARITHMETIC(LEFT,RIGHT:INTEGER)@
@IPerforms arithmetic operations on integer constants at compile-time
and stacks the result.@
@
55.
@IREALARITHMETIC(LEFT,RIGHT:REAL)@
@IPerforms arithmetic operations on real constants at compile-time
and stacks the result.@
@
56.
@ICOMPARISON(LEFT,RIGHT:REAL)@
@IPerforms comparison operations on real constants at compile-time and
stacks the result.@
@
57.
@ICOMPARISONOPERATION@
@IGenerates code to perform comparison operations.@
@
58.
@ICHECKMOD@
@IGenerates code to check at run-time that the second operand
of MOD is positive.@
@
59.
@ISETBOUNDS(ENTRYSTACKED,SETLOW,SETHIGH):BOOLEAN;@
@ILOWBOUND,HIGHBOUND:INTEGER)@
@IGenerates code to set the lower and upper bounds
on a vector during an assignment operation between
arrays of different SIZES as in the PACK and
UNPACK procedures.@
@
60.@ICONFREFERENCE(T:TYPENTRY)@
@IGenerates code to reference an element of a conformant array.@
@
61.@IINDEXEDREFERENCE(LOWBOUND,SELFAC:INTEGER,@
@IELEMDESC:DESCRIPTOR)@
@IGenerates code to reference an array element.@
@
62.@IFIELDREFERENCE(SELECTROOT:FIELDSELENTRY,@
@IFIELDDESC:DESCRIPTOR)@
@IGenerates code to reference a field.@
@
63.
@IPOINTERREFERENCE(RECDESC:DESCRIPTOR)@
@IGenerates code to reference a variable on the heap.@
@
64.@IWITHREFERENCE(WITHBASE:STACKENTRY,@
@ISELECTROOT:FIELDSELENTRY,FIELDDESC:DESCRIPTOR)@
@IGenerates code to reference a field during a WITH statement.@
@
65.
@IFORCEPOINTER(TYPENAME:INTEGER)@
@IGenerates code to create a reference in the D register to the top
entry on the stack.@
@
66.
@IOPENWITHSTATEMENT@
@IPrepares for the processing of a WITH statement by:@
@I    Creating a reference to the top stack entry and@
@I    storing it in a variable.@
@
67.
@ICLOSEWITHSTATEMENT@
@IEnds WITH statement by unstacking WITHBASE and DISPOSEing it.@
@
68.
@IGETDESCRIPTOR(ENTRY:TYPENTRY;SYMBNAME:IDENTRY)@
@IAssigns a value to the DESCriptor of a TYPENTRY.@
@IIf necessary generates code to declare a new MUTL type.@
@
69.
@INEWFIELDSELENTRY(K:FLDSELKIND;VAL:INTEGER)@
@ICreates a new FIELDSELECTENTRY of the kind indicated by the
parameters. FIELDSELECTENTRYs are used to store
selection information for accessing the fields of a record.@
@
70.
@INEWADDDECLARENTRY(SYMBNAME:IDENTRY,TYPNAME,@
@IDIMEN:INTEGER)@
@IUsed in the declaration of a structured type.@
@ICreates a new DECLARENTRY of the kind given by the parameters and
adds it to the chain of DECLARENTRY's
in preparation for BREAKDECLARENTRY to generate code.@
@
71.
@INEWENDDECLARENTRY@
@ITerminates the chain of DECLARENTRY's created above.@
@
72.@IBREAKDECLARENTRY(SYMBNM:IDENTRY,@
@INEWTYPENAME:MUTLNAME)@
@IGenerates code to declare a structured type using the
chain of DECLARENTRYs. Returns the name of the new
type in NEWTYPENAME.@
@
73.
@IFIELDDECLARATION(IDROOT:IDENTRY;PACKDEC:BOOLEAN)@
@IWorks through the chain of IDENTRYs created by FIELDLIST,
calling GETSELECTROOT to create a FIELDSELECTENTRY corresponding
to each.@
@
74.
@IGETSELECTROOT(ID:IDENTRY,PACKROOT:BOOLEAN)@
@ICreates a new FIELDSELECTENTRY by calling NEWFIELDSELENTRY
and adds it to the chain of FIELDSELECTENTRYs. Calls
NEWADDDECLARENTRY.@
@
75.
@IDISPOSESELENTRY(MARKEDENTRY:FIELDSELENTRY)@
@IDISPOSEs all FIELDSELENTRY's after MARKEDENTRY in the chain.@
@
76.@IVARPARTDECLARATION(VARPARTROOT:TYPENTRY,@
@IPACKTAG:BOOLEAN)@
@IWorks through the chain of TYPENTRYs created by FIELDLIST to
describe the variant part of a RECORD calling VARIANTDECLARATION
and FIELDDECLARATION to declare the variants and the tagfield
respectively.@
@
77.
@IVARIANTDECLARATION(VARIANTROOT:TYPENTRY,PACKVAR:BOOLEAN@
@IWorks through the chain of variants created by FIELDLIST calling
NEWFIELDSELENTRY for each variant and finally calling BREAKDECLARENTRY
to generate MUTL code to declare the new TYPE.@
@
78.@IEXTENSION@
@IPrints warning if non-ISO extension used.@
@
79.
@IPRINTSOURCELINE@
@IPrints the current sourceline if required to list the source
or if any errors have been discovered in the current sourceline.@
@IIf errors have been found the appropriate error code is printed.@
@
80.
@IPRINTERRORS@
@ICalculates the total number of errors discovered so far.@
@IPrints error code for up to ERRORMAX errors.@
@IIf too many errors discovered in the current sourceline
prints 'FURTHER ERRORS SUPPRESSED'.@
@
81.
@IPRINTARROW(ARROWPOSITION:LINEPOSITION)@
@IPrints arrow to indicate where an error occured.@
@
82.
@IPRINTCOMMA@
@IPrints a comma between two arrows indicating errors
in the same symbol.@
@
83.
@IERROR@
@ICalculates the number of errors discovered in the current sourceline
so far and checks whether more than ERRORMAX errors have been found.@
@INotes the error code and the position in the line.@
@
84.
@INEWCH@
@IMakes the variable CH equal to the next character in the source.@
@ICalls PRINTSOURCELINE if the end of the current line has been reached.@
@
85.
@IINSYMBOL@
@IReads the next symbol of the source.@
@
86.
@IGETNUMCONSTANT@
@IDetermines the value of a numerical constant and stores it in
the variable CONSTANT.@
@
87.
@IANALYSEDIRECTIVE@
@IReads compiler pragmats and generates code in
accordance with them. (E.g. to list the course program, to
trace the performance ar run-time, to list the MUTL calls).@
@
88.
@IOPENSCOPE(KIND:SCOPEKIND)@
@ICreates a new compile-time display entry, moving TOP
(of DISPLAY) one by one. Invoked when moving one level
deeper in the nested block structure.@
@
89.
@ICLOSESCOPE@
@IMoves out one level in nested block structure at compile time.@
@
90.
@ISAVESCOPE(ENTRY:SCOPENTRY)@
@ICreates a new ENTRY which is used to remember the current
TOP of DISPLAY item.@
@
91.
@IRESTORESCOPE(ENTRY:SCOPENTRY)@
@IRestores current TOP of DISPLAY item from ENTRY and disposes entry.@
@
92.
@IDISPOSESCOPE@
@IDisposes the Identifier, Type and Label trees in the TOP of
DISPLAY by calling DISPOSED, DISPOSETYPE, DISPOSELABEL.@
@
93.
@IDISPOSEID(ROOT:IDENTRY)@
@IDISPOSEs an IDENTRY and all other IDENTRYs
at the same scope level, by calling itself recursively.
Uses DISPOSEENTRY to remove IDENTRY.@
@
94.
@IDISPOSENTRY(ID:IDENTRY)@
@IDISPOSEs an IDENTRY,
that is the properties of the identifier.@
@
95.
@IDISPOSEFORMAL(ROOT:FORMALENTRY)@
@IDISPOSEs a FORMALENTRY representing a formal procedure
parameter and any other FORMALENTRYs contained
in ROOT^ by calling itself recursively.@
@
96.
@IDISPOSETYPE(ROOT:TYPENTRY)@
@IDISPOSEs a TYPENTRY and, in the case of RECORDs, DISPOSEs
FIELDSCOPE.@
@
97.
@IDISPOSELABEL(ROOT:LABELENTRY)@
@IDISPOSEs a LABELENTRY.@
@
98.
@INEWTYPE(FORMNEEDED:TYPEFORM):TYPENTRY@
@ICreates a new TYPENTRY of the FORM given by the second
parameter and adds it to the TYPENTRY chain of DISPLAY[LEVEL].@
@
99.
@IINITIDCHAIN(CHAIN:IDCHAIN)@
@IInitialises the HEAD and TAIL of an IDCHAIN to NIL.@
@
100.
@ICHAINID(CHAIN:IDCHAIN,ENTRY:IDENTRY)@
@IAdds ENTRY to the end of the chain of IDENTRYs given by CHAIN.@
@
101.
@ILINKIDCHAINS(CHAIN1,CHAIN2:IDCHAIN)@
@ILinks together CHAIN1 and CHAIN2 in a single chain.@
@
102.
@IREVERSEIDCHAIN(ROOT,NEWROOT:IDENTRY)@
@IReverses the order of all the elements of the chain from ROOT onwards.@
@
103.@IEQUAL(INDEX1,INDEX2,LENGTH:IDARRLENGTH):BOOLEAN@
@IDetermines whether two identifiers are the same.@
@
104.
@INEWID(CLASSNEEDED:IDCLASS):IDENTRY@
@ICreates a new IDENTRY of the class given by the second parameter
and adds it to the hash table.@
@IIf an identifier of the same name is found an error
message is produced but a second ENTRY is still created.@
@
105.
@INEWLABEL:LABELENTRY@
@IChecks that a label has not already been declared.@
@ICreates a new LABELENTRY
for the new label.@
@
106.
@ISEARCHID(CLASSESALLOWED:SETOFIDCLASS):IDENTRY@
@ICompares the current identifier name with each of the identifiers
working from local out to global level.@
@IChecks whether the identifier is of a suitable class and produces
an error message if not.@
@IMakes a default declaration if necessary (i.e. if the identifier
has not been declared and is not in the library).@
@IReturns the corresponding IDENTRY.@
@
107.
@ICHOSEN(CLASSES:SETOFIDCLASS):IDCLASS@
@IDetermines the class of an identifier when a default declaration
is made.@
@
108.
@ISEARCHLABEL(ENTRY:LABELENTRY):LABELENTRY;@
@ISearches for a label working from local out to global level.@
@IIf the label is not found an error message is produced and a
new label declaration made.@
@
109.
@IGETBOUNDS(ENTRY:TYPENTRY;LOWBOUND,HIGHBOUND:INTEGER)@
@IDetermines the bounds of a type.@
@
110.
@ICARDINALITY(ENTRY:TYPENTRY):INTEGER@
@IReturns the cardinality of a type.@
@
111.
@ICOMPTYPES(T1,T2:TYPENTRY):BOOLEAN@
@IDetermines whether two types are compatible.@
@
112.
@IISSTRING(ENTRY:TYPENTRY):BOOLEAN@
@IDetermines whether a type is a string type.@
@
113.
@INEWSTRING:TYPENTRY@
@ICreates a new TYPENTRY of a string type.
Calls XXSTRINGASLIT to declare string literal.@
@
114.
@INEWFILE(ENTRY:IDENTRY)@
@IDeclares a file variable and plants code to initialise it.@
@
115.@ICHECKMONADICOPERAND(OP:OPKIND;OPERANDTYPE,@
@IRESTYPE:TYPENTRY)@
@IChecks that an operand is compatible with the operation to be
performed on it,
and returns a type REAL, INTEGER or BOOLEAN.@
@
116.@ICHECKDYADICOPERANDS(OP:OPKIND;OPERATOR:OPTYPE;@
@IT1,T2,RESTYPE:TYPENTRY)@
@IChecks that two operands are compatible with each other and with the
operation to be performed on them.@
@
117.
@IINTREALCONVERSION@
@IConverts one of two operands from integer to real so that they are
of the same type.@
@
118.
@IENTRYFORTYPENAME(NAME:INTEGER):TYPENTRY@
@IReturns a TYPENTRY corresponding to the parameter
of an external procedure.@
@
119.
@IINLIBRARY(ENTRY:IDENTRY;DECLARED,INLIB:BOOLEAN)@
@IDetermines whether a procedure is in an external library.@
@ICreates an IDENTRY for the procedure, if found.@
@
120.
@IACCEPT(SYMBOLEXPECTED:SYMBOLTYPE)@
@IChecks that current symbol is the symbol expected and reads the
next symbol if so. Otherwise produces error code.@
@
121.
@ISKIP(SYMBOLSEXPECTED:SETOFSYMBOLS)@
@ISkips over symbols until an expected symbol is found.@
@
122.
@ICHECKEXPECTEDSYMBOLS(SYMBOLSEXPECTED:SETOFSYMBOLS)@
@IIf current symbol not expected skips until expected symbol found.@
@
123.
@ICHECKPOSSIBLESYMBOLS(EXPECTEDSYMBOLS,POSSIBLESYMBOLS@
@I:SETOFSYMBOLS)@
@IIf current symbol is not expected, skips until an expected or possible
symbol is found.@
@
124.
@ICHECKSYMBOL(SYMBOLEXPECTED:SYMBOLTYPE;SYMBOLSEXPECTED@
@I:SETOFSYMBOLS)@
@IChecks that the current symbol is the expected one and, if so,
checks that the following symbol is expected.@
@IOtherwise produces errorcode.@
@
125.@ICLOSEFILE(ID:IDENTRY)@
@IPlants code to end the input or output stream associated
with a file and reset the flag.@
@
126.@IRELEASEFILES(ROOT:IDENTRY)@
@IGenerates code to end all the input and output streams
associated with program files. Called on leaving a procedure
or terminating a program.@
@
127.
@IPROGRAMM@
@IProcesses the source program.@
@
128.@IBLOCK(BLOCKSYMBOLS:SETOFSYMBOLS;@
@IENDBLOCKSYMBOL:SYMBOLTYPE;DBLOCKID:IDENTRY)@
@IProcesses a block of the source program.@
@
129.@IINCONSTANT(SYMBOLS:SETOFSYMBOLS;CT:TYPENTRY;@
@IC:CONSTREC)@
@IFinds the vaue of a constant in the source program and
assigns it to C.@
@
130.
@ITYP(TSYMBOLS:SETOFSYMBOLS;SYMBNAME:IDENTRY):TYPENTRY@
@IDeals with a TYPE declaration returning an appropriate value
to describe the TYPE declared.@
@
131.
@ISIMPLETYP(SSYMBOLS:SETOFSYMBOLS):TYPENTRY@
@IDeals with the declaration of a simple TYPE returning
an appropriate value to describe the
type declared.@
@
132.
@INEWSUBRANGE(LOWTYPE:TYPENTRY;LOWBOUND:INTEGER)@
@ICreates a new TYPENTRY of subrange kind, checking that the upper
and lower bounds of the subrange are of compatible ordinal type.@
@
133.
@IFIELDLIST(FSYMBOLS:SETOFSYMBOLS;FIXEDROOT:IDENTRY;@
@IVPENTRY:TYPENTRY)@
@IProcesses the field list of a RECORD declaration.
Assigns a value to a TYPENTRY to describe the RECORD with a
chain of IDENTRYs to describe the field identifiers and a chain of
TYPENTRYs to describe the variants.@
@
134.@IREVERSETYPECHAIN(ROOT:TYPENTRY;NEWROOT:TYPENTRY)@
@IReverses the order of a chain of TYPENTRYs so that the fields
of a record will be declared to MUTL in the correct order.@
@
135.
@ILABELDECLARATION@
@IChecks that a label in a source program declaration is an
integer constant.@
@ICreates a new LABELENTRY corresponding to the label.@
@IRepeats this process until the end of the LABEL statement
is reached.@
@
136.
@ICONSTDEFINITION@
@IProcesses a CONST statement.@
@
137.
@ITYPEDEFINITION@
@IProcesses a TYPE statement.@
@
138.
@IVARDECLARATION@
@IProcesses a VAR statement.@
@
139.
@IPROCDECLARATION@
@IProcesses PROCEDURE or FUNCTION statement.@
@
140.@ICONFORMTYPE(PIDCHAIN:IDCHAIN):TYPENTRY@
@ICreates a new TYPENTRY to describe the type of a conformant array
parameter.@
@
141.
@IOBTAINTYPE(ISRESTYPE:BOOLEAN;IDROOT:IDENTRY)@
@IFinds the type of a list of parameters or the result type of a
function and creates a TYPENTRY to describe it.@
@
142.@IPARAMETERLIST(FORMALLIST:BOOLEAN;@
@IPSYMBOLS:SETOFSYMBOLS;FORMALBASE:FORMALENTRY)@
@IProcesses a parameter list.@
@
143.
@IBODY@
@IProcesses the body of a procedure.@
@
144.
@ISTATEMENT(STATSYMBOLS:SETOFSYMBOLS)@
@IProcesses a statement.@
@
145.
@IINTEXPRESSION(ISYMBOLS:SETOFSYMBOLS)@
@IProcesses an integer expression.@
@
146.
@ICONDEXPRESSION(CSYMBOLS:SETOFSYMBOLS;LAB:INTEGER)@
@IProcesses a conditional expression, planting a
conditional jump.@
@
147.
@IORDINALEXPRESSION(OSYMBOLS:SETOFSYMBOLS)@
@IProcesses an ordinal expression.@
@
148.
@ISELECTOR(SSYMBOLS:SETOFSYMBOLS;VID:IDENTRY)@
@IDeals with selection of a particular scalar variable, element
of an array or field of a record or the item pointed to by a
pointer or a file buffer variable. Plants procedure
call to PBOFFVAR for character file buffer.@
@
149.
@ICALLPROC(CSYMBOLS:SETOFSYMBOLS;PID:IDENTRY)@
@IDeals with the calling of procedure or function (by the source program).@
@
150.
@IVARIABL(VSYMBOLS:SETOFSYMBOLS)@
@IDeals with accessing a variable used by the source program.@
@
151.
@IFILEPROC@
@IProcesses calls of procedures involving files.
(e.g. READ,WRITE,EOF).@
@
152.@IRESETWRITE(INP:BOOLEAN)@
@IGenerates code to RESET or REWRITE a file.@
@
153.@ICHECKFLAG(VAL:INTEGER;LAB:MUTLNAME)@
@IGenerates code to check the status of the flag associated with a file
and jump accordingly.@
@
154.@IFILECOMP(COMPONENT:INTEGER)@
@IPlants code to access a particular field of the record associated
with a file.@
@
154A.@ISTOREAREGIN(COMPONENT:INTEGER)@
@IPlants code to store the contents of the A register in a particular
field of the record associated with a file.@
@
155.@IIOOPERATION(KIND:IOKIND;CALLGET:BOOLEAN)@
@IGenerates code for input/output operations.@
@
156.
@ISTOREREFINBUFFER(TLNAME:INTEGER)@
@IAssigns a value to TLNAME to describe the file buffer variable
BUFVAR either by putting TLNAME := BUFVAR or, if necessary,
generating code to create a reference to BUFVAR and stack it and
putting TLNAME := CCREFONSTACK.@
@
157.
@ISTOREAREGIN(ITEMTLNAME:INTEGER)@
@IGenerates code to store the contents of the A register in the
address given by ITEMTLNAME.@
@
158.
@ISTACKINTCONSTPARAM(VAL:INTEGER)@
@IGenerates code to stack VAL as a parameter in a MUTL
procedure call.@
@
159.
@IDPPROCCALLSEQ(TLNAME:INTEGER)@
@IGenerates code to perform the MUTL procedure calling sequence
stacking as parameter the item on top of the hypothetical stack.@
@
160.
@IPROCCALLSEQ(TLNAME:INTEGER)@
@IGenerates code to perform the MUTL procedure calling sequence
stacking a list of parameters.@
@
161.
@INEWPARENTRY(ITEM:INTEGER)@
@ICreates a new PARENTRY with VALUE=ITEM and adds this to the
chain of parameters created by FILEPROC.@
@
162.
@ISELECTSTREAM@
@IGenerates code to select the required input or output stream.@
@
163.
@IGETSTANDFILE@
@IPrepares for reading or writing using the standard input
or output file.@
@
164.
@IGETT@
@IGenerates code to perform the GET procedure, taking
account of lazy character input.@
@
165.
@IFILEENQ(I:INTEGER)@
@IChecks whether the
bits corresponding to I in the file flag are set.@
@
165A.@IEOLNN@
@IGenerates code to perform EOLN, by calling NEXTCH
for character files.@
@
166.
@IPAGEE@
@IGenerates code to perform the PAGE procedure.@
@
167.
@IPUTT@
@IGenerates code to perform the PUT procedure.@
@
167A.@IEOFFF@
@IGenerates code to call IENQ and test the result for end of
character file else calls FILEENQ for other files.@
@
168.
@IREADD@
@IProcesses a READ statement.@
@
169.
@IRESETT@
@IGenerates code to perform the RESET procedure.@
@
170.
@ISKIPTONEXTLINE@
@IGenerates code to skip to the next line of the file
currently in use.@
@
171.
@IREWRITEE@
@IGenerates code to perform the REWRITE procedure.@
@
172.
@IWRITEE@
@IProcesses a WRITE statement.@
@
173.
@IMATHSFUNC@
@IProcesses a call of a standard mathematical function (by the
source program).@
@IThis includes checking that the operands are of suitable types
and generating code to perform the operation.@
@
174.
@ICONVFUNC@
@IProcesses a call of the 'conversion' functions CHR, ORD,
ROUND, TRUNC.@
@
175.
@IORDINALFUNC@
@IProcesses a call of SUCC or PRED.@
@
176.
@ITRANSFERPROC@
@IProcesses a call of PACK or UNPACK.@
@
177.@IARRAYVAR(ASYMBOLS:SETOFSYMBOLS)@
@IFinds the index and element types of an array.@
@
178.
@IDYNAMICSTOREPROC@
@IImplements NEW and DISPOSE by generating calls
to MAKEHEP or REMOVEHEAP to obtain or release heap space at run-time.@
@
179.
@IUSERPROC@
@IProcesses a call of a user-defined procedure or function.@
@
180.
@ICOMPARAM@
@ICompares the parameters of a procedural parameter in a procedure call with
those declared and produces error messages if they are
not compatible.@
@
181.
@IEXPRESSION(ESYMBOLS:SETOFSYMBOLS)@
@IDeals with the run-time evaluation of an expression using
SIMPLEEXPRESSION to evaluate the simple components of the expression.@
@IEvaluates the expression at compile-time if each simple expression
is constant.@
@
182.
@ILOADFIRSTFAC@
@IGenerates code to load the first factor of an expression into
the A or B register.@
@
183.
@ISIMPLEEXPRESSION(SSYMBOLS:SETOFSYMBOLS)@
@IDeals with the run-time evaluation of a smple expression using
TERM to evaluate each term of the expression.@
@IEvaluates the expression at compile-time if each term is constant.@
@
184.
@IGETSIMPLEOP(T1,T2:TYPENTRY)@
@IDetermines whether a simple operation (e.g. +,-,*) is a scalar
or set arithmetic operation by inspecting the types of the operands.@
@
185.
@ITERM(TSYMBOLS:SETOFSYMBOLS)@
@IDeals with the run-time evaluation of a term in an expression using
FACTOR to evaluate each factor.@
@IEvaluates the term at compile-time if each factor is constant.@
@
186.
@IFACTOR(FSYMBOLS:SETOFSYMBOLS)@
@IDeals with the run-time evaluation of a factor in an expression.@
@IEvaluates the factor at compile-time if it is a constant.@
@
187.@ISINGLETONSET(TLNAME,TYPENAME)@
@IGenerates code to add the element given by the TOPSTACKENTRY to the
SET variable given by TLNAME.@
@
188.@IRANGESET(TLNAME,TYPENAME)@
@IGenerates code to add a range of elements (e.g. 1..4) to the SET
variable given by TLNAME.@
@
189.
@IGETOP(T:TYPENTRY)@
@IDetermines whether a comparison operation (e.g. <,>,=) is a scalar,
pointer, set or string comparison by looking at the type of one of the
operands.@
@
190.
@IASSIGNMENT(ID:IDENTRY)@
@IProcesses an assignment statement.@
@
191.
@IGETASSIGNOP(T:TYPENTRY)@
@IDetermines whether an assignment statement involves a scalar,
pointer, string or structured type assignment according to the type of
variable to which a value is being assigned.@
@
192.
@ICOMPOUNDSTATEMENT@
@IProcesses a compound statement by calling STATEMENT repeatedly until
an END symbol is reached.@
@
193.
@IIFSTATEMENT@
@IProcesses an IF statement.@
@
194.
@ICASESTATEMENT@
@IProcesses a CASE statement.@
@
195.
@IFORSTATEMENT@
@IProcesses a FOR statement.@
@
196.
@IWHILESTATEMENT@
@IProcesses a WHILE statement.@
@
197.
@IREPEATSTATEMENT@
@IProcesses a REPEAT statement.@
@
198.
@IGOTOSTATEMENT@
@IProcesses a GOTO statement.@
@
199.
@IWITHSTATEMENT@
@IProcesses a WITH statement.@
@
200.
@IINITLISTING@
@IPrints the date and time of the compilation.@
@IInitialises the number of errors found to zero.@
@IInitialises the hash table.@
@
201.
@IINITCODEGENERATION@
@IInitialises the number of TLNAMEs used to 1.@
@IGenerates code for MUTL initialisation.@
@ICalls BASICDESCRIPTORS and BASICTLNAMES.@
@
202.
@IBASICDESCRIPTORS@
@IInitialises the DESCRIPTORs for all the standard types and the
default DESCRIPTOR.@
@
203.
@IBASICTLNAMES@
@IGenerates code to specify an end of program label.@
@ICreates literals and assigns TLNAMES for:@
@I    zero;@
@I    The empty set;@
@I    A set containing a single element;@
@
204.
@IINITSYNTAX@
@ICalls the following initialisation procedures:@
@IBASICSETOFSYMBOLS, INITCHARSYMBOL, INITDELIMITERS,
STDPROCHOUSEKEEPING, OTHERINITIALISATIONS.@
@
205.
@IBASICSETOFSYMBOLS@
@IDefines certain sets of SYMBOLs required by the compiler.@
@
206.
@IINITCHARSYMBOL@
@IInitialises CHARSYMBOL. (CHARSYMBOL is an array containing
a RECORD of the SYMBOL and corresponding operation, if any,
of each character).@
@
207.
@IINITDELIMITERS@
@IInitialises DELIMITER. (DELIMITER is an array containing a RECORD
of the NAME, SYMBOL and operation, of each PASCAL delimiter).@
@
208
@ISTDPROCHOUSEKEEPING@
@IInitialises the names of the standard procedures.@
@IDefines which group each standard procedure belongs to.@
@IIn the case of file handling procedures defines whether they
are concerned with input or output.@
@IDefines the MUTL code number for the standard mathematical
functions.@
@
209.
@IOTHERINITIALISATIONS@
@IPerforms various initialisations including:@
@
@IOPPOPERATOR (an array giving the reverse operator@
@Icorresponding to each of the arithmetic operators).@
@ICCOPCODE (an array giving the MUTL name of the@
@Idyadic operators).@
@
210.
@IINITSEMANTIC@
@IDefines the standard PASCAL types.@
@IDefines the standard identifiers.@
@
211.
@IINITSCOPE@
@IInitialises TOP and LEVEL to 0 and initialises DISPLAY[0].@
@
212.
@ISTANDTYPENTRIES@
@ICreates TYPENTRYs for each of the standard PASCAL types.@
@
213.
@INEWSTANDTYPENTRY(ENTRY:TYPENTRY)@
@ICreates a new TYPENTRY called ENTRY with FORM=SCALARS and
SCALARKIND=STANDARD.@
@
214.
@ISTANDIDENTRIES@
@IDefines the following identifiers:@
@I  'MAXINT';@
@I  the boolean constants 'TRUE' and 'FALSE';@
@I  'NIL';@
@I  the standard PASCAL type identifiers.@
@I  the standard internal and external procedures.@
@
215.
@INEWBOOLCONSTID(NAME:IDENTNAME;VAL:BOOLEAN)@
@ICreates a new boolean constant IDENTRY with name and value
as given by the parameters.@
@
216.
@INEWTYPEID(NAME:IDENTNAME;ENTRYTYPE:TYPENTRY)@
@ICreates a new IDENTRY corresponding to the type identifier
given by the parameters.@
@
217.@INEWSTANDFILE(NAME:IDENTNAME;LENGTH:IDENTLENGTH;@
@IENTRY:IDENTRY)@
@ICreates a new variable IDENTRY called ENTRY corresponding to the standard
file described by the parameters.@
@
218.@INEWEXTPROC(NAME:IDENTNAME;LENGTH:INTEGER;@
@IPROCTLNAME:INTEGER)@
@IChecks that an external procedure required by the compiler is in the
library and puts PROCTLNAME equal to the TLNAME of the library
procedure.@
@IProduces an error message if the procedure is not in the library.@
@
219.
@IENDLISTING@
@IPrints the final line of the source program followed by an end of
compilation message giving the total number of errors discovered.@
@
220.
@IENDCODEGENERATION@
@IGenerates code to declare the end of the program label and
end the compilation.@
@
221.@IERRORMESSAGE@
@IPrints error message corresponding to a particular error code.@
@S26.2 INDEX TO COMPILER PROCEDURES
@BThis index gives
the section number under which a description
of it may be found in 6.1.@
@3
@
@
PROCEDURE NAME           SECTION NO.@
ACCEPT                      120@
ANALYSE DIRECTIVE            87@
ARRAYVAR                    177@
ASSIGNMENT                  190@
BASICDESCRIPTORS            202@
BASICSETOFSYMBOLS           205@
BASICTLNAMES                203@
BLOCK                       128@
BODY                        143@
BREAKDECLARENTRY             72@
CALLPROC                    149@
CARDINALITY                 110@
CASESTATEMENT               194@
CHAINID                     100@
CHECK                        50@
CHECKDYADICOPERANDS         116@
CHECKEXPECTEDSYMBOLS        122@
CHECKFLAG                   153@
CHECKMONADICOPERAND         115@
CHECKPOSSIBLESYMBOLS        123@
CHECKSYMBOL                 124@
CHOOSETLCLIT                 40@
CHOSEN                      107@
CLOSEFILE                   125@
CLOSESCOPE                   89@
CLOSESTATEMENT               11@
CLOSEWITHSTATEMENT           67@
COMPARAM                    180@
COMPARISON                   56@
COMPARISONOPERATION          57@
COMPILETIMEOPERATION         52@
COMPOUNDSTATEMENT           192@
COMPTYPES                   111@
CONDEXPRESSION              146@
CONFORMTYPE                 140@
CONFREFERENCE                60@
CONSTDEFINITION             136@
CONSTVAL                     50A@
CONVFUNC                    174@
DESCTYPENAME                 21@
DISPOSEFORMAL                95@
DISPOSEID                    93@
DISPOSELABEL                 97@
DISPOSENTRY                  94@
DISPOSESCOPE                 92@
DISPOSESELENTRY              75@
DISPOSETYPE                  96@
DPPROCCALLSEQ               159@
DYNAMICSTOREPROC            178@
ENDCODEGENERATION           220@
ENDLISTING                  219@
ENTRYFORTYPENAME            118@
EOLNN                       165A@
EQUAL                       103@
ERROR                        83@
EXPRESSION                  181@
EXTENSION                    78@
FACTOR                      186@
FIELDECLARATION              73@
FIELDLIST                   133@
FIELDREFERENCE               62@
FILECOMP                    154@
FILEENQ                     165@
FILEPROC                    151@
FLOAT                        44@
FORCEPOINTER                 65@
FORSTATEMENT                195@
FREEREGISTERS                 7@
FREESTACK                     5@
GETASSIGNOP                 191@
GETBOUNDS                   109@
GETDESCRIPTOR                68@
GETNUMCONSTANT               86@
GETOP                       189@
GETSELECTROOT                74@
GETSIMPLEOP                 184@
GETSTANDFILE                163@
GETT                        164@
GOTOSTATEMENT               198@
IFSTATEMENT                 193@
INCONSTANT                  129@
INDEXEDREFERENCE             61@
INITCHARSYMBOL              206@
INITCODEGENERATION          201@
INITDELIMITERS              207@
INITIDCHAIN                  99@
INITLISTING                 200@
INITSCOPE                   211@
INITSEMANTIC                210@
INITSYNTAX                  204@
INLIBRARY                   119@
INSYMBOL                     85@
INTARITHMETIC                54@
INTEXPRESSION               145@
INTREALCONVERSION           117@
IOOPERATION                 154B@
ISSTRING                    112@
JUMPONFALSE                  43@
LABELDECLARATION            135@
LINKIDCHAIN                 101@
LOADFIRSTFAC                182@
MATHSFUNC                   173@
NEGATE                       45@
NEWADDDECLARENTRY            70@
NEWBOOLCONSTID              215@
NEWCH                        84@
NEWENDDECLARENTRY            71@
NEWEXTPROC                  218@
NEWFIELDSELENTRY             69@
NEWFILE                     114@
NEWID                       104@
NEWLABEL                    105@
NEWPARENTRY                 161@
NEWSTANDFILE                217@
NEWSTANDTYPENTRY            213@
NEWSTRING                   113@
NEWSUBRANGE                 132@
NEWTYPE                      98@
NEWTYPEID                   216@
OBTAINTYPE                  141@
OPENBODY                      8@
OPENSCOPE                    88@
OPENSTATEMENT                10@
OPENWITHSTATEMENT            66@
OPERANDTLNAME                41@
ORDINALEXPRESSION           147@
ORDINALFUNC                 175@
OTHERINITIALISATIONS        209@
PAGEE                       166@
PARAMETERLIST               142@
PASCAL                        1@
PERFORMOPERATION             51@
PLANTENTRY                   42@
PLANTINTCONSTANT             26@
PLANTNAME                    38@
POINTERREFERENCE             63@
PRINTARROW                   81@
PRINTCOMMA                   82@
PRINTERRORS                  80@
PRINTSOURCELINE              79@
PROCCALLSEQ                 160@
PROCDECLARATION             139@
PROGRAMM                    127@
PUTT                        167@
RANGESET                    188@
READD                       168@
REALARITHMETIC               55@
RELEASEFILES                126@
RELEASEREGISTER              39@
REPEATSTATEMENT             197@
RESETT                      169@
RESETWRITE                  152@
RESTORESCOPE                 12@
REVERSEIDCHAIN              102@
REVERSETYPECHAIN            134@
REWRITEE                    171@
RUNTIMEERROR                 49@
SAVESCOPE                    90@
SEARCHID                    106@
SEARCHLABEL                 108@
SELECTOR                    148@
SELECTSTREAM                162@
SETBOUNDS                    59@
SIMPLEEXPRESSION            183@
SIMPLETYP                   131@
SINGLETONSET                187@
SKIP                        121@
SKIPTONEXTLINE              170@
STACK                         3@
STACKBOOLCONSTANT            16@
STACKCHARCONSTANT            17@
STACKDATA                    14@
STACKDEFAULT                  6@
STACKDESCRIBEDPARAM          47@
STACKINTCONSTANT             18@
STACKINTCONSTPARAM          158@
STACKNAMEDPARAM              46@
STACKREALCONSTANT            19@
STACKREFERENCE               13@
STACKVARIABLE                12@
STANDIDENTRIES              214@
STANDTYPENTRIES             212@
STATEMENT                   144@
STDPROCHOUSEKEEPING         208@
STOREAREGIN                 154A@
TERM                        185@
TLNAMEALLOCATION             20@
TRACEPROC                    48@
TRANSFERPROC                176@
TYP                         130@
TYPEDEFINITION              137@
UNSTACK                       4@
USERPROC                    179@
VARDECLARATION              138@
VARIABL                     150@
VARIANTDECLARATION           77@
WHILESTATEMENT              196@
WITHREFERENCE                64@
WITHSTATEMENT               199@
WRITEE                      172@
XX.....                      22-37A@
@0
@V9 0
@R7 - COMPILE JOBS
@V9 1
@S27.1 PASCAL COMPILER
@BIn order to compile the system compiler for a new system, a
cross-compiler must be compiled which will be able to run on the
existing system and produce a compiler to run on the new system.
Since the I/O library for the new compiler may not be compatible
with the existing compiler a cross-compiling I/O library (PIOX)
must be compiled. This must be compiled from the same source as
was used to produce the existing system PIO since it is to be
used in conjunction with a program compiled by the existing PASCAL.
The source file OPASC4 contains a PIO compatible with the current
PASCAL in use on the MUSS systems at Manchester University.
A new system PIO is compiled using the MUSL cross compiler (i.e.
a cross compiling library, a cross compiling MUSL and the cross
compiling code generator). The new PASCAL compiler
is then compiled using the Pascal cross-compiler, PASCX.
@BThe sequence of jobs required to compile a new system Pascal are,
therefore, as follows:@
@T# 6
@
@ICompile PIOX (7.2)@
@ICompile PASCX (7.3)@
@ICompile PIO (7.4)@
@ICompile PASCAL (7.5)@
@BTo compile a MUBL encoded compiler use the compile job in
section 7.1.@
@X {\ }`
@
7.1 MUBL ENCODED COMPILER
::BEGIN CPASCB@
DO 0 PASCBLOG %200 0@
ED PASC0/MU6C@
S!PROGRAM!I!@
(*$I-*)@
**TLMODE %404@
**TLSEG 0 0 %B800000 -1 6@
**TLLOAD 0 4@
**TLLOAD 0 5@
**TLSEG 4 0 %BC00000 -3 %E@
**TLLOAD 4 6@
**TLLOAD 4 7@
**TLPRINT 4@
!(FD!{CV!D!CV}!)E@
LIB MUTLB/MUSM@
LIB PASCAL/MUSM@
PASCAL 0 PASMUBL0 5 1@
**DEL@
**EDIT PASC1/MU6C@
(FD!{CV!D!CV}!)E@
**DI 7@
**SI 7@
**EI 7@
**DEL@
**EDIT PASC2/MU6C@
(FD!{CV!D!CV}!)E@
**DI 7@
**SI 7@
**EI 7@
**DEL@
**EDIT PASC3/MU6C@
(FD!{CV!D!CV}!)E@
**DI 7@
**SI 7@
**EI 7@
DEL@
STOP@
::END@
@S27.2 INPUT OUTPUT LIBRARY FOR CROSS-COMPILER
@BThis uses OPASC4 (i.e. the source for the previous version
of PIO), since it is to be used in conjunction with a compiler
produced using the previous version of PASCAL;@
@
::BEGIN CPIOX FOR PAGED MACHINES@
DO 0 PIOXLOG %200@
FLIP MU6C:OPASC4 1 0 LB: ->LB; ->LB;@
PASC4@
ED@
(FD!::VAX!)E *FOR XMC3*@
(FD!::PTV!)E *FOR XMC5*@
(FD!::GEM!)E *FOR XMCG*@
(FD!::MU6!)E *FOR XMC7*@
DEFINEINPUT 7@
MUSL %0 BPIOX %5 25@
**TLSEG 0 %0 %00310000 -1 %6 *FOR XMC3* *FOR XMCG*@
**TLSEG 0 %0 %00600000 -1 %6 *FOR XMC5*@
**TLSEG 0 %0 %00C40000 -1 %6 *FOR XMC7*@
**TLSEG 1 %10000 %00210000 -3 %C *FOR XMC3* *FOR XMCG*@
**TLSEG 1 %00000 %005C0000 -3 %C *FOR XMC5*@
**TLSEG 1 %10000 %00840000 -3 %C *FOR XMC7*@
**TLSEG 2 %20 %0 -3 %C@
**TLLOAD 1 5@
**TLLOAD 2 4@
**SELECTINPUT 7@
ENDINPUT 7@
DEL@
STP@
::END@
@X {{ }}
@S27.3 PASCAL CROSS-COMPILER
@X {~ }^
::BEGIN CPASX FOR PAGED MACHINES@
DO 0 PASX\LOG %200@
LIB BPIOX@
PASCAL 0 BPASX\ %5 1@
**ED MU6C:PASC0@
S/program/I!@
(*$I-*)@
(*$R+*) *FOR XMC3* *FOR XMC7*@
**TLPRINT 4@
**TLSEG 0 0 %00360000 -1 6 *FOR XMC3* *FOR XMCG*@
**TLSEG 0 %1C000 %00680000 -1 6 *FOR XMC5*@
**TLSEG 0 0 %00D80000 -1 6 *FOR XMC7*@
**TLSEG 2 0 %00370000 -1 6 *FOR XMC3* *FOR XMCG*@
**TLSEG 2 0 %00DC0000 -1 6 *FOR XMC7*@
**TLSEG 3 0 %00380000 -1 6 *FOR XMC3* *FOR XMCG*@
**TLSEG 3 0 %00E00000 -1 6 *FOR XMC7*@
**TLLOAD 2 4 *FOR XMC3* *FOR XMCG*@
**TLLOAD 0 4 *FOR XMC5*@
**TLLOAD 2 4 *FOR XMC7*@
**TLLOAD 3 5 *FOR XMC3* *FOR XMCG*@
**TLLOAD 0 5 *FOR XMC5*@
**TLLOAD 3 5 *FOR XMC7*@
**TLSEG 4 0 %00230000 -3 %E *FOR XMC3* *FOR XMCG*@
**TLSEG 4 %20000 %00780000 -3 %E *FOR XMC5*@
**TLSEG 4 0 %008C0000 -3 %E *FOR XMC7*@
**TLLOAD 4 6@
**TLSEG 5 0 %220000 -3 %E *FOR XMC3* *FOR XMCG*@
**TLSEG 5 0 %880000 -3 %E *FOR XMC7*@
**TLLOAD 5 7 *FOR XMC3* *FOR XMCG*@
**TLLOAD 5 7 *FOR XMC7*@
**TLLOAD 4 7 *FOR XMC5*@
!C+2I! @
**TLMODE %404 @
**LIB MTLX\@
**LIB L2X\@
!(FD!{vax!D!vax}!)E *FOR XMC3*@
!(FD!{ptv!D!ptv}!)E *FOR XMC5*@
!(FD!{gem!D!gem}!)E *FOR XMCG*@
!(FD!{mu6!D!mu6}!)E *FOR XMC7*@
**ED *FOR XMC5* *FOR XMCG*@
(FD!{mc68000!d!mc68000}!)E *FOR XMC5* *FOR XMCG*@
**ED@
(FD!{any to vax!D!any to vax}!)E *FOR MC3*@
(FD!{any to mc68000!D!any to mc68000}!)E *FOR MC5* *FOR MC5G*@
(FD!{any to mu6!D!any to mu6}!)E *FOR MC7*@
**ED@
(FD!{any to ptv!d!any to ptv}!) *FOR MC5*@
(FD!{any to gem!D!any to gem}!) *FOR MC5G*@
E@
**IN
**IN MU6C:PASC1@
**IN MU6C:PASC2@
**IN MU6C:PASC3@
DEL@
STP@
::END@

@S27.4 PASCAL IO LIBRARY
::BEGIN CPIO FOR PAGED MACHINES@
DO 0 PIO\?LOG %200@
LIB MSLX@
LIB MTLX\@
LIB L2X\@
LIB LDIR\?@
OPENDIR MUSMC@
FLIP MU6C:PASC4 1 0 LB: ->LB; ->LB;@
PASC4@
ED@
(FD!::VAX!)E *FOR MC3*@
(FD!::PTV!)E *FOR MC5*@
(FD!::GEM!)E *FOR MC5G*@
(FD!::MU6!)E *FOR MC7*@
DEFINEINPUT 7@
MUSL %0 BPIO\? %5 25@
**TLPRINT %24@
**TLSEG 0 %00000000 %7FE30000 -1 %6 *FOR SYS MC3*@
**TLSEG 0 %00000000 %00EC0000 -1 %6 *FOR SYS MC5* *FOR SYS MC5G*@
**TLSEG 0 %00000000 %02800000 -1 %6 *FOR SYS MC7*@
**TLSEG 0 %00000000 %00310000 -1 %6 *FOR PRIV MC3* *FOR PRIV MC5G*@
**TLSEG 0 %00000000 %00600000 -1 %6 *FOR PRIV MC5*@
**TLSEG 0 %00000000 %00C40000 -1 %6 *FOR PRIV MC7*@
**TLSEG 1 %00000000 %00210000 -3 %C *FOR MC3* *FOR MC5G*@
**TLSEG 1 %00000000 %005C0000 -3 %C *FOR MC5*@
**TLSEG 1 %00040000 %00840000 -3 %C *FOR MC7*@
**TLSEG 2 %20 %0 -3 %C@
**TLLOAD 1 5@
**TLLOAD 2 4@
**SELECTINPUT 7@
ENDINPUT 7@
DEL@
STP@
::END@
@S27.5 COMPILE OF PASCAL
::BEGIN CPAS FOR PAGED MACHINES@
DO 0 PAS\?LOG %200@
LIB BPIOX@
LIB BPASX\@
LIB MTLX\@
LIB L2X\@
LIB LDIR\?@
OPENDIR MUSMC@
PASCAL 0 BPAS\? %5 1@
**ED MU6C:PASC0@
S!program!I!@
**TLSEG 0 0 %7FE00000 -1 6 *FOR SYS MC3*@
**TLSEG 0 %1C000 %00680000 -1 6 *FOR MC5*@
**TLSEG 0 %40000 %027C0000 -1 6 *FOR SYS MC7*@
**TLSEG 0 0 %00360000 -1 6 *FOR PRIV MC3* *FOR MC5G*@
**TLSEG 2 %0 %7FE10000 -1 6 *FOR SYS MC3*@
**TLSEG 2 %0 %00370000 -1 6 *FOR PRIV MC3* *FOR MC5G*@
**TLSEG 3 %0 %7FE20000 -1 6 *FOR SYS MC3*@
**TLSEG 3 %0 %00380000 -1 6 *FOR PRIV MC3* *FOR MC5G*@
**TLLOAD 2 4 *FOR MC3* *FOR MC5G*@
**TLLOAD 0 4 *FOR MC5* *FOR MC7*@
**TLLOAD 3 5 *FOR MC3* *FOR MC5G*@
**TLLOAD 0 5 *FOR MC5* *FOR MC7*@
**TLSEG 4 0 %230000 -3 %E *FOR MC3* *FOR MC5G*@
**TLSEG 4 0 %00780000 -3 %E *FOR MC5*@
**TLSEG 4 0 %00880000 -3 %E *FOR MC7*@
**TLLOAD 4 6@
**TLSEG 5 0 %220000 -3 %E *FOR MC3* *FOR MC5G*@
**TLLOAD 5 7 *FOR MC3* *FOR MC5G*@
**TLLOAD 4 7 *FOR MC5* *FOR MC7*
**TLPRINT 4@
!C+2I!**TLMODE %404@
(*$I-*)@
(*$R+*)    *FOR MC3* *FOR MC7*@
!(FD!{vax!D!vax}!)E *FOR MC3*@
!(FD!{ptv!D!ptv}!)E *FOR MC5*@
!(FD!{gem!d!gem}!)E *FOR MC5G*@
!(FD!{mu6!D!mu6}!)E *FOR MC7*@
**ED@
(FD!{mc68000!d!mc68000}!) *FOR MC5* *FOR MC5G*@
E@
**ED@
(FD!{any to vax!D!any to vax}!)E *FOR MC3*@
(FD!{any to mc68000!D!any to mc68000}!)E *FOR MC5* *FOR MC5G*@
(FD!{any to mu6!D!any to mu6}!)E *FOR MC7*@
**ED@
(FD!{any to ptv!D!any to ptv}!) *FOR MC5*@
(FD!{any to gem!D!any to gem}!) *FOR MC5G*@
E@
**IN
**IN MU6C:PASC1@
**IN MU6C:PASC2@
**IN MU6C:PASC3@
DEL@
*FOR TRANDIR*@
STP@
::END@
@
@X {{ }}
@F
