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


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

TexFinalizeImpl: PROGRAM IMPORTS PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexScan, TexDvi, TexOps, TexParagraph, TexBuildPage, TexRest EXPORTS TexRest = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexScan, TexDvi, TexOps, TexParagraph, TexBuildPage, TexRest;
 StoreFmtFile: PROCEDURE = 
BEGIN 
 J, K, L:PascalInteger;P, Q:Halfword;X:PascalInteger;W:FourQuarters;--1304:
IF SavePtr#0  THEN BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[1109]; END;BEGIN HelpPtr←1;HelpLine↑[0]←1110; END;
BEGIN IF Interaction=3  THEN Interaction←2;Error[];
IF  INT[Interaction]>0  THEN DebugHelp[];History←3;JumpOut[]; END; END--:1304--;
--1328:--Selector←21;Print[1121];Print[JobName];PrintChar[32];
PrintInt[ Eqtb↑[4790].Int MOD 100];PrintChar[46];
PrintInt[Eqtb↑[4789].Int];PrintChar[46];PrintInt[Eqtb↑[4788].Int];
PrintChar[41];IF Interaction=0  THEN Selector←18  ELSE Selector←19;
BEGIN IF  INT[PoolPtr+1]>PoolSize  THEN Overflow[129,PoolSize-InitPoolPtr]
; END;FormatIdent←MakeString[];PackJobName[1122];
WHILE  NOT WOpenOut[@FmtFile]DO PromptFileName[1123,1122] ENDLOOP ;
PrintNl[1124];Print[WMakeNameString[@FmtFile]];
BEGIN StrPtr←StrPtr-1;PoolPtr←StrStart↑[StrPtr]; END;
PrintNl[FormatIdent]--:1328--;--1307:--BEGIN FmtFile.element.Int←94919885;
PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←0;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←65000;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←5476;
PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←2129;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←307;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END--:1307--;--1309:
BEGIN FmtFile.element.Int←PoolPtr;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←StrPtr;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[0 ].. INT[StrPtr ]] DO  K ← i;  FmtFile.element.Int←StrStart↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element];
 ENDLOOP;K←0;WHILE K+4<PoolPtr DO BEGIN W.B0←StrPool↑[K];
W.B1←StrPool↑[K+1];W.B2←StrPool↑[K+2];W.B3←StrPool↑[K+3];
BEGIN FmtFile.element.Qqqq←W;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;K←K+4; END ENDLOOP ;K← INT[PoolPtr]-4;
W.B0←StrPool↑[K];W.B1←StrPool↑[K+1];W.B2←StrPool↑[K+2];
W.B3←StrPool↑[K+3];BEGIN FmtFile.element.Qqqq←W;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;PrintLn[];
PrintInt[StrPtr];Print[1111];PrintInt[PoolPtr]--:1309--;--1311:
SortAvail[];VarUsed←0;BEGIN FmtFile.element.Int←LoMemMax;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element];
 END;BEGIN FmtFile.element.Int←Rover;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;P←0;Q←Rover;X←0;
DO FOR i:INT    IN [ INT[P ].. INT[Q+1 ]] DO  K ← i;  FmtFile.element←Mem[K]↑;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; ENDLOOP;
X←X+Q+2-P;VarUsed←VarUsed+Q-P;P← INT[Q]+Mem[Q]↑.Hh.Lh;Q←Mem[Q+1]↑.Hh.Rh;
 IF Q=Rover THEN EXIT; ENDLOOP;VarUsed←VarUsed+LoMemMax-P;
DynUsed← INT[MemEnd+1]-HiMemMin;
FOR i:INT    IN [ INT[P ].. INT[LoMemMax ]] DO  K ← i;  FmtFile.element←Mem[K]↑;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; ENDLOOP;
X←X+LoMemMax+1-P;BEGIN FmtFile.element.Int←HiMemMin;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←Avail;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[HiMemMin ].. INT[MemEnd ]] DO  K ← i;  FmtFile.element←Mem[K]↑;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element];
 ENDLOOP;X←X+MemEnd+1-HiMemMin;P←Avail;
