Changeset 168 for branches/virtcpu fixed int/UInstructionWriter.pas
- Timestamp:
- Oct 16, 2018, 11:03:59 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/virtcpu fixed int/UInstructionWriter.pas
r165 r168 17 17 IP: T; 18 18 procedure Write(Value: T); 19 procedure AddNop; 20 procedure AddLd(R1, R2: Integer); 21 procedure AddHalt; 22 procedure AddLdc(R, Value: Integer); 23 procedure AddLdm(R1, R2: Integer); 24 procedure AddStm(R1, R2: Integer); 25 procedure AddNeg(R: Integer); 26 procedure AddIn(R1, R2: Integer); 27 procedure AddOut(R1, R2: Integer); 28 procedure AddJump(Addr: Integer); 29 {$IFDEF EXT_REL_JUMP}procedure AddJr(Addr: Integer);{$ENDIF} 30 procedure AddInc(R: Integer); 19 procedure NoOperation; 20 procedure Load(R1, R2: Integer); 21 procedure Halt; 22 procedure LoadConst(R, Value: Integer); 23 procedure LoadMemory(R1, R2: Integer); 24 procedure StoreMemory(R1, R2: Integer); 25 procedure Neg(R: Integer); 26 procedure Input(R1, R2: Integer); 27 procedure Output(R1, R2: Integer); 28 procedure Subtract(R1, R2: Integer); 29 procedure Jump(Addr: Integer); 30 procedure JumpNotZero(R1: Integer; Addr: Integer); 31 procedure JumpZero(R1: Integer; Addr: Integer); 32 {$IFDEF EXT_REL_JUMP}procedure JumpRelative(Addr: Integer);{$ENDIF} 33 procedure Increment(R: Integer); 34 procedure Decrement(R: Integer); 31 35 constructor Create; 32 36 end; … … 37 41 { TInstructionWriter } 38 42 39 procedure TInstructionWriter. AddNop;43 procedure TInstructionWriter.NoOperation; 40 44 begin 41 45 Write(T(opNop)); 42 46 end; 43 47 44 procedure TInstructionWriter. AddLd(R1, R2: Integer);48 procedure TInstructionWriter.Load(R1, R2: Integer); 45 49 begin 46 50 Write(T(opLoad)); … … 49 53 end; 50 54 51 procedure TInstructionWriter. AddHalt;55 procedure TInstructionWriter.Halt; 52 56 begin 53 57 Write(T(opHalt)); 54 58 end; 55 59 56 procedure TInstructionWriter. AddLdc(R, Value: Integer);60 procedure TInstructionWriter.LoadConst(R, Value: Integer); 57 61 begin 58 62 Write(T(opLoadConst)); … … 61 65 end; 62 66 63 procedure TInstructionWriter. AddLdm(R1, R2: Integer);67 procedure TInstructionWriter.LoadMemory(R1, R2: Integer); 64 68 begin 65 69 Write(T(opLoadMem)); … … 68 72 end; 69 73 70 procedure TInstructionWriter. AddStm(R1, R2: Integer);74 procedure TInstructionWriter.StoreMemory(R1, R2: Integer); 71 75 begin 72 76 Write(T(opStoreMem)); … … 75 79 end; 76 80 77 procedure TInstructionWriter. AddNeg(R: Integer);81 procedure TInstructionWriter.Neg(R: Integer); 78 82 begin 79 83 Write(T(opNeg)); … … 81 85 end; 82 86 83 procedure TInstructionWriter. AddIn(R1, R2: Integer);87 procedure TInstructionWriter.Input(R1, R2: Integer); 84 88 begin 85 89 Write(T(opInput)); … … 88 92 end; 89 93 90 procedure TInstructionWriter. AddOut(R1, R2: Integer);94 procedure TInstructionWriter.Output(R1, R2: Integer); 91 95 begin 92 96 Write(T(opOutput)); … … 95 99 end; 96 100 97 procedure TInstructionWriter.AddJump(Addr: Integer); 101 procedure TInstructionWriter.Subtract(R1, R2: Integer); 102 begin 103 Write(T(opSub)); 104 Write(R1); 105 Write(R2); 106 end; 107 108 procedure TInstructionWriter.Jump(Addr: Integer); 98 109 begin 99 110 Write(T(opJump)); … … 101 112 end; 102 113 114 procedure TInstructionWriter.JumpNotZero(R1: Integer; Addr: Integer); 115 begin 116 Write(T(opJumpNotZero)); 117 Write(R1); 118 Write(Addr); 119 end; 120 121 procedure TInstructionWriter.JumpZero(R1: Integer; Addr: Integer); 122 begin 123 Write(T(opJumpZero)); 124 Write(R1); 125 Write(Addr); 126 end; 127 103 128 {$IFDEF EXT_REL_JUMP} 104 procedure TInstructionWriter. AddJr(Addr: Integer);129 procedure TInstructionWriter.JumpRelative(Addr: Integer); 105 130 begin 106 131 Write(T(opJumpRel)); … … 109 134 {$ENDIF} 110 135 111 procedure TInstructionWriter. AddInc(R: Integer);136 procedure TInstructionWriter.Increment(R: Integer); 112 137 begin 113 138 Write(T(opInc)); 139 Write(R); 140 end; 141 142 procedure TInstructionWriter.Decrement(R: Integer); 143 begin 144 Write(T(opDec)); 114 145 Write(R); 115 146 end;
Note:
See TracChangeset
for help on using the changeset viewer.