{* Area initialisation *} { All areas are buffered as the ten new areas. } { The following consts represent these areas in this interface } %constinteger Stack = 0, Code = 1, Gla = 2, { Unused = 3 } SST = 4, UST = 5, Diags = 6, Params = 7, IoTab = 8, ZGST = 9, Cnst = 10 %externalintegerfnspec PMarker(%integer HalfWords) { Mark CA for future PSetOpd and reserve HalfWords of code for plugging } { Also used to identify points in code to be used in PFix. } %externalroutinespec PSetOpD(%integer Mark, Offset, HalfWord) { Plug HalfWord at Marked code address plus Offset halfwords } %externalroutinespec PLabel(%integer LabelId) { Note a label at CA, LabelId being assigned by the code generator } %externalroutinespec PJump(%integer Op, LabelId, Mask) { Plant jump instruction, using LabelId to associate a label } %externalroutinespec PJIndex(%integer Op, Label, Reg1, Reg3) { Plant instruction as if it was a Branch on Index type } { No chacking of the Op is done, although a warning will be } { generated if the expected format is not RS. It is the } { responsibility of the code generator to do a PUsing within } { range of the label and to preserve the Using register until } { this jump. } {* Switch support *} %externalroutinespec PSwitch(%integer SSTAd,Lower,Upper) { Note a switch table is at SSTAd } %externalroutinespec PSwitchVal(%integer SSTAd, Index, Label) { Link Entry(Index) in switch table at SSTAd with Label } %externalroutinespec PSwitchLabel(%integer Switchid, Index) { Overwrite element no Index of switch at SSTAd with Ca } %externalroutinespec Psdefault(%integer SSTad,Label) { All unset entries in this switch to go to label} {* Code planting *} %externalroutinespec PB(%integer i) { put one byte } { Write 1 byte to Code area at Ca } %externalroutinespec PH(%integer Val) { Write 2 bytes to Code area at Ca } %externalroutinespec Popcode(%integer val) { Put opcode to Code area %externalroutinespec PW(%integer Val) { Write 4 bytes to Code area at Ca } %externalroutinespec Plit(%integer Lit,Size) { Output a literal chosing between Literal & Immediate forms} %externalroutinespec PBdisp(%integer Bmode,Val) { Write a two to five byte operand field } %externalroutinespec PFixdisp(%integer type,tgt,tgtdisp) { Write a one to four byte instruction displacement field } { And cause it to be relocated to point at 'area' } %externalroutinespec PCodeBytes(%integer Len, Ad) { Copy Len bytes from Ad into the Code area at Ca } {* Put Interface Passing of Data * *} %externalroutinespec PDBytes(%integer Area, Disp, Len, Ad) { Pass Len bytes of data from Ad to be placed at Disp in Area } { Areas used are the ten defined above } %externalroutinespec PD4(%integer Area, Disp, Value) { Plant a 4 byte Value at Disp in Area, using buffered areas } %externalroutinespec PDPattern(%integer Area, Disp, NCopies, Len, Ad) { Make NCopies of Len bytes from Ad at Disp in Area } {* Put Interface RELOCATION and REFERENCES *} %externalintegerfnspec PXname(%integer Typ,%string(255)%name S) { Create an external code reference } { Xrefs are used many times so establish mapping to integer ID early} { and save on holding/passing of strings } %externalroutinespec Pfix(%integer Hostarea, HostDisp, TgtArea,TgtDisp) { A relocation request: set word in HostArea at offset HostDisp bytes, } { to the address of area TargetArea, displacement = TargetDisp.} { If area is Code, TargetDisp is assumed to be a PMarker value, unless } { TargetDisp is zero, when head of code is assumed. } %externalroutinespec PDXRef(%integer Area,Offset,Length, %string(255)%name Name) { Define an external data reference } { Relocate word at Disp in Area by external data ref ExtName } %externalroutinespec PDataEntry(%string(255)%name Name, %integer Area, Maxlen, Disp) { Define a data entry in Area at Disp with Maxlen and called Name } {* The next five routinespecs deal with PROCEDURES *} !%externalintegerfnspec PEntry( %string(255)%name Iden) { Note a sideways entry point. If Index is zero make this the main EP } %externalroutinespec PProcEntry(%integer Ad) { Add a complete procedure entry from Ad. Used by LINK, MODIFY etc. } %externalroutinespec PProc(%string(31)%name Name, %integer Props, ParamW, %integername Id) { Start a new procedure. If Id is <0 no spec has been given by PXName. } { PROPS&1 = external } { PROPS>>31 = Main entry } %externalroutinespec Pcall(%integer id,Numpars) %externalroutinespec PProcEnd(%integer localsize) { End of routine } %externalintegerfnspec PnextSymbol { Supply Id for procedure spec } %externalintegerfnspec Pparamsize { Supply size of parameters of current routine in bytes. } {* Put Interface - Miscellaneous *} %externalintegerfnspec PCommon(%string(255)%name Name) { Note a new area identified by Iin with properties given by Props } %externalroutinespec PEndCommon(%integer Id,Length,Props) { End a Fortran Common area } %externalroutinespec Pfaulty { Code generator has encountered a user error. Code requests should no } { longer be checked and minimum work done in PUT } %externalroutinespec PLineStart(%integer Line) { Updates latest line number } %externalroutinespec PLineDecode { Decodes from the last PLineStart or PLineDecode } %externalroutinespec PInitialise(%integer Language, Properties, SourceAd) { Start code generation } { If Language=-1 then SourceAd is compiler or other source string7s } { string's address. Otherwise no source identifier for history records } { Properties&1#0 means Put to add multiples at head of each code area. } { Properties&2#0 means output a new code area at each PProcEnd. } %externalroutinespec PTerminate(%integer AdAreaSizes) { Code generator closes with this call } { Set Code size etc. } {* PGENERATE - FINAL PHASE OF COMPILATION IS CREATE OBJECT FILE *} %externalroutinespec PGenerateObject(%string(255) %name objfilename ) { Output object file for target system } { No effect on Amdahl. Need not be called. } %externalroutinespec PMonOn { Switches on internal Put tracing } %externalroutinespec PMonOff { Switches off internal Put tracing } %externalroutinespec PTraceOn %externalroutinespec PTraceOff