WHILE P#0 DO BEGIN DynUsed←DynUsed-1;P←Mem[P]↑.Hh.Rh; END ENDLOOP ;
BEGIN FmtFile.element.Int←VarUsed;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←DynUsed;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;PrintLn[];PrintInt[X];
Print[1112];PrintInt[VarUsed];PrintChar[38];
PrintInt[DynUsed]--:1311--;--1313:----1315:--K←1;DO J←K;
{{WHILE J<4766 DO BEGIN IF(Eqtb↑[J].Hh.Rh=Eqtb↑[J+1].Hh.Rh)AND (Eqtb↑[J].Hh.B0
=Eqtb↑[J+1].Hh.B0)AND (Eqtb↑[J].Hh.B1=Eqtb↑[J+1].Hh.B1) THEN  GOTO Label41;J←J+1;
 END ENDLOOP ;L←4767; GOTO Label31;EXITS Label41 => NULL};J←J+1;L←J;
WHILE J<4766 DO BEGIN IF(Eqtb↑[J].Hh.Rh#Eqtb↑[J+1].Hh.Rh)OR (Eqtb↑[J].Hh.B0
#Eqtb↑[J+1].Hh.B0)OR (Eqtb↑[J].Hh.B1#Eqtb↑[J+1].Hh.B1) THEN  GOTO Label31;J←J+1;
 END ENDLOOP ;EXITS Label31 => NULL};BEGIN FmtFile.element.Int←L-K;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
WHILE K<L DO BEGIN BEGIN FmtFile.element←Eqtb↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;K←K+1;
 END ENDLOOP ;K←J+1;BEGIN FmtFile.element.Int←K-L;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
 IF K=4767--:1315-- THEN EXIT; ENDLOOP;--1316:--DO J←K;
{{WHILE J<5476 DO BEGIN IF Eqtb↑[J].Int=Eqtb↑[J+1].Int  THEN  GOTO Label42;J←J+1;
 END ENDLOOP ;L←5477; GOTO Label32;EXITS Label42 => NULL};J←J+1;L←J;
WHILE J<5476 DO BEGIN IF Eqtb↑[J].Int#Eqtb↑[J+1].Int  THEN  GOTO Label32;J←J+1;
 END ENDLOOP ;EXITS Label32 => NULL};BEGIN FmtFile.element.Int←L-K;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
WHILE K<L DO BEGIN BEGIN FmtFile.element←Eqtb↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;K←K+1;
 END ENDLOOP ;K←J+1;BEGIN FmtFile.element.Int←K-L;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
 IF K>5476--:1316-- THEN EXIT; ENDLOOP;BEGIN FmtFile.element.Int←ParLoc;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←WriteLoc;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;--1318:
BEGIN FmtFile.element.Int←HashUsed;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
CsCount← INT[2757]-HashUsed;
FOR i:INT    IN [ INT[258 ].. INT[HashUsed ]] DO  P ← i; IF Hash↑[P].Rh#0  THEN BEGIN BEGIN FmtFile.element.
Int←P;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Hh←Hash↑[P];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
CsCount←CsCount+1; END ENDLOOP;
FOR i:INT    IN [ INT[HashUsed+1 ].. INT[3024 ]] DO  P ← i;  FmtFile.element.Hh←Hash↑[P];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element];
 ENDLOOP;BEGIN FmtFile.element.Int←CsCount;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;PrintLn[];
PrintInt[CsCount];Print[1113]--:1318----:1313--;--1320:
BEGIN FmtFile.element.Int←FmemPtr;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[0 ].. INT[FmemPtr-1 ]] DO  K ← i;  FmtFile.element←FontInfo↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element];
 ENDLOOP;BEGIN FmtFile.element.Int←FontPtr;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[0 ].. INT[FontPtr ]] DO --1322:--K ← i;  BEGIN FmtFile.element.Qqqq←FontCheck↑[K];
PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←FontSize↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontDsize↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontParams↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←HyphenChar↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←SkewChar↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontFamily↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontFace↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontName↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontArea↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontBc↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontEc↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←CharBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←WidthBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←HeightBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←DepthBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←ItalicBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←LigKernBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←KernBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←ExtenBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←ParamBase↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FontGlue↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;PrintNl[1116];
PrintEsc[Hash↑[2768+K].Rh];PrintChar[61];
PrintFileName[FontName↑[K],FontArea↑[K],210];
IF FontSize↑[K]#FontDsize↑[K] THEN BEGIN Print[601];
PrintScaled[FontSize↑[K]];Print[265]; END;--:1322-- ENDLOOP;PrintLn[];
PrintInt[FmemPtr-7];Print[1114];PrintInt[FontPtr-0];Print[1115];
IF FontPtr#1  THEN PrintChar[115]--:1320--;--1324:
BEGIN FmtFile.element.Int←HyphCount;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[0 ].. INT[307 ]] DO  K ← i; IF HyphWord↑[K]#0  THEN BEGIN BEGIN FmtFile.element.Int←K;
PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←HyphWord↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←HyphList↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END; END ENDLOOP;
BEGIN FmtFile.element.Int←TrieMax;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[0 ].. INT[TrieMax ]] DO  K ← i;  FmtFile.element.Hh←Trie↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; ENDLOOP;
BEGIN FmtFile.element.Int←TrieOpPtr;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
FOR i:INT    IN [ INT[1 ].. INT[TrieOpPtr ]] DO  K ← i;  BEGIN FmtFile.element.Int←HyfDistance↑[K];
PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;BEGIN FmtFile.element.Int←HyfNum↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←HyfNext↑[K];PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END; ENDLOOP;PrintLn[];
PrintInt[HyphCount];Print[1117];IF HyphCount#1  THEN PrintChar[115];
PrintNl[1118];PrintInt[TrieMax];Print[1119];PrintInt[TrieOpPtr];
Print[1120];IF TrieOpPtr#1  THEN PrintChar[115]--:1324--;--1326:
BEGIN FmtFile.element.Int←Interaction;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←FormatIdent;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;
BEGIN FmtFile.element.Int←69069;PascalPUT[file: @FmtFile.baseFile, length: SIZE[MemoryWord, 2], element: @FmtFile.element]; END;Eqtb↑[4798].Int←0--:1326--;
--1329:--WClose[@FmtFile]--:1329--; END;--:1302----1348:----1349:
 
 CloseFilesAndTerminate: PROCEDURE = 
BEGIN K:PascalInteger;--1367:
--642:
 FOR i:INT    IN [ INT[0 ].. INT[15 ]] DO  K ← i; IF WriteOpen↑[K] THEN AClose[@WriteFile↑[K]]--:1367-- ENDLOOP;
FOR i:INT    IN [ INT[1 ].. INT[InOpen ]] DO  K ← i;  AClose[@InputFile↑[K]];PrintChar[41]; ENDLOOP;
IF Eqtb↑[4798].Int>0  THEN--1334:
IF  INT[JobName]>0  THEN BEGIN {PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: "Here is how much of TeX's memory"]; PascalWriteLongString[file: @LogFile, item: " you used:"]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item: StrPtr-InitStrPtr, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: " string"]};
IF StrPtr#InitStrPtr+1  THEN PascalWriteLongString[file: @LogFile, item: "s"];
{PascalWriteLongString[file: @LogFile, item: " out of "]; PascalWriteInteger[file: @LogFile, item: MaxStrings-InitStrPtr, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item:  INT[PoolPtr]-InitPoolPtr, fieldMinLength: 1]
; PascalWriteLongString[file: @LogFile, item: " string characters out of "]; PascalWriteInteger[file: @LogFile, item: PoolSize-InitPoolPtr, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item:  INT[LoMemMax-MemMin]+MemEnd-HiMemMin+2, fieldMinLength: 1]
; PascalWriteLongString[file: @LogFile, item: " words of memory out of "]; PascalWriteInteger[file: @LogFile, item: MemEnd+1-MemMin, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item: CsCount, fieldMinLength: 1]
; PascalWriteLongString[file: @LogFile, item: " multiletter control sequences out of "]; PascalWriteInteger[file: @LogFile, item: 2500, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item: FmemPtr, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: " words of font info for "]; PascalWriteInteger[file: @LogFile, item: FontPtr-0, fieldMinLength: 1]
; PascalWriteLongString[file: @LogFile, item: " font"]};IF FontPtr#1  THEN PascalWriteLongString[file: @LogFile, item: "s"];
{PascalWriteLongString[file: @LogFile, item: ", out of "]; PascalWriteInteger[file: @LogFile, item: FontMemSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: " for "]; PascalWriteInteger[file: @LogFile, item: FontMax-0, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item: HyphCount, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: " hyphenation exception"]};
IF HyphCount#1  THEN PascalWriteLongString[file: @LogFile, item: "s"];
{PascalWriteLongString[file: @LogFile, item: " out of "]; PascalWriteInteger[file: @LogFile, item: 307, fieldMinLength: 1]; PascalWriteLn[file: @LogFile]};
{PascalWriteLongString[file: @LogFile, item: " "]; PascalWriteInteger[file: @LogFile, item: MaxInStack, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "i,"]; PascalWriteInteger[file: @LogFile, item: MaxNestStack, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "n,"]
; PascalWriteInteger[file: @LogFile, item: MaxParamStack, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "p,"]; PascalWriteInteger[file: @LogFile, item: MaxBufStack+1, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "b,"]; PascalWriteInteger[file: @LogFile, item: MaxSaveStack+6, fieldMinLength: 1]
; PascalWriteLongString[file: @LogFile, item: "s stack positions out of "]; PascalWriteInteger[file: @LogFile, item: StackSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "i,"]; PascalWriteInteger[file: @LogFile, item: NestSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "n,"]
; PascalWriteInteger[file: @LogFile, item: ParamSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "p,"]; PascalWriteInteger[file: @LogFile, item: BufSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "b,"]; PascalWriteInteger[file: @LogFile, item: SaveSize, fieldMinLength: 1]; PascalWriteLongString[file: @LogFile, item: "s"]; PascalWriteLn[file: @LogFile]}; END--:1334--;IF TotalPages=0  THEN PrintNl[694] ELSE IF UsePressFormat  THEN BEGIN
PrintNl[695];Print[OutputFileName];Print[158];PrintInt[TotalPages];
Print[696];IF TotalPages#1  THEN PrintChar[115];Print[697];
PressCloseFile[]; END  ELSE BEGIN BEGIN DviBuf↑[DviPtr]←248;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
DviFour[LastBop];LastBop←DviOffset+DviPtr-5;DviFour[25400000];
DviFour[473628672];PrepareMag[];DviFour[Eqtb↑[4784].Int];
DviFour[MaxV];DviFour[MaxH];
BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[MaxPush ,8];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]← PascalMODPower2Mask[MaxPush ,255];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]← PascalDIVPower2[TotalPages ,8];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
BEGIN DviBuf↑[DviPtr]← PascalMODPower2Mask[TotalPages ,255];DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;--643:
WHILE  INT[FontPtr]>0 DO BEGIN IF FontUsed↑[FontPtr] THEN DviFontDef[
FontPtr];FontPtr←FontPtr-1; END--:643-- ENDLOOP ;BEGIN DviBuf↑[DviPtr]←249;
DviPtr←DviPtr+1;IF DviPtr=DviLimit  THEN DviSwap[]; END;
DviFour[LastBop];BEGIN DviBuf↑[DviPtr]←2;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;
K←4+( PascalMODPower2Mask[(DviBufSize-DviPtr),3]);
WHILE K>0 DO BEGIN BEGIN DviBuf↑[DviPtr]←223;DviPtr←DviPtr+1;
IF DviPtr=DviLimit  THEN DviSwap[]; END;K←K-1; END ENDLOOP ;--599:
IF DviLimit=HalfBuf  THEN WriteDvi[HalfBuf,DviBufSize-1];
IF  INT[DviPtr]>0  THEN WriteDvi[0,DviPtr-1]--:599--;PrintNl[695];
Print[OutputFileName];Print[158];PrintInt[TotalPages];Print[696];
IF TotalPages#1  THEN PrintChar[115];Print[698];
PrintInt[DviOffset+DviPtr];Print[699];BClose[@DviFile]; END--:642--;
IF  INT[JobName]>0  THEN BEGIN PascalWriteLn[file: @LogFile];AClose[@LogFile];
Selector←Selector-2;IF Selector=17  THEN BEGIN PrintNl[1125];
Print[LogName];PrintChar[46];PrintChar[13]; END; END; END;--:1333----1335:
 FinalCleanup: PROCEDURE = 
