-- file: TexDviImpl.mesa
-- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:37 am PDT


DIRECTORY
  PascalBasic,
  PascalWizardFiles,
  TexTypes,
  TexSysdep,
  TexSysdepInline,
  TexInteraction,
  TexMemory,
  TexSymbols,
  TexScan,
  TexDvi,
  TexOps,
  TexBuildPage,
  TexExtensions;

TexDviImpl: PROGRAM IMPORTS PascalBasic, PascalWizardFiles, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexScan, TexDvi, TexOps, TexBuildPage, TexExtensions EXPORTS TexDvi = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexScan, TexDvi, TexOps, TexBuildPage, TexExtensions;
--:592----595:
DviBuf: LONG POINTER TO ARRAY DviIndex OF EightBits ← PascalStaticZone.NEW[ARRAY DviIndex OF EightBits];

HalfBuf: DviIndex;


DviLimit: DviIndex;

DviPtr: DviIndex;

DviOffset: PascalInteger;


DviGone: PascalInteger;
--:595----605:--
DownPtr: Halfword;

RightPtr: Halfword;
--:605----616:

DviH: Scaled;

DviV: Scaled;

CurH: Scaled;

CurV: Scaled;

DviF: InternalFontNumber;
--:597----598:
 DviSwap: PROCEDURE
 = 
BEGIN IF DviLimit=DviBufSize  THEN BEGIN WriteDvi[0,HalfBuf-1];
DviLimit←HalfBuf;DviOffset←DviOffset+DviBufSize;DviPtr←0;
 END  ELSE BEGIN WriteDvi[HalfBuf,DviBufSize-1];
DviLimit←DviBufSize; END;DviGone←DviGone+HalfBuf; END;--:598----600:
 DviFour: PROCEDURE[X: PascalInteger]
 = 
BEGIN IF X>=0  THEN BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[X ,24];
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[];
 END  ELSE BEGIN X←X+1073741824;X←X+1073741824;
BEGIN DviBuf↑[DviPtr]←( PascalDIVPower2[X ,24])+128;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END; END;X← PascalMODPower2Mask[X ,16777215];
BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[X ,16];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;X← PascalMODPower2Mask[X ,65535];
BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[X ,8];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]← PascalMODPower2Mask[X ,255];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END; END;--:600----601:
 DviPop: PROCEDURE[L: PascalInteger]
 = 
BEGIN IF(L=DviOffset+DviPtr)AND ( INT[DviPtr]>0) THEN DviPtr←DviPtr-1  ELSE
BEGIN DviBuf↑[DviPtr]←142;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END; END;--:601----602:
 DviFontDef: PROCEDURE[F: InternalFontNumber] = 
BEGIN K:PoolPointer;
 BEGIN DviBuf↑[DviPtr]←243;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;BEGIN DviBuf↑[DviPtr]←F-1;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←FontCheck↑[F].B0;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←FontCheck↑[F].B1;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←FontCheck↑[F].B2;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←FontCheck↑[F].B3;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;DviFour[FontSize↑[F]];
DviFour[FontDsize↑[F]];
BEGIN DviBuf↑[DviPtr]←( INT[StrStart↑[FontArea↑[F]+1]]-StrStart↑[FontArea↑[F
]]);DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←( INT[StrStart↑[FontName↑[F]+1]]-StrStart↑[FontName↑[F
]]);DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;--603:
FOR i:INT    IN [ INT[StrStart↑[FontArea↑[F]]].. INT[ INT[StrStart↑[FontArea↑[F]+1]]-1 ]] DO  K ← i; 
DviBuf↑[DviPtr]←StrPool↑[K];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; ENDLOOP;
FOR i:INT    IN [ INT[StrStart↑[FontName↑[F]]].. INT[ INT[StrStart↑[FontName↑[F]+1]]-1 ]] DO  K ← i; 
DviBuf↑[DviPtr]←StrPool↑[K];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[];--:603-- ENDLOOP; END;--:602----607:
 Movement: PROCEDURE[W: Scaled,O: EightBits] = 
BEGIN 
 Mstate:SmallNumber;P, Q:Halfword;K:PascalInteger; --610:-- Q←GetNode[3];
Mem[Q+1]↑.Int←W;Mem[Q+2]↑.Int←DviOffset+DviPtr;
IF O=157  THEN BEGIN Mem[Q]↑.Hh.Rh←DownPtr;DownPtr←Q;
 END  ELSE BEGIN Mem[Q]↑.Hh.Rh←RightPtr;RightPtr←Q; END;--611:
P←Mem[Q]↑.Hh.Rh;Mstate←0;
{{{WHILE P#0 DO BEGIN IF Mem[P+1]↑.Int=W  THEN--612:
SELECT  INT[Mstate]+Mem[P]↑.Hh.Lh FROM 3,4,15,16 =>IF Mem[P+2]↑.Int<DviGone  THEN 
GOTO Label45  ELSE--613:--BEGIN K←Mem[P+2]↑.Int-DviOffset;
IF K<0  THEN K←K+DviBufSize;DviBuf↑[K]←DviBuf↑[K]+5;Mem[P]↑.Hh.Lh←1;
 GOTO Label40; END--:613--;
5,9,11 =>IF Mem[P+2]↑.Int<DviGone  THEN  GOTO Label45  ELSE--614:
BEGIN K←Mem[P+2]↑.Int-DviOffset;IF K<0  THEN K←K+DviBufSize;
DviBuf↑[K]←DviBuf↑[K]+10;Mem[P]↑.Hh.Lh←2; GOTO Label40; END--:614--;
1,2,8,13 => GOTO Label40; ENDCASE => NULL--:612
 ELSE SELECT  INT[Mstate]+Mem[P]↑.Hh.Lh FROM 1 =>Mstate←6;2 =>Mstate←12;8,13 => GOTO Label45;
 ENDCASE => NULL;P←Mem[P]↑.Hh.Rh; END ENDLOOP ;EXITS Label45 => NULL};--:611--Mem[Q]↑.Hh.Lh←3;
IF ABS[W]>=8388608  THEN BEGIN BEGIN DviBuf↑[DviPtr]←O+3;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;DviFour[W];
 GOTO Label10; END;{{IF ABS[W]>=32768  THEN BEGIN BEGIN DviBuf↑[DviPtr]←O+2;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
IF W<0  THEN W←W+16777216;BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[W ,16];
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
W← PascalMODPower2Mask[W ,65535]; GOTO Label2; END;
IF ABS[W]>=128  THEN BEGIN BEGIN DviBuf↑[DviPtr]←O+1;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
IF W<0  THEN W←W+65536; GOTO Label2; END;BEGIN DviBuf↑[DviPtr]←O;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
IF W<0  THEN W←W+256; GOTO Label1;EXITS Label2 => NULL};BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[W ,8];
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
EXITS Label1 => NULL};BEGIN DviBuf↑[DviPtr]← PascalMODPower2Mask[W ,255];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END; GOTO Label10--:610--;EXITS Label40 => NULL};--609:
Mem[Q]↑.Hh.Lh←Mem[P]↑.Hh.Lh;
IF Mem[Q]↑.Hh.Lh=1  THEN BEGIN BEGIN DviBuf↑[DviPtr]←O+4;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
WHILE Mem[Q]↑.Hh.Rh#P DO BEGIN Q←Mem[Q]↑.Hh.Rh;
SELECT Mem[Q]↑.Hh.Lh FROM 3 =>Mem[Q]↑.Hh.Lh←5;4 =>Mem[Q]↑.Hh.Lh←6; ENDCASE => NULL; END ENDLOOP ;
 END  ELSE BEGIN BEGIN DviBuf↑[DviPtr]←O+9;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
WHILE Mem[Q]↑.Hh.Rh#P DO BEGIN Q←Mem[Q]↑.Hh.Rh;
SELECT Mem[Q]↑.Hh.Lh FROM 3 =>Mem[Q]↑.Hh.Lh←4;5 =>Mem[Q]↑.Hh.Lh←6; ENDCASE => NULL; END ENDLOOP ;
 END--:609--;EXITS Label10 => NULL}; END;--:607----615:-- PruneMovements: PROCEDURE[L: PascalInteger]
 = 
