Changeset 186
- Timestamp:
- May 1, 2019, 11:39:27 PM (6 years ago)
- Location:
- branches/virtualcpu4
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/virtualcpu4/Forms/UFormMain.lfm
r185 r186 1 1 object FormMain: TFormMain 2 Left = 7803 Height = 2694 Top = 5275 Width = 6592 Left = 686 3 Height = 318 4 Top = 444 5 Width = 806 6 6 Caption = 'VirtCpu4' 7 ClientHeight = 2698 ClientWidth = 6597 ClientHeight = 318 8 ClientWidth = 806 9 9 DesignTimePPI = 144 10 10 OnCreate = FormCreate … … 43 43 end 44 44 object ButtonMemory: TButton 45 Left = 37145 Left = 24 46 46 Height = 38 47 Top = 6447 Top = 112 48 48 Width = 185 49 49 Caption = 'Memory' … … 53 53 end 54 54 object ButtonCpuState: TButton 55 Left = 37155 Left = 24 56 56 Height = 38 57 Top = 1 1057 Top = 160 58 58 Width = 185 59 59 Caption = 'CPU state' … … 85 85 Left = 371 86 86 Height = 38 87 Top = 15487 Top = 56 88 88 Width = 185 89 89 Caption = 'Assembler' … … 93 93 end 94 94 object ButtonClearMemory: TButton 95 Left = 37195 Left = 24 96 96 Height = 38 97 Top = 19297 Top = 208 98 98 Width = 185 99 99 Caption = 'Clear memory' … … 102 102 TabOrder = 8 103 103 end 104 object ButtonCompilerPascal: TButton 105 Left = 371 106 Height = 38 107 Top = 200 108 Width = 185 109 Caption = 'Pascal compiler' 110 OnClick = ButtonCompilerPascalClick 111 ParentFont = False 112 TabOrder = 9 113 end 104 114 end -
branches/virtualcpu4/Forms/UFormMain.pas
r185 r186 15 15 TFormMain = class(TForm) 16 16 ButtonAssembler: TButton; 17 ButtonCompilerPascal: TButton; 17 18 ButtonClearMemory: TButton; 18 19 ButtonScreen: TButton; … … 25 26 procedure ButtonAssemblerClick(Sender: TObject); 26 27 procedure ButtonClearMemoryClick(Sender: TObject); 28 procedure ButtonCompilerPascalClick(Sender: TObject); 27 29 procedure ButtonConsoleClick(Sender: TObject); 28 30 procedure ButtonCpuStateClick(Sender: TObject); … … 52 54 uses 53 55 UFormDisassembler, UFormMemory, UFormCpuState, UFormScreen, UFormConsole, 54 UFormAssembler ;56 UFormAssembler, UFormCompilerPascal; 55 57 56 58 { TFormMain } … … 116 118 begin 117 119 Machine.ClearMemory; 120 end; 121 122 procedure TFormMain.ButtonCompilerPascalClick(Sender: TObject); 123 begin 124 if not Assigned(FormCompilerPascal) then 125 FormCompilerPascal := TFormCompilerPascal.Create(Self); 126 FormCompilerPascal.CompilerPascal.Reader.Cpu := Machine.Cpu; 127 FormCompilerPascal.Show; 118 128 end; 119 129 -
branches/virtualcpu4/UCpu.pas
r184 r186 275 275 case AddrSize of 276 276 bw8: case DataSize of 277 bw8: Registers[R1].B := PByte(Memory + PByte(@Registers[R2])^)^;278 bw16: Registers[R1].W := PWord(Memory + PByte(@Registers[R2])^)^;279 bw32: Registers[R1].D := PDWord(Memory + PByte(@Registers[R2])^)^;280 bw64: Registers[R1].Q := PQWord(Memory + PByte(@Registers[R2])^)^;277 bw8: Registers[R1].B := PByte(Memory + Registers[R2].B)^; 278 bw16: Registers[R1].W := PWord(Memory + Registers[R2].B)^; 279 bw32: Registers[R1].D := PDWord(Memory + Registers[R2].B)^; 280 bw64: Registers[R1].Q := PQWord(Memory + Registers[R2].B)^; 281 281 end; 282 282 bw16: case DataSize of 283 bw8: Registers[R1].B := PByte(Memory + PWord(@Registers[R2])^)^;284 bw16: Registers[R1].W := PWord(Memory + PWord(@Registers[R2])^)^;285 bw32: Registers[R1].D := PDWord(Memory + PWord(@Registers[R2])^)^;286 bw64: Registers[R1].Q := PQWord(Memory + PWord(@Registers[R2])^)^;283 bw8: Registers[R1].B := PByte(Memory + Registers[R2].W)^; 284 bw16: Registers[R1].W := PWord(Memory + Registers[R2].W)^; 285 bw32: Registers[R1].D := PDWord(Memory + Registers[R2].W)^; 286 bw64: Registers[R1].Q := PQWord(Memory + Registers[R2].W)^; 287 287 end; 288 288 bw32: case DataSize of 289 bw8: Registers[R1].B := PByte(Memory + PDWord(@Registers[R2])^)^;290 bw16: Registers[R1].W := PWord(Memory + PDWord(@Registers[R2])^)^;291 bw32: Registers[R1].D := PDWord(Memory + PDWord(@Registers[R2])^)^;292 bw64: Registers[R1].Q := PQWord(Memory + PDWord(@Registers[R2])^)^;289 bw8: Registers[R1].B := PByte(Memory + Registers[R2].D)^; 290 bw16: Registers[R1].W := PWord(Memory + Registers[R2].D)^; 291 bw32: Registers[R1].D := PDWord(Memory + Registers[R2].D)^; 292 bw64: Registers[R1].Q := PQWord(Memory + Registers[R2].D)^; 293 293 end; 294 294 bw64: case DataSize of 295 bw8: Registers[R1].B := PByte(Memory + PQWord(@Registers[R2])^)^;296 bw16: Registers[R1].W := PWord(Memory + PQWord(@Registers[R2])^)^;297 bw32: Registers[R1].D := PDWord(Memory + PQWord(@Registers[R2])^)^;298 bw64: Registers[R1].Q := PQWord(Memory + PQWord(@Registers[R2])^)^;295 bw8: Registers[R1].B := PByte(Memory + Registers[R2].Q)^; 296 bw16: Registers[R1].W := PWord(Memory + Registers[R2].Q)^; 297 bw32: Registers[R1].D := PDWord(Memory + Registers[R2].Q)^; 298 bw64: Registers[R1].Q := PQWord(Memory + Registers[R2].Q)^; 299 299 end; 300 300 end; … … 309 309 case AddrSize of 310 310 bw8: case DataSize of 311 bw8: PByte(Memory + PByte(@Registers[R1])^)^ := Registers[R2].B;312 bw16: PWord(Memory + PByte(@Registers[R1])^)^ := Registers[R2].W;313 bw32: PDWord(Memory + PByte(@Registers[R1])^)^ := Registers[R2].D;314 bw64: PQWord(Memory + PByte(@Registers[R1])^)^ := Registers[R2].Q;311 bw8: PByte(Memory + Registers[R1].B)^ := Registers[R2].B; 312 bw16: PWord(Memory + Registers[R1].B)^ := Registers[R2].W; 313 bw32: PDWord(Memory + Registers[R1].B)^ := Registers[R2].D; 314 bw64: PQWord(Memory + Registers[R1].B)^ := Registers[R2].Q; 315 315 end; 316 316 bw16: case DataSize of 317 bw8: PByte(Memory + PWord(@Registers[R1])^)^ := Registers[R2].B;318 bw16: PWord(Memory + PWord(@Registers[R1])^)^ := Registers[R2].W;319 bw32: PDWord(Memory + PWord(@Registers[R1])^)^ := Registers[R2].D;320 bw64: PQWord(Memory + PWord(@Registers[R1])^)^ := Registers[R2].Q;317 bw8: PByte(Memory + Registers[R1].W)^ := Registers[R2].B; 318 bw16: PWord(Memory + Registers[R1].W)^ := Registers[R2].W; 319 bw32: PDWord(Memory + Registers[R1].W)^ := Registers[R2].D; 320 bw64: PQWord(Memory + Registers[R1].W)^ := Registers[R2].Q; 321 321 end; 322 322 bw32: case DataSize of 323 bw8: PByte(Memory + PDWord(@Registers[R1])^)^ := Registers[R2].B;324 bw16: PWord(Memory + PDWord(@Registers[R1])^)^ := Registers[R2].W;325 bw32: PDWord(Memory + PDWord(@Registers[R1])^)^ := Registers[R2].D;326 bw64: PQWord(Memory + PDWord(@Registers[R1])^)^ := Registers[R2].Q;323 bw8: PByte(Memory + Registers[R1].D)^ := Registers[R2].B; 324 bw16: PWord(Memory + Registers[R1].D)^ := Registers[R2].W; 325 bw32: PDWord(Memory + Registers[R1].D)^ := Registers[R2].D; 326 bw64: PQWord(Memory + Registers[R1].D)^ := Registers[R2].Q; 327 327 end; 328 328 bw64: case DataSize of 329 bw8: PByte(Memory + PQWord(@Registers[R1])^)^ := Registers[R2].B;330 bw16: PWord(Memory + PQWord(@Registers[R1])^)^ := Registers[R2].W;331 bw32: PDWord(Memory + PQWord(@Registers[R1])^)^ := Registers[R2].D;332 bw64: PQWord(Memory + PQWord(@Registers[R1])^)^ := Registers[R2].Q;329 bw8: PByte(Memory + Registers[R1].Q)^ := Registers[R2].B; 330 bw16: PWord(Memory + Registers[R1].Q)^ := Registers[R2].W; 331 bw32: PDWord(Memory + Registers[R1].Q)^ := Registers[R2].D; 332 bw64: PQWord(Memory + Registers[R1].Q)^ := Registers[R2].Q; 333 333 end; 334 334 end; -
branches/virtualcpu4/virtucpu4.lpi
r185 r186 66 66 <Modes Count="0"/> 67 67 </RunParams> 68 <RequiredPackages Count=" 1">68 <RequiredPackages Count="2"> 69 69 <Item1> 70 <PackageName Value="SynEdit"/> 71 </Item1> 72 <Item2> 70 73 <PackageName Value="LCL"/> 71 </Item 1>74 </Item2> 72 75 </RequiredPackages> 73 <Units Count="1 6">76 <Units Count="18"> 74 77 <Unit0> 75 78 <Filename Value="virtucpu4.lpr"/> … … 157 160 <ResourceBaseClass Value="Form"/> 158 161 </Unit15> 162 <Unit16> 163 <Filename Value="Forms\UFormCompilerPascal.pas"/> 164 <IsPartOfProject Value="True"/> 165 <ComponentName Value="FormCompilerPascal"/> 166 <ResourceBaseClass Value="Form"/> 167 </Unit16> 168 <Unit17> 169 <Filename Value="UCompilerPascal.pas"/> 170 <IsPartOfProject Value="True"/> 171 </Unit17> 159 172 </Units> 160 173 </ProjectOptions> -
branches/virtualcpu4/virtucpu4.lpr
r184 r186 10 10 SysUtils, Forms, UFormMain, UCpu, UMachine, UMemory, UFormDisassembler, 11 11 UFormMemory, UFormCpuState, UFormScreen, UFormConsole, UDisassembler, 12 UAssembler, UInstructionReader, UOpcode, UFormAssembler 12 UAssembler, UInstructionReader, UOpcode, UFormAssembler, UFormCompilerPascal, 13 UCompilerPascal 13 14 { you can add units after this }; 14 15
Note:
See TracChangeset
for help on using the changeset viewer.