Анимация
JavaScript
|
Главная Библионтека Token := KWcode[Lookup(Addr(KWlist), Value, NKW) + 1]; end; { Match a Specific Input String } procedure MatchString(x: string); begin if Value <> x then Expected( + x + ); Next; end; { Output a String with Tab } procedure Emit(s: string); begin Write(TAB, s); end; { Output a String with Tab and CRLF } procedure EmitLn(s: string); begin Emit(s); WriteLn; end; { Generate a Unique Label } function NewLabel: string; var S: string; begin Str(LCount, S); NewLabel := L + S; Inc(LCount); end; { Post a Label To Output } procedure PostLabel(L: string); begin WriteLn(L, :); end; { Clear the Primary Register } procedure Clear; begin EmitLnCCLR D0); end; { Negate the Primary Register } procedure Negate; begin EmitLnCNEG D0); end; { Complement the Primary Register } procedure NotIt; begin EmitLnCNOT D0); end; { Load a Constant Value to Primary Register } procedure LoadConst(n: string); begin EmitCMOVE #); WriteLn(n, ,D0); end; { Load a Variable to Primary Register } procedure LoadVar(Name: string); begin if not InTable(Name) then Undefined(Name); EmitLnCMOVE + Name + (PC),D0); end; { Push Primary onto Stack } procedure Push; begin EmitLnCMOVE D0,-(SP)); end; { Add Top of Stack to Primary } procedure PopAdd; begin EmitLnCADD (SP)+,D0); end; { Subtract Primary from Top of Stack } procedure PopSub; begin EmitLnCSUB (SP)+,D0); EmitLnCNEG D0); end; { Multiply Top of Stack by Primary } procedure PopMul; begin EmitLnCMULS (SP) + ,D0); end; { Divide Top of Stack by Primary } procedure PopDiv; begin EmitLnCMOVE (SP) + ,D7); EmitLnCEXT.L D7); EmitLnCDIVS D0,D7); EmitLnCMOVE D7,D0); end; { AND Top of Stack with Primary } procedure PopAnd; begin EmitLnCAND (SP)+,D0); end; { OR Top of Stack with Primary } procedure PopOr; begin EmitLnCOR (SP) + ,D0); end; { XOR Top of Stack with Primary } procedure PopXor; begin EmitLnCEOR (SP)+,D0); end; { Compare Top of Stack with Primary } procedure PopCompare; begin EmitLnCCMP (SP)+,D0); end; { Set D0 If Compare was = } procedure SetEqual; begin EmitLnCSEQ D0); EmitLnCEXT D0); end; { Set D0 If Compare was != } procedure SetNEqual; begin EmitLnCSNE D0); EmitLnCEXT D0); end; { Set D0 If Compare was > } procedure SetGreater; begin EmitLnCSLT D0); EmitLnCEXT D0); end; { Set D0 If Compare was < } procedure SetLess; begin EmitLnCSGT D0); EmitLnCEXT D0); end; { Set D0 If Compare was <= } procedure SetLessOrEqual; begin EmitLnCSGE D0); EmitLnCEXT D0); end; { Set D0 If Compare was >= } procedure SetGreaterOrEqual; begin EmitLnCSLE D0); EmitLnCEXT D0); end; { Store Primary to Variable } procedure Store(Name: string); begin EmitLnCLEA + Name + (PC),A0); EmitLnCMOVE D0,(A0)) end; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 [ 60 ] 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |