-- file: TexDvi2Impl.mesa -- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:37 am PDT DIRECTORY PascalBasic, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexDvi, TexOps, TexBuildPage, TexExtensions; TexDvi2Impl: PROGRAM IMPORTS PascalBasic, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexDvi, TexOps, TexBuildPage, TexExtensions EXPORTS TexDvi = PUBLIC BEGIN OPEN PascalBasic, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexDvi, TexOps, TexBuildPage, TexExtensions; HlistPressOut: PROCEDURE = BEGIN BaseLine:Scaled;BaseInMica:Scaled; LeftEdge:Scaled;SaveH, SaveV:Scaled;ThisBox:Halfword; GOrder:GlueOrd;GSign:PascalInteger[0..2];P:Halfword;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;BaseLine←CurV; LeftEdge←CurH; BaseInMica←25400-XOverN[XnOverD[BaseLine,Eqtb↑[4784].Int,18647], 100];WHILE P#0 DO--1380: DO {IF( INT[P]>=HiMemMin) THEN BEGIN PressSetY[BaseInMica]; F←Mem[P]↑.Hh.B0;IF F#DviF THEN--1381: BEGIN IF NOT FontUsed↑[F] THEN BEGIN FontPypeCode↑[F]←GetPypeCode[F, XnOverD[FontSize↑[F],Eqtb↑[4784].Int,18647]];FontUsed↑[F]←TRUE; END; PressSetFont[FontPypeCode↑[F]];DviF←F; END--:1381--; PressSetX[2540+XOverN[XnOverD[CurH,Eqtb↑[4784].Int,18647],100]]; DO C←Mem[P]↑.Hh.B1;PressShowChar[C]; CurH←CurH+FontInfo↑[WidthBase↑[F]+FontInfo↑[CharBase↑[F]+C].Qqqq.B0]. Int;P←Mem[P]↑.Hh.Rh; IF(NOT ( INT[P]>=HiMemMin))OR (Mem[P]↑.Hh.B0#DviF) THEN EXIT; ENDLOOP; END ELSE--1382:--BEGIN {{{SELECT Mem[P]↑.Hh.B0 FROM 0,1 =>--1383: IF Mem[P+5]↑.Hh.Rh=0 THEN CurH←CurH+Mem[P+1]↑.Int ELSE BEGIN CurV← BaseLine+Mem[P+4]↑.Int;TempPtr←P;Edge←CurH; IF Mem[P]↑.Hh.B0=1 THEN VlistPressOut [] ELSE HlistPressOut[]; CurH←Edge+Mem[P+1]↑.Int;CurV←BaseLine; END--:1383--; 2 =>BEGIN RuleHt←Mem[P+3]↑.Int;RuleDp←Mem[P+2]↑.Int; RuleWd←Mem[P+1]↑.Int; GOTO Label14; END;8 =>--1397:--PressOutWhat[P]--:1397--; 10 =>--1385:--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--1386: 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--1387: BEGIN CurV←BaseLine+Mem[LeaderBox+4]↑.Int;SaveV←CurV; SaveH←CurH;TempPtr←LeaderBox;OuterDoingLeaders←DoingLeaders; DoingLeaders←TRUE; IF Mem[LeaderBox]↑.Hh.B0=1 THEN VlistPressOut [] ELSE HlistPressOut[]; DoingLeaders←OuterDoingLeaders;CurV←SaveV; CurH←SaveH+LeaderWd+Lx; END--:1387-- ENDLOOP ;CurH←Edge; GOTO Label15; END; END--:1386 ; GOTO Label13; END--:1385--;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};--1384: 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 PressShowRule[254000+XnOverD[ CurH,Eqtb↑[4784].Int,18647],2540000-XnOverD[BaseLine+RuleDp,Eqtb↑ [4784].Int,18647],XnOverD[RuleWd,Eqtb↑[4784].Int,18647],XnOverD[ RuleHt,Eqtb↑[4784].Int,18647]];CurV←BaseLine; END--:1384--; EXITS Label13 => NULL};CurH←CurH+RuleWd;EXITS Label15 => NULL};P←Mem[P]↑.Hh.Rh; END--:1382----:1380--; EXIT; EXITS Label21 => NULL} ENDLOOP ENDLOOP ; END;--:1379 --1388:-- VlistPressOut: PROCEDURE = BEGIN LeftEdge:Scaled; TopEdge:Scaled;SaveH, SaveV:Scaled;ThisBox:Halfword;GOrder:GlueOrd; GSign:PascalInteger[0..2];P:Halfword;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;LeftEdge←CurH; CurV←CurV-Mem[ThisBox+3]↑.Int;TopEdge←CurV;WHILE P#0 DO--1389: BEGIN {IF( INT[P]>=HiMemMin) THEN Confusion[685] ELSE--1390: BEGIN {{SELECT Mem[P]↑.Hh.B0 FROM 0,1 =>--1391: 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;SaveV←CurV; CurH←LeftEdge+Mem[P+4]↑.Int;TempPtr←P; IF Mem[P]↑.Hh.B0=1 THEN VlistPressOut [] ELSE HlistPressOut[]; CurV←SaveV+Mem[P+2]↑.Int;CurH←LeftEdge; END--:1391--; 2 =>BEGIN RuleHt←Mem[P+3]↑.Int;RuleDp←Mem[P+2]↑.Int; RuleWd←Mem[P+1]↑.Int; GOTO Label14; END;8 =>--1398:--PressOutWhat[P]--:1398--; 10 =>--1393:--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--1394: 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--1395: BEGIN CurH←LeftEdge+Mem[LeaderBox+4]↑.Int;SaveH←CurH; CurV←CurV+Mem[LeaderBox+3]↑.Int;SaveV←CurV;TempPtr←LeaderBox; OuterDoingLeaders←DoingLeaders;DoingLeaders←TRUE; IF Mem[LeaderBox]↑.Hh.B0=1 THEN VlistPressOut [] ELSE HlistPressOut[]; DoingLeaders←OuterDoingLeaders;CurH←SaveH; CurV←SaveV-Mem[LeaderBox+3]↑.Int+LeaderHt+Lx; END--:1395-- ENDLOOP ;CurV←Edge; GOTO Label15; END; END--:1394--; GOTO Label13; END--:1393--;11 =>CurV←CurV+Mem[P+1]↑.Int; ENDCASE => NULL; GOTO Label15;EXITS Label14 => NULL};--1392: IF(RuleWd=-1073741824) THEN RuleWd←Mem[ThisBox+1]↑.Int; RuleHt←RuleHt+RuleDp;CurV←CurV+RuleHt; IF(RuleHt>0)AND (RuleWd>0) THEN BEGIN PressShowRule[254000+XnOverD[ CurH,Eqtb↑[4784].Int,18647],2540000-XnOverD[CurV,Eqtb↑[4784].Int,18647 ],XnOverD[RuleWd,Eqtb↑[4784].Int,18647],XnOverD[RuleHt,Eqtb↑[4784]. Int,18647]]; END; GOTO Label15--:1392--;EXITS Label13 => NULL};CurV←CurV+RuleHt; END--:1390--; EXITS Label15 => NULL};P←Mem[P]↑.Hh.Rh; END--:1389-- ENDLOOP ; END;--:1388----:1377 END.