BEGIN  P:Halfword;
 {WHILE DownPtr#0 DO BEGIN IF Mem[DownPtr+2]↑.Int<L  THEN  GOTO Label30;
P←DownPtr;DownPtr←Mem[P]↑.Hh.Rh;FreeNode[P,3]; END ENDLOOP ;
EXITS Label30 => NULL};{WHILE RightPtr#0 DO BEGIN IF Mem[RightPtr+2]↑.Int<L  THEN  GOTO Label10;
P←RightPtr;RightPtr←Mem[P]↑.Hh.Rh;FreeNode[P,3]; END ENDLOOP ;EXITS Label10 => NULL}; END;--:615
 HlistOut: PROCEDURE
 = 
BEGIN  BaseLine:Scaled;LeftEdge:Scaled;
SaveH, SaveV:Scaled;ThisBox:Halfword;GOrder:GlueOrd;GSign:PascalInteger[0..2];
P:Halfword;SaveLoc:PascalInteger;LeaderBox:Halfword;LeaderWd:Scaled;
Lx:Scaled;OuterDoingLeaders:PascalBoolean;Edge:Scaled;
 ThisBox←TempPtr;GOrder←Mem[ThisBox+5]↑.Hh.B1;
GSign←Mem[ThisBox+5]↑.Hh.B0;P←Mem[ThisBox+5]↑.Hh.Rh;CurS←CurS+1;
IF CurS>0  THEN BEGIN DviBuf↑[DviPtr]←141;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
IF CurS>MaxPush  THEN MaxPush←CurS;SaveLoc←DviOffset+DviPtr;
BaseLine←CurV;LeftEdge←CurH;WHILE P#0 DO--620:
DO {IF( INT[P]>=HiMemMin) THEN BEGIN IF CurH#DviH  THEN BEGIN Movement[CurH
-DviH,143];DviH←CurH; END;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
DO F←Mem[P]↑.Hh.B0;C←Mem[P]↑.Hh.B1;IF F#DviF  THEN--621:
BEGIN IF  NOT FontUsed↑[F] THEN BEGIN DviFontDef[F];FontUsed↑[F]←TRUE;
 END;IF  INT[F]<=64  THEN BEGIN DviBuf↑[DviPtr]←F+170;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[];
 END  ELSE BEGIN BEGIN DviBuf↑[DviPtr]←235;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;BEGIN DviBuf↑[DviPtr]←F-1;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END; END;DviF←F;
 END--:621--;IF  INT[C]<128  THEN BEGIN DviBuf↑[DviPtr]←C;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[];
 END  ELSE BEGIN BEGIN DviBuf↑[DviPtr]←128;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;BEGIN DviBuf↑[DviPtr]←C;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END; END;
CurH←CurH+FontInfo↑[WidthBase↑[F]+FontInfo↑[CharBase↑[F]+C].Qqqq.B0].
Int;P←Mem[P]↑.Hh.Rh; IF NOT ( INT[P]>=HiMemMin) THEN EXIT; ENDLOOP;DviH←CurH; END  ELSE--622:
BEGIN {{{SELECT Mem[P]↑.Hh.B0 FROM 0,1 =>--623:
IF Mem[P+5]↑.Hh.Rh=0  THEN CurH←CurH+Mem[P+1]↑.Int  ELSE BEGIN SaveH←
DviH;SaveV←DviV;CurV←BaseLine+Mem[P+4]↑.Int;TempPtr←P;
Edge←CurH;IF Mem[P]↑.Hh.B0=1  THEN VlistOut [] ELSE HlistOut[];
DviH←SaveH;DviV←SaveV;CurH←Edge+Mem[P+1]↑.Int;CurV←BaseLine;
 END--:623--;2 =>BEGIN RuleHt←Mem[P+3]↑.Int;RuleDp←Mem[P+2]↑.Int;
RuleWd←Mem[P+1]↑.Int; GOTO Label14; END;8 =>--1366:--OutWhat[P]--:1366--;10 =>--625:
BEGIN G←Mem[P+1]↑.Hh.Lh;RuleWd←Mem[G+1]↑.Int;
IF GSign#0  THEN BEGIN IF GSign=1  THEN BEGIN IF Mem[G]↑.Hh.B0=GOrder
 THEN RuleWd←RuleWd+PascalROUND[Mem[ThisBox+6]↑.Gr*PascalFLOAT[Mem[G+2]↑.Int]];
 END  ELSE BEGIN IF Mem[G]↑.Hh.B1=GOrder  THEN RuleWd←RuleWd-PascalROUND[Mem[
ThisBox+6]↑.Gr*PascalFLOAT[Mem[G+3]↑.Int]]; END; END;IF  INT[Mem[P]↑.Hh.B1]>=100  THEN--626:
BEGIN LeaderBox←Mem[P+1]↑.Hh.Rh;
IF Mem[LeaderBox]↑.Hh.B0=2  THEN BEGIN RuleHt←Mem[LeaderBox+3]↑.Int;
RuleDp←Mem[LeaderBox+2]↑.Int; GOTO Label14; END;
LeaderWd←Mem[LeaderBox+1]↑.Int;
IF(LeaderWd>0)AND (RuleWd>0) THEN BEGIN Edge←CurH+RuleWd;Lx←0;--627:
IF Mem[P]↑.Hh.B1=100  THEN BEGIN SaveH←CurH;
CurH←LeftEdge+LeaderWd*( (CurH-LeftEdge)/LeaderWd);
IF CurH<SaveH  THEN CurH←CurH+LeaderWd;
 END  ELSE BEGIN Lq← RuleWd /LeaderWd;Lr← RuleWd MOD LeaderWd;
IF Mem[P]↑.Hh.B1=101  THEN CurH←CurH+( PascalDIVPower2[Lr ,1]) ELSE BEGIN Lx←(2*Lr+Lq
+1)/(2*Lq+2);CurH←CurH+( PascalDIVPower2[(Lr-(Lq-1)*Lx),1]); END; END--:627--;
WHILE CurH+LeaderWd<=Edge DO--628:
BEGIN CurV←BaseLine+Mem[LeaderBox+4]↑.Int;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
SaveV←DviV;IF CurH#DviH  THEN BEGIN Movement[CurH-DviH,143];
DviH←CurH; END;SaveH←DviH;TempPtr←LeaderBox;
OuterDoingLeaders←DoingLeaders;DoingLeaders←TRUE;
IF Mem[LeaderBox]↑.Hh.B0=1  THEN VlistOut [] ELSE HlistOut[];
DoingLeaders←OuterDoingLeaders;DviV←SaveV;DviH←SaveH;
CurV←SaveV;CurH←SaveH+LeaderWd+Lx; END--:628-- ENDLOOP ;CurH←Edge; GOTO Label15;
 END; END--:626--; GOTO Label13; END--:625--;11,9 =>CurH←CurH+Mem[P+1]↑.Int;6 =>--652:
BEGIN Mem[64988]↑←Mem[P+1]↑;Mem[64988]↑.Hh.Rh←Mem[P]↑.Hh.Rh;P←64988;
 GOTO Label21; END--:652--; ENDCASE => NULL; GOTO Label15;EXITS Label14 => NULL};--624:
IF(RuleHt=-1073741824) THEN RuleHt←Mem[ThisBox+3]↑.Int;
IF(RuleDp=-1073741824) THEN RuleDp←Mem[ThisBox+2]↑.Int;
RuleHt←RuleHt+RuleDp;
IF(RuleHt>0)AND (RuleWd>0) THEN BEGIN IF CurH#DviH  THEN BEGIN
Movement[CurH-DviH,143];DviH←CurH; END;CurV←BaseLine+RuleDp;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
BEGIN DviBuf↑[DviPtr]←132;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;DviFour[RuleHt];
DviFour[RuleWd];CurV←BaseLine;DviH←DviH+RuleWd; END--:624--;
EXITS Label13 => NULL};CurH←CurH+RuleWd;EXITS Label15 => NULL};P←Mem[P]↑.Hh.Rh; END--:622----:620--; EXIT; EXITS Label21 => NULL} ENDLOOP ENDLOOP ;
PruneMovements[SaveLoc];IF CurS>0  THEN DviPop[SaveLoc];
CurS←CurS-1; END;--:619----629:-- --618:-- VlistOut: PROCEDURE = 
BEGIN 
 LeftEdge:Scaled;TopEdge:Scaled;SaveH, SaveV:Scaled;
ThisBox:Halfword;GOrder:GlueOrd;GSign:PascalInteger[0..2];P:Halfword;
SaveLoc:PascalInteger;LeaderBox:Halfword;LeaderHt:Scaled;Lx:Scaled;
OuterDoingLeaders:PascalBoolean;Edge:Scaled; ThisBox←TempPtr;
GOrder←Mem[ThisBox+5]↑.Hh.B1;GSign←Mem[ThisBox+5]↑.Hh.B0;
P←Mem[ThisBox+5]↑.Hh.Rh;CurS←CurS+1;
IF CurS>0  THEN BEGIN DviBuf↑[DviPtr]←141;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
IF CurS>MaxPush  THEN MaxPush←CurS;SaveLoc←DviOffset+DviPtr;
LeftEdge←CurH;CurV←CurV-Mem[ThisBox+3]↑.Int;TopEdge←CurV;
WHILE P#0 DO--630:--BEGIN {IF( INT[P]>=HiMemMin) THEN Confusion[685] ELSE--631:
BEGIN {{SELECT Mem[P]↑.Hh.B0 FROM 0,1 =>--632:
IF Mem[P+5]↑.Hh.Rh=0  THEN CurV←CurV+Mem[P+3]↑.Int+Mem[P+2]↑.Int  ELSE
BEGIN CurV←CurV+Mem[P+3]↑.Int;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
SaveH←DviH;SaveV←DviV;CurH←LeftEdge+Mem[P+4]↑.Int;TempPtr←P;
IF Mem[P]↑.Hh.B0=1  THEN VlistOut [] ELSE HlistOut[];DviH←SaveH;
DviV←SaveV;CurV←SaveV+Mem[P+2]↑.Int;CurH←LeftEdge; END--:632--;
2 =>BEGIN RuleHt←Mem[P+3]↑.Int;RuleDp←Mem[P+2]↑.Int;
RuleWd←Mem[P+1]↑.Int; GOTO Label14; END;8 =>--1365:--OutWhat[P]--:1365--;10 =>--634:
BEGIN G←Mem[P+1]↑.Hh.Lh;RuleHt←Mem[G+1]↑.Int;
IF GSign#0  THEN BEGIN IF GSign=1  THEN BEGIN IF Mem[G]↑.Hh.B0=GOrder
 THEN RuleHt←RuleHt+PascalROUND[Mem[ThisBox+6]↑.Gr*PascalFLOAT[Mem[G+2]↑.Int]];
 END  ELSE BEGIN IF Mem[G]↑.Hh.B1=GOrder  THEN RuleHt←RuleHt-PascalROUND[Mem[
ThisBox+6]↑.Gr*PascalFLOAT[Mem[G+3]↑.Int]]; END; END;IF  INT[Mem[P]↑.Hh.B1]>=100  THEN--635:
BEGIN LeaderBox←Mem[P+1]↑.Hh.Rh;
IF Mem[LeaderBox]↑.Hh.B0=2  THEN BEGIN RuleWd←Mem[LeaderBox+1]↑.Int;
RuleDp←0; GOTO Label14; END;
LeaderHt←Mem[LeaderBox+3]↑.Int+Mem[LeaderBox+2]↑.Int;
IF(LeaderHt>0)AND (RuleHt>0) THEN BEGIN Edge←CurV+RuleHt;Lx←0;--636:
IF Mem[P]↑.Hh.B1=100  THEN BEGIN SaveV←CurV;
CurV←TopEdge+LeaderHt*( (CurV-TopEdge)/LeaderHt);
IF CurV<SaveV  THEN CurV←CurV+LeaderHt;
 END  ELSE BEGIN Lq← RuleHt /LeaderHt;Lr← RuleHt MOD LeaderHt;
IF Mem[P]↑.Hh.B1=101  THEN CurV←CurV+( PascalDIVPower2[Lr ,1]) ELSE BEGIN Lx←(2*Lr+Lq
+1)/(2*Lq+2);CurV←CurV+( PascalDIVPower2[(Lr-(Lq-1)*Lx),1]); END; END--:636--;
WHILE CurV+LeaderHt<=Edge DO--637:
BEGIN CurH←LeftEdge+Mem[LeaderBox+4]↑.Int;
IF CurH#DviH  THEN BEGIN Movement[CurH-DviH,143];DviH←CurH; END;
SaveH←DviH;CurV←CurV+Mem[LeaderBox+3]↑.Int;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
SaveV←DviV;TempPtr←LeaderBox;OuterDoingLeaders←DoingLeaders;
DoingLeaders←TRUE;
IF Mem[LeaderBox]↑.Hh.B0=1  THEN VlistOut [] ELSE HlistOut[];
DoingLeaders←OuterDoingLeaders;DviV←SaveV;DviH←SaveH;
CurH←SaveH;CurV←SaveV-Mem[LeaderBox+3]↑.Int+LeaderHt+Lx; END--:637
 ENDLOOP ;CurV←Edge; GOTO Label15; END; END--:635--; GOTO Label13; END--:634--;
11 =>CurV←CurV+Mem[P+1]↑.Int; ENDCASE => NULL; GOTO Label15;EXITS Label14 => NULL};--633:
IF(RuleWd=-1073741824) THEN RuleWd←Mem[ThisBox+1]↑.Int;
RuleHt←RuleHt+RuleDp;CurV←CurV+RuleHt;
IF(RuleHt>0)AND (RuleWd>0) THEN BEGIN IF CurH#DviH  THEN BEGIN
Movement[CurH-DviH,143];DviH←CurH; END;
IF CurV#DviV  THEN BEGIN Movement[CurV-DviV,157];DviV←CurV; END;
BEGIN DviBuf↑[DviPtr]←137;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;DviFour[RuleHt];
DviFour[RuleWd]; END; GOTO Label15--:633--;EXITS Label13 => NULL};CurV←CurV+RuleHt; END--:631--;
EXITS Label15 => NULL};P←Mem[P]↑.Hh.Rh; END--:630-- ENDLOOP ;PruneMovements[SaveLoc];
IF CurS>0  THEN DviPop[SaveLoc];CurS←CurS-1; END;--:629----638:----1377:
 ShipOut: PROCEDURE[P: Halfword] = 
BEGIN  PageLoc:PascalInteger;J, K:PascalInteger[0..9];
S:PoolPointer;OldSetting:PascalInteger[0..21];
   IF Eqtb↑[4801].Int>0  THEN BEGIN PrintNl[210];PrintLn[];Print[686];
 END;
IF  INT[TermOffset]>MaxPrintLine-9  THEN PrintLn [] ELSE IF( INT[TermOffset]>0)OR (
 INT[FileOffset]>0) THEN PrintChar[32];PrintChar[91];J←9;
WHILE(Eqtb↑[4817+J].Int=0)AND ( INT[J]>0)DO J←J-1 ENDLOOP ;
FOR i:INT    IN [ INT[0 ].. INT[J ]] DO  K ← i;  PrintInt[Eqtb↑[4817+K].Int];
IF  INT[K]<J  THEN PrintChar[46]; ENDLOOP;PascalTextBREAK[file: @TermOut];
IF Eqtb↑[4801].Int>0  THEN BEGIN PrintChar[93];BeginDiagnostic[];
ShowBox[P];EndDiagnostic[TRUE]; END;--640:----641:
{IF(Mem[P+3]↑.Int>1073741823)OR (Mem[P+2]↑.Int>1073741823)OR (
Mem[P+3]↑.Int+Mem[P+2]↑.Int+Eqtb↑[5220].Int>1073741823)OR (
Mem[P+1]↑.Int+Eqtb↑[5219].Int>1073741823) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[690]; END;BEGIN HelpPtr←2;HelpLine↑[1]←691;HelpLine↑[0]←692;
 END;Error[];IF Eqtb↑[4801].Int<=0  THEN BEGIN BeginDiagnostic[];
PrintNl[693];ShowBox[P];EndDiagnostic[TRUE]; END; GOTO Label30; END;
IF Mem[P+3]↑.Int+Mem[P+2]↑.Int+Eqtb↑[5220].Int>MaxV  THEN MaxV←Mem[P+3]↑.
Int+Mem[P+2]↑.Int+Eqtb↑[5220].Int;
IF Mem[P+1]↑.Int+Eqtb↑[5219].Int>MaxH  THEN MaxH←Mem[P+1]↑.Int+Eqtb↑[5219]
.Int--:641--;--617:--DviH←0;DviV←0;CurH←Eqtb↑[5219].Int;DviF←0;
CurS←-1;PrepareMag[];
IF UsePressFormat  THEN BEGIN  IF OutputFileName=0  THEN BEGIN IF
JobName=0  THEN OpenLogFile[];PackJobName[650];
WHILE  NOT PressOpenOut []DO PromptFileName[651,650] ENDLOOP ;
OutputFileName←PressMakeNameString[]; END;IF TotalPages=0  THEN NULL;
 END  ELSE BEGIN IF OutputFileName=0  THEN BEGIN IF JobName=0  THEN
OpenLogFile[];PackJobName[652];
WHILE  NOT BOpenOut[@DviFile]DO PromptFileName[651,652] ENDLOOP ;
OutputFileName←BMakeNameString[@DviFile]; END;
IF TotalPages=0  THEN BEGIN BEGIN DviBuf↑[DviPtr]←247;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]←2;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;DviFour[25400000];
DviFour[473628672];PrepareMag[];DviFour[Eqtb↑[4784].Int];
OldSetting←Selector;Selector←21;Print[684];PrintInt[Eqtb↑[4790].Int];
PrintChar[46];PrintTwo[Eqtb↑[4789].Int];PrintChar[46];
PrintTwo[Eqtb↑[4788].Int];PrintChar[58];
PrintTwo[ Eqtb↑[4787].Int /60];PrintTwo[ Eqtb↑[4787].Int MOD 60];
Selector←OldSetting;
BEGIN DviBuf↑[DviPtr]←( INT[PoolPtr]-StrStart↑[StrPtr]);
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
FOR i:INT    IN [ INT[StrStart↑[StrPtr]].. INT[ INT[PoolPtr]-1 ]] DO  S ← i;  DviBuf↑[DviPtr]←
StrPool↑[S];DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; ENDLOOP;
PoolPtr←StrStart↑[StrPtr]; END; END--:617--;
IF UsePressFormat  THEN BEGIN CurV←Mem[P+3]↑.Int+Eqtb↑[5220].Int;
TempPtr←P;IF Mem[P]↑.Hh.B0=1  THEN VlistPressOut [] ELSE HlistPressOut[];
PressWritePage[];TotalPages←TotalPages+1;
 END  ELSE BEGIN PageLoc←DviOffset+DviPtr;BEGIN DviBuf↑[DviPtr]←139;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
FOR i:INT    IN [ INT[0 ].. INT[9 ]] DO  K ← i; DviFour[Eqtb↑[4817+K].Int] ENDLOOP;DviFour[LastBop];
LastBop←PageLoc;CurV←Mem[P+3]↑.Int+Eqtb↑[5220].Int;TempPtr←P;
IF Mem[P]↑.Hh.B0=1  THEN VlistOut [] ELSE HlistOut[];
BEGIN DviBuf↑[DviPtr]←140;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;TotalPages←TotalPages+1; END;
EXITS Label30 => NULL};--:640--IF Eqtb↑[4801].Int<=0  THEN PrintChar[93];DeadCycles←0;
PascalTextBREAK[file: @TermOut];--639:--IF Eqtb↑[4798].Int>1  THEN BEGIN PrintNl[687];
PrintInt[VarUsed];PrintChar[38];PrintInt[DynUsed];PrintChar[59];
 END;FlushNodeList[P];IF Eqtb↑[4798].Int>1  THEN BEGIN Print[688];
PrintInt[VarUsed];PrintChar[38];PrintInt[DynUsed];Print[689];
PrintInt[ INT[HiMemMin]-LoMemMax-1];PrintLn[]; END;--:639-- END;--:638----645:

END.