BEGIN  C:SmallNumber; C←CurChr;
IF JobName=0  THEN OpenLogFile[];IF  INT[CurLevel]>1  THEN BEGIN PrintNl[40];
PrintEsc[1126];Print[1127];PrintInt[CurLevel-1];PrintChar[41]; END;
WHILE CondPtr#0 DO BEGIN PrintNl[40];PrintEsc[1126];Print[1128];
PrintCmdChr[104,CurIf];IF IfLine#0  THEN BEGIN Print[1129];
PrintInt[IfLine]; END;Print[1130];IfLine←Mem[CondPtr+1]↑.Int;
CurIf←Mem[CondPtr]↑.Hh.B1;CondPtr←Mem[CondPtr]↑.Hh.Rh; END ENDLOOP ;
IF History#0  THEN IF((History=1)OR ( INT[Interaction]<3)) THEN IF Selector=19
 THEN BEGIN Selector←17;PrintNl[1131];Selector←19; END;
{IF C=1  THEN BEGIN StoreFmtFile[]; GOTO Label10;PrintNl[1132]; GOTO Label10; END;
EXITS Label10 => NULL}; END;--:1335----1336:-- 
 DebugHelp: PROCEDURE = 
BEGIN  K, L, M, N:PascalInteger; {WHILE TRUE DO BEGIN
 PrintNl[1133];PascalTextBREAK[file: @TermOut];M←PascalReadInteger[file: @TermIn];
IF M<0  THEN  GOTO Label10  ELSE IF M=0  THEN BEGIN { GOTO Label888;
EXITS Label888 => NULL};M←0;--'BREAKPOINT'
 END  ELSE BEGIN N←PascalReadInteger[file: @TermIn];SELECT M FROM--1339:--1 =>PrintWord[Mem[N]↑];
2 =>PrintInt[Mem[N]↑.Hh.Lh];3 =>PrintInt[Mem[N]↑.Hh.Rh];
4 =>PrintWord[Eqtb↑[N]];5 =>PrintWord[FontInfo↑[N]];
6 =>PrintWord[SaveStack↑[N]];7 =>ShowBox[N];8 =>BEGIN BreadthMax←10000;
DepthThreshold← INT[PoolSize-PoolPtr]-10;ShowNodeList[N]; END;
9 =>ShowTokenList[N,0,1000];10 =>Print[N];11 =>CheckMem[N>0];
12 =>SearchMem[N];13 =>BEGIN L←PascalReadInteger[file: @TermIn];PrintCmdChr[N,L]; END;
14 =>FOR i:INT    IN [ INT[0 ].. INT[N ]] DO  K ← i; Print[Buffer↑[K]] ENDLOOP;15 =>BEGIN FontInShortDisplay←0;
ShortDisplay[N]; END;16 =>Panicking← NOT Panicking;--:1339
 ENDCASE =>Print[63]; END; END ENDLOOP ;EXITS Label10 => NULL}; END;--:1338----:1330----1332:

END.