{ History ------- 11/09/85 - new include files impint.pf, storage.pf, expand FutureBlockLabel & ExternalBlockLabel. 17/10/85 - expand InitEmitter, EndEmitter; new proc ForwardBlockLabel. 18/10/85 - history tidied. (agh) 21/10/85 - Reformatted. Minor cleanup to ExternalBlockLabel by removing nested with-statements. (agh) 06/12/85 - Fill Areas array and pass to MC-Generator. (agh) 09/12/85 - Initialise runtime system. (agh) 17/12/85 - Remove parametrer from calls to enpr. (agh) --------------------------------------------------------------------- 09/01/86 - Remove call to pasexnm in InitRtSystem. Make the call prior to first actual call to the routine in procedure StartCall (in codeutils.pas). (agh) 09/01/86 - Change actual parameter to Eterminate to Area[Code]. (agh) --------------------------------------------------------------------- 10/01/86 - Pass address of GlaOffset in call to Einitialise. Use functions wptr and MCAddress to generate a word address on the PERQ2. (agh) --------------------------------------------------------------------- 12/02/86 - Modify FutureBlockLabel. Make ForwardBlockLabel dummy. } { MODULE 17 Block HouseKeeping and Data Initialisation } program BlockControl; #include "globals.x" #include "impint.pf" #include "generator.pf" {+doc 17.1 Data Initialisation } procedure OpenPresetSpace(Representation: TypeRepresentation); visible; begin end; procedure InxPreset(PackedArray: Boolean; LowIndex, HighIndex, LowBound: ObjectValue; Representation: TypeRepresentation); visible; begin end; procedure FieldPreset(Field: FieldOffset); visible; begin end; procedure PresetSelector(VarPartRep, VariantRep: TypeRepresentation); visible; begin end; procedure AssignPreset; visible; begin end; procedure CopyPreset; visible; begin end; procedure StackPreset; visible; begin end; procedure ClsPresetSpace; visible; begin end; {+doc 17.2 Block HouseKeeping } procedure FutureBlockLabel(BlockId: IdEntry); visible; begin with BlockId^ do case Klass of Proc, Func : with CodeBody do begin BlockLevel := Framelevel; Adid := AlfaString(Name); if PfDecKind<>Predefined then LabelId:=pasenpr else LabelId := -1 end; Prog : with ProgBody do begin BlockLevel := Framelevel; Adid := AlfaString(Name); LabelId := pasenpr end end end { futureblocklabel }; procedure ExternalBlockLabel(BlockId: IdEntry); visible; begin with BlockId^.CodeBody do begin BlockLevel := FrameLevel; LabelId := pasexnm(0, Adid) end end { ExternalBlockLabel }; procedure ForwardBlockLabel(BlockId: IdEntry); visible; begin end; { ForwardBlockLabel} procedure OpenCodeSpace(var L: BlockLabel); visible; begin end; procedure CloseCodeSpace; visible; begin end; { Initialisation and finalisation of the overall code filing process is carried out by the procedures InitEmitter and EndEmitter. This includes output of the option words to the start of the code file, the creation of an initial code-space which corresponds to a pseudo-block surrounding the compiled program, and output of the number of data words created by this pseudo-block (which deter- mines the position of the program block entry within it). } procedure InitEmitter; visible; begin CodeIsToBeGenerated := true; Einitialise (Pascal, ArrayString(Heading), MCAddress(wptr(Area[Stack])), MCAddress(wptr(GlaOffset)), 0) end { initemitter }; procedure InitRtSystem; visible; procedure Enter(Routine: Intrinsic; RtId, ParamNum, ParamSize: integer); begin with RtSystem[Routine] do begin Adid := RtId; LabelId := -1; PNumber := ParamNum; PSize := ParamSize end end { Enter }; begin { Enter } Enter(p_presetf, ArrayString('p_presetf'), 2, 8); Enter(p_postsetf, ArrayString('p_postsetf'), 2, 8); Enter(p_bindf, ArrayString('p_bindf'), 1, 4); Enter(p_get, ArrayString('p_get'), 1, 4); Enter(p_put, ArrayString('p_put'), 1, 4); Enter(p_close, ArrayString('p_close'), 1, 4); Enter(p_resetf, ArrayString('p_resetf'), 5, 20); Enter(p_rewritef, ArrayString('p_rewritef'), 5, 20); Enter(p_appendf, ArrayString('p_appendf'), 5, 20); Enter(p_eof, ArrayString('p_eof'), 1, 4); Enter(p_eol, ArrayString('p_eol'), 1, 4); Enter(p_readi, ArrayString('p_readi'), 1, 4); Enter(p_readr, ArrayString('p_readr'), 1, 8); Enter(p_wri, ArrayString('p_wri'), 3, 12); Enter(p_wrfx, ArrayString('p_wrfx'), 4, 20); Enter(p_wrc, ArrayString('p-wrc'), 3, 12); Enter(p_wrb, ArrayString('p_wrb'), 3, 12); Enter(p_wrfl, ArrayString('p_wrfl'), 3, 16); Enter(p_wrw, ArrayString('p_wrw'), 4, 16); Enter(p_wrst, ArrayString('p_wrst'), 4, 16); Enter(p_rdln, ArrayString('p_rdln'), 1, 4); Enter(p_wrln, ArrayString('p_wrln'), 1, 4); Enter(p_lines, ArrayString('p_lines'), 2, 8); Enter(p_page, ArrayString('p_page'), 1, 4); Enter(p_pack, ArrayString('p_pack'), 5, 20); Enter(p_unpack, ArrayString('p_unpack'), 5, 20); Enter(p_new1, ArrayString('p_new1'), 2, 8); Enter(p_new2, ArrayString('p_new2'), 3 ,12); Enter(p_dispose1, ArrayString('p_dispose1'), 2, 8); Enter(p_dispose2, ArrayString('p_dispose2'), 3, 12); Enter(p_sin, ArrayString('p_sin'), 1, 8); Enter(p_cos, ArrayString('p_cos'), 1, 8); Enter(p_exp, ArrayString('p_exp'), 1, 8); Enter(p_log, ArrayString('p_log'), 1, 8); Enter(p_sqrt, ArrayString('p_sqrt'), 1, 8); Enter(p_arctan, ArrayString('p_arctan'), 1, 8); Enter(p_icldate, ArrayString('p_icldate'), 1, 4); Enter(p_icltime, ArrayString('p_icltime'), 1, 4); Enter(p_mon, ArrayString('p_mon'), 0, 0); Enter(p_trap, ArrayString('p_trap'), 1, 4); Enter(p_init, ArrayString('p_init'), 0, 0); Enter(p_end, ArrayString('p_end'), 0, 0) end { InitRtSystem }; procedure EndEmitter; visible; begin Area[Gla] := GlaOffset; Area[GST] := GstOffset; Area[Static] := StatOffset; Eterminate(MCAddress(wptr(Area[Code]))) end; begin { end of module } end.