-- file: TexMath3Impl.mesa -- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:38 am PDT DIRECTORY PascalBasic, TexTypes, TexInteraction, TexMemory, TexSymbols, TexOps, TexMath, TexSysdepInline; TexMath3Impl: PROGRAM IMPORTS PascalBasic, TexTypes, TexInteraction, TexMemory, TexSymbols, TexOps, TexMath, TexSysdepInline EXPORTS TexMath = PUBLIC BEGIN OPEN PascalBasic, TexTypes, TexInteraction, TexMemory, TexSymbols, TexOps, TexMath, TexSysdepInline; MakeRadical: PROCEDURE[Q: Halfword] = BEGIN X, Y:Halfword;Delta, Clr:Scaled; X←CleanBox[Q+1,2*( PascalDIVPower2[CurStyle ,1])+1]; IF INT[CurStyle]<2 THEN Clr←FontInfo↑[8+ParamBase↑[Eqtb↑[4082+CurSize].Hh. Rh]].Int+( PascalDIVPower2[ABS[FontInfo↑[5+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int],2]) ELSE BEGIN Clr←FontInfo↑[8+ParamBase↑[Eqtb↑[4082+CurSize].Hh.Rh]].Int ;Clr←Clr+( PascalDIVPower2[ABS[Clr],2]); END; Y←VarDelimiter[Q+4,CurSize,Mem[X+3]↑.Int+Mem[X+2]↑.Int+Clr+FontInfo↑[ 8+ParamBase↑[Eqtb↑[4082+CurSize].Hh.Rh]].Int]; Delta←Mem[Y+2]↑.Int-(Mem[X+3]↑.Int+Mem[X+2]↑.Int+Clr); IF Delta>0 THEN Clr←Clr+Half[Delta];Mem[Y+4]↑.Int←-(Mem[X+3]↑.Int+Clr); Mem[Y]↑.Hh.Rh←Overbar[X,Clr,Mem[Y+3]↑.Int];Mem[Q+1]↑.Hh.Lh←Hpack[Y,0,1]; Mem[Q+1]↑.Hh.Rh←2; END;--:737----738: MakeMathAccent: PROCEDURE[Q: Halfword] = BEGIN P, X, Y:Halfword; A:PascalInteger;C:Quarterword;F:InternalFontNumber;I:FourQuarters;S:Scaled; H:Scaled;Delta:Scaled;W:Scaled; Fetch[Q+4]; IF( INT[CurI.B0]>0) THEN BEGIN I←CurI;C←CurC;F←CurF;--741:--S←0; {IF Mem[Q+1]↑.Hh.Rh=1 THEN BEGIN Fetch[Q+1]; IF( PascalMODPower2Mask[(CurI.B2),3])=1 THEN BEGIN A←LigKernBase↑[CurF]+CurI.B3; DO CurI←FontInfo↑[A].Qqqq; IF CurI.B1=SkewChar↑[CurF] THEN BEGIN IF INT[CurI.B2]>=128 THEN S← FontInfo↑[KernBase↑[CurF]+CurI.B3].Int; GOTO Label31; END;A←A+1; IF INT[CurI.B0]>=128 THEN EXIT; ENDLOOP; END; END;EXITS Label31 => NULL};--:741--X←CleanBox[Q+1,2*( PascalDIVPower2[CurStyle ,1])+1];W←Mem[X+1]↑.Int;H←Mem[X+3]↑.Int; --740:--{WHILE TRUE DO BEGIN IF( PascalMODPower2Mask[(I.B2),3])#2 THEN GOTO Label30;Y←I.B3; I←FontInfo↑[CharBase↑[F]+Y].Qqqq; IF FontInfo↑[WidthBase↑[F]+I.B0].Int>W THEN GOTO Label30;C←Y; END ENDLOOP ;EXITS Label30 => NULL};--:740--IF H<FontInfo↑[5+ParamBase↑[F]].Int THEN Delta←H ELSE Delta←FontInfo↑ [5+ParamBase↑[F]].Int; IF(Mem[Q+2]↑.Hh.Rh#0)OR (Mem[Q+3]↑.Hh.Rh#0) THEN IF Mem[Q+1]↑.Hh.Rh=1 THEN-- -- 742:--BEGIN FlushNodeList[X];X←NewNoad[];Mem[X+1]↑←Mem[Q+1]↑; Mem[X+2]↑←Mem[Q+2]↑;Mem[X+3]↑←Mem[Q+3]↑;Mem[Q+2]↑.Hh←EmptyField; Mem[Q+3]↑.Hh←EmptyField;Mem[Q+1]↑.Hh.Rh←3;Mem[Q+1]↑.Hh.Lh←X; X←CleanBox[Q+1,CurStyle];Delta←Delta+Mem[X+3]↑.Int-H;H←Mem[X+3]↑.Int; END--:742--;Y←CharBox[F,C];Mem[Y+4]↑.Int←S+Half[W-Mem[Y+1]↑.Int]; Mem[Y+1]↑.Int←0;P←NewKern[-Delta];Mem[P]↑.Hh.Rh←X;Mem[Y]↑.Hh.Rh←P; Y←Vpackage[Y,0,1,1073741823];Mem[Y+1]↑.Int←Mem[X+1]↑.Int; IF Mem[Y+3]↑.Int<H THEN--739:--BEGIN P←NewKern[H-Mem[Y+3]↑.Int]; Mem[P]↑.Hh.Rh←Mem[Y+5]↑.Hh.Rh;Mem[Y+5]↑.Hh.Rh←P;Mem[Y+3]↑.Int←H; END--:739 ;Mem[Q+1]↑.Hh.Lh←Y;Mem[Q+1]↑.Hh.Rh←2; END; END;--:738----743: MakeFraction: PROCEDURE[Q: Halfword] = BEGIN P, V, X, Y, Z:Halfword; Delta, Delta1, Delta2, ShiftUp, ShiftDown, Clr:Scaled; IF Mem[Q+1]↑.Int=1073741824 THEN Mem[Q+1]↑.Int←FontInfo↑[ 8+ParamBase↑[Eqtb↑[4082+CurSize].Hh.Rh]].Int;--744: X←CleanBox[Q+2,CurStyle+2-2*( CurStyle /6)]; Z←CleanBox[Q+3,2*( PascalDIVPower2[CurStyle ,1])+3-2*( CurStyle /6)]; IF Mem[X+1]↑.Int<Mem[Z+1]↑.Int THEN X←Rebox[X,Mem[Z+1]↑.Int] ELSE Z←Rebox[ Z,Mem[X+1]↑.Int]; IF INT[CurStyle]<2 THEN BEGIN ShiftUp←FontInfo↑[8+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int; ShiftDown←FontInfo↑[11+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int; END ELSE BEGIN ShiftDown←FontInfo↑[12+ParamBase↑[Eqtb↑[4081+CurSize]. Hh.Rh]].Int; IF Mem[Q+1]↑.Int#0 THEN ShiftUp←FontInfo↑[9+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int ELSE ShiftUp←FontInfo↑[10+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int; END--:744--;IF Mem[Q+1]↑.Int=0 THEN--745: BEGIN IF INT[CurStyle]<2 THEN Clr←7*FontInfo↑[8+ParamBase↑[Eqtb↑[ 4082+CurSize].Hh.Rh]].Int ELSE Clr←3*FontInfo↑[8+ParamBase↑[Eqtb↑[ 4082+CurSize].Hh.Rh]].Int; Delta←Half[Clr-((ShiftUp-Mem[X+2]↑.Int)-(Mem[Z+3]↑.Int-ShiftDown))]; IF Delta>0 THEN BEGIN ShiftUp←ShiftUp+Delta; ShiftDown←ShiftDown+Delta; END; END--:745-- ELSE--746: BEGIN IF INT[CurStyle]<2 THEN Clr←3*Mem[Q+1]↑.Int ELSE Clr←Mem[Q+1]↑.Int; Delta←Half[Mem[Q+1]↑.Int]; Delta1←Clr-((ShiftUp-Mem[X+2]↑.Int)-(FontInfo↑[22+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int+Delta)); Delta2←Clr-(( FontInfo↑[22+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int-Delta)-(Mem[Z+3]↑.Int-ShiftDown)); IF Delta1>0 THEN ShiftUp←ShiftUp+Delta1; IF Delta2>0 THEN ShiftDown←ShiftDown+Delta2; END--:746--;--747: V←NewNullBox[];Mem[V]↑.Hh.B0←1;Mem[V+3]↑.Int←ShiftUp+Mem[X+3]↑.Int; Mem[V+2]↑.Int←Mem[Z+2]↑.Int+ShiftDown;Mem[V+1]↑.Int←Mem[X+1]↑.Int; IF Mem[Q+1]↑.Int=0 THEN BEGIN P←NewKern[(ShiftUp-Mem[X+2]↑.Int)-(Mem[Z +3]↑.Int-ShiftDown)];Mem[P]↑.Hh.Rh←Z; END ELSE BEGIN Y←FractionRule[Mem[Q+1]↑.Int]; P←NewKern[( FontInfo↑[22+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int-Delta)-(Mem[Z+3]↑.Int-ShiftDown)];Mem[Y]↑.Hh.Rh←P;Mem[P]↑.Hh.Rh←Z; P←NewKern[(ShiftUp-Mem[X+2]↑.Int)-(FontInfo↑[22+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int+Delta)];Mem[P]↑.Hh.Rh←Y; END;Mem[X]↑.Hh.Rh←P; Mem[V+5]↑.Hh.Rh←X--:747--;--748: IF INT[CurStyle]<2 THEN Delta←FontInfo↑[20+ParamBase↑[Eqtb↑[4081+CurSize]. Hh.Rh]].Int ELSE Delta←FontInfo↑[21+ParamBase↑[Eqtb↑[4081+CurSize].Hh. Rh]].Int;X←VarDelimiter[Q+4,CurSize,Delta];Mem[X]↑.Hh.Rh←V; Z←VarDelimiter[Q+5,CurSize,Delta];Mem[V]↑.Hh.Rh←Z; Mem[Q+1]↑.Int←Hpack[X,0,1]--:748--; END;--:743----749: MakeOrd: PROCEDURE[Q: Halfword] = BEGIN A:PascalInteger;P:Halfword; DO {--Label20:--{IF(Mem[Q+3]↑.Hh.Rh=0)AND (Mem[Q+2]↑.Hh.Rh=0)AND (Mem[Q+1]↑.Hh.Rh=1) THEN BEGIN P←Mem[Q]↑.Hh.Rh; IF P#0 THEN IF( INT[Mem[P]↑.Hh.B0]>=16)AND ( INT[Mem[P]↑.Hh.B0]<=22) THEN IF Mem[P+1]↑. Hh.Rh=1 THEN IF Mem[P+1]↑.Hh.B0=Mem[Q+1]↑.Hh.B0 THEN BEGIN Mem[Q+1]↑.Hh.Rh ←4;Fetch[Q+1]; IF( PascalMODPower2Mask[(CurI.B2),3])=1 THEN BEGIN A←LigKernBase↑[CurF]+CurI.B3; CurC←Mem[P+1]↑.Hh.B1;DO CurI←FontInfo↑[A].Qqqq;--753: IF CurI.B1=CurC THEN IF INT[CurI.B2]>=128 THEN BEGIN P←NewKern[FontInfo ↑[KernBase↑[CurF]+CurI.B3].Int];Mem[P]↑.Hh.Rh←Mem[Q]↑.Hh.Rh; Mem[Q]↑.Hh.Rh←P; GOTO Label10; END ELSE BEGIN Mem[Q]↑.Hh.Rh←Mem[P]↑.Hh.Rh; Mem[Q+1]↑.Hh.Rh←1;Mem[Q+1]↑.Hh.B1←CurI.B3;Mem[Q+3]↑←Mem[P+3]↑; Mem[Q+2]↑←Mem[P+2]↑;FreeNode[P,4]; GOTO Label20; END--:753--;A←A+1; IF INT[CurI.B0]>=128 THEN EXIT; ENDLOOP; END; END; END;EXITS Label10 => NULL};EXIT; EXITS Label20 => NULL} ENDLOOP; END;--:752----756: MakeScripts: PROCEDURE[Q: Halfword,Delta: Scaled] = BEGIN P, X, Y, Z:Halfword; ShiftUp, ShiftDown, Clr:Scaled;T:SmallNumber; P←Mem[Q+1]↑.Int; IF( INT[P]>=HiMemMin) THEN BEGIN ShiftUp←0;ShiftDown←0; END ELSE BEGIN Z←Hpack[P,0,1];IF INT[CurStyle]<4 THEN T←16 ELSE T←32; ShiftUp←Mem[Z+3]↑.Int-FontInfo↑[18+ParamBase↑[Eqtb↑[4081+T].Hh.Rh]].Int; ShiftDown←Mem[Z+2]↑.Int+FontInfo↑[19+ParamBase↑[Eqtb↑[4081+T].Hh.Rh]]. Int;FreeNode[Z,7]; END;IF Mem[Q+2]↑.Hh.Rh=0 THEN--757: BEGIN X←CleanBox[Q+3,2*( PascalDIVPower2[CurStyle ,2])+5]; Mem[X+1]↑.Int←Mem[X+1]↑.Int+Eqtb↑[5213].Int; IF ShiftDown<FontInfo↑[16+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int THEN ShiftDown←FontInfo↑[16+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int ; Clr←Mem[X+3]↑.Int-( ABS[FontInfo↑[5+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh] ].Int*4]/5);IF ShiftDown<Clr THEN ShiftDown←Clr; Mem[X+4]↑.Int←ShiftDown; END--:757-- ELSE BEGIN--758: BEGIN X←CleanBox[Q+2,2*( PascalDIVPower2[CurStyle ,2])+4+( PascalMODPower2Mask[CurStyle ,1])]; Mem[X+1]↑.Int←Mem[X+1]↑.Int+Eqtb↑[5213].Int; IF PascalODD[CurStyle] THEN Clr←FontInfo↑[15+ParamBase↑[Eqtb↑[4081+CurSize]. Hh.Rh]].Int ELSE IF INT[CurStyle]<2 THEN Clr←FontInfo↑[13+ParamBase↑[Eqtb↑ [4081+CurSize].Hh.Rh]].Int ELSE Clr←FontInfo↑[14+ParamBase↑[Eqtb↑[ 4081+CurSize].Hh.Rh]].Int;IF ShiftUp<Clr THEN ShiftUp←Clr; Clr←Mem[X+2]↑.Int+( PascalDIVPower2[ABS[FontInfo↑[5+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh] ].Int],2]);IF ShiftUp<Clr THEN ShiftUp←Clr; END--:758--; IF Mem[Q+3]↑.Hh.Rh=0 THEN Mem[X+4]↑.Int←-ShiftUp ELSE--759: BEGIN Y←CleanBox[Q+3,2*( PascalDIVPower2[CurStyle ,2])+5]; Mem[Y+1]↑.Int←Mem[Y+1]↑.Int+Eqtb↑[5213].Int; IF ShiftDown<FontInfo↑[17+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int THEN ShiftDown←FontInfo↑[17+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int ; Clr←4*FontInfo↑[8+ParamBase↑[Eqtb↑[4082+CurSize].Hh.Rh]].Int-((ShiftUp -Mem[X+2]↑.Int)-(Mem[Y+3]↑.Int-ShiftDown)); IF Clr>0 THEN BEGIN ShiftDown←ShiftDown+Clr; Clr←( ABS[FontInfo↑[5+ParamBase↑[Eqtb↑[4081+CurSize].Hh.Rh]].Int*4]/5 )-(ShiftUp-Mem[X+2]↑.Int);IF Clr>0 THEN BEGIN ShiftUp←ShiftUp+Clr; ShiftDown←ShiftDown-Clr; END; END;Mem[X+4]↑.Int←Delta; P←NewKern[(ShiftUp-Mem[X+2]↑.Int)-(Mem[Y+3]↑.Int-ShiftDown)]; Mem[X]↑.Hh.Rh←P;Mem[P]↑.Hh.Rh←Y;X←Vpackage[X,0,1,1073741823]; Mem[X+4]↑.Int←ShiftDown; END--:759--; END; IF Mem[Q+1]↑.Int=0 THEN Mem[Q+1]↑.Int←X ELSE BEGIN P←Mem[Q+1]↑.Int; WHILE Mem[P]↑.Hh.Rh#0 DO P←Mem[P]↑.Hh.Rh ENDLOOP ;Mem[P]↑.Hh.Rh←X; END; END;--:756 END.