Changeset 8
- Timestamp:
- Aug 2, 2024, 9:36:35 AM (5 months ago)
- Location:
- branches/bigint
- Files:
-
- 82 added
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/bigint
- Property svn:ignore
-
old new 4 4 BigIntVM.dbg 5 5 lib 6 heaptrclog.trc
-
- Property svn:ignore
-
branches/bigint/Assembler.pas
r7 r8 5 5 uses 6 6 Classes, SysUtils, Instructions, Cpu, Generics.Collections, 7 Memory, Message, Parser, Int;7 IntMemory, Message, Parser, Int; 8 8 9 9 type … … 32 32 public 33 33 InstructionSet: TInstructionSet; 34 Memory: T Memory;34 Memory: TIntMemory; 35 35 Labels: TDictionary<string, TInt>; 36 36 LabelRefs: TList<TLabelRef>; … … 286 286 Parser.OnError := Error; 287 287 Message := TMessages.Create; 288 Memory := T Memory.Create;288 Memory := TIntMemory.Create; 289 289 InstructionSet := TInstructionSet.Create; 290 290 Labels := TDictionary<string, TInt>.Create; -
branches/bigint/BigIntVM.lpi
r6 r8 25 25 <IncludeFiles Value="$(ProjOutDir)"/> 26 26 <OtherUnitFiles Value="Forms"/> 27 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode }"/>27 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 28 28 </SearchPaths> 29 29 <Parsing> … … 59 59 </CompilerOptions> 60 60 </Item> 61 <SharedMatrixOptions Count="2"> 62 <Item1 Targets="Common" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/> 63 <Item2 ID="202440807568" Targets="Common" Modes="Release" Value="-CX -XX -O3"/> 64 </SharedMatrixOptions> 61 65 </BuildModes> 62 66 <PublishOptions> … … 69 73 <RequiredPackages> 70 74 <Item> 75 <PackageName Value="Common"/> 76 <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/> 77 </Item> 78 <Item> 71 79 <PackageName Value="LCL"/> 72 80 </Item> … … 89 97 </Unit> 90 98 <Unit> 91 <Filename Value=" Memory.pas"/>99 <Filename Value="IntMemory.pas"/> 92 100 <IsPartOfProject Value="True"/> 93 101 </Unit> … … 145 153 <ComponentName Value="FormDisassembler"/> 146 154 <ResourceBaseClass Value="Form"/> 155 </Unit> 156 <Unit> 157 <Filename Value="Forms/FormMemory.pas"/> 158 <IsPartOfProject Value="True"/> 159 <ComponentName Value="FormMemory"/> 147 160 </Unit> 148 161 </Units> … … 156 169 <IncludeFiles Value="$(ProjOutDir)"/> 157 170 <OtherUnitFiles Value="Forms"/> 158 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode }"/>171 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 159 172 </SearchPaths> 160 173 <Parsing> -
branches/bigint/BigIntVM.lpr
r6 r8 3 3 uses 4 4 {$IFDEF UNIX} 5 cthreads, 5 cthreads, clocale, 6 6 {$ENDIF} 7 7 {$IFDEF HASAMIGA} 8 8 athreads, 9 9 {$ENDIF} 10 Interfaces, // this includes the LCL widgetset11 Forms, FormMain, FormDisassembler, Cpu, Memory, Int, Machine, DeviceManager,12 Screen, Console, Device, Assembler, Instructions, Parser, Message,13 Disassembler10 Interfaces, SysUtils, // this includes the LCL widgetset 11 Forms, FormMain, FormDisassembler, FormMemory, Cpu, IntMemory, Int, Machine, 12 DeviceManager, Screen, Console, Device, Assembler, Instructions, Parser, 13 Message, Disassembler, CommonPackage 14 14 { you can add units after this }; 15 15 16 16 {$R *.res} 17 17 18 {$if declared(UseHeapTrace)} 19 const 20 HeapTraceLog = 'heaptrclog.trc'; 21 {$ENDIF} 22 18 23 begin 24 {$if declared(UseHeapTrace)} 25 // Heap trace 26 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 27 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 28 {$ENDIF} 29 19 30 RequireDerivedFormResource:=True; 20 31 Application.Scaled:=True; -
branches/bigint/Disassembler.pas
r7 r8 4 4 5 5 uses 6 Classes, SysUtils, Cpu, Instructions, StrUtils, Memory, Int;6 Classes, SysUtils, Cpu, Instructions, StrUtils, IntMemory, Int; 7 7 8 8 type … … 12 12 TDisassembler = class 13 13 InstructionSet: TInstructionSet; 14 Memory: T Memory;14 Memory: TIntMemory; 15 15 procedure Disassemble(Lines: TStrings); 16 16 procedure SaveToFile(FileName: string); -
branches/bigint/Forms/FormDisassembler.pas
r6 r8 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Disassembler; 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Disassembler, 7 FormEx; 7 8 8 9 type … … 10 11 { TFormDisassembler } 11 12 12 TFormDisassembler = class(TForm )13 TFormDisassembler = class(TFormEx) 13 14 MemoCode: TMemo; 14 15 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); -
branches/bigint/Forms/FormMain.pas
r6 r8 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Machine, Int,7 Cpu, Assembler, FormDisassembler;6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Machine, 7 Assembler, FormDisassembler, FormEx, FormMemory; 8 8 9 9 type … … 11 11 { TFormMain } 12 12 13 TFormMain = class(TForm )13 TFormMain = class(TFormEx) 14 14 Memo1: TMemo; 15 15 procedure FormCreate(Sender: TObject); … … 20 20 public 21 21 SubFormDisassembler: TFormDisassembler; 22 SubFormMemory: TFormMemory; 22 23 Machine: TMachine; 23 24 end; … … 41 42 procedure TFormMain.FormDestroy(Sender: TObject); 42 43 begin 44 FreeAndNil(SubFormMemory); 45 FreeAndNil(SubFormDisassembler); 43 46 FreeAndNil(Machine); 44 47 end; … … 66 69 SubFormDisassembler.Disassembler.Memory := Machine.Memory; 67 70 SubFormDisassembler.Show; 71 72 SubFormMemory := TFormMemory.Create(nil); 73 SubFormMemory.Memory := Machine.Memory; 74 SubFormMemory.Show; 68 75 end; 69 76 -
branches/bigint/IntMemory.pas
r7 r8 1 unit Memory;1 unit IntMemory; 2 2 3 3 interface … … 8 8 type 9 9 10 { T Memory }10 { TIntMemory } 11 11 12 T Memory = class12 TIntMemory = class 13 13 private 14 14 FData: array of TInt; … … 21 21 procedure WritePos(Data: TInt); 22 22 function ReadPos: TInt; 23 procedure CopyFrom(Source: T Memory; Dst, Src, Count: TInt);23 procedure CopyFrom(Source: TIntMemory; Dst, Src, Count: TInt); 24 24 procedure WriteStringPos(Value: string); 25 25 property Size: TInt read GetSize write SetSize; … … 31 31 implementation 32 32 33 { T Memory }33 { TIntMemory } 34 34 35 function T Memory.GetSize: TInt;35 function TIntMemory.GetSize: TInt; 36 36 begin 37 37 Result := Length(FData); 38 38 end; 39 39 40 procedure T Memory.SetSize(AValue: TInt);40 procedure TIntMemory.SetSize(AValue: TInt); 41 41 begin 42 42 SetLength(FData, AValue); 43 43 end; 44 44 45 procedure T Memory.Write(Address, Data: TInt);45 procedure TIntMemory.Write(Address, Data: TInt); 46 46 begin 47 47 FData[Address] := Data; 48 48 end; 49 49 50 function T Memory.Read(Address: TInt): TInt;50 function TIntMemory.Read(Address: TInt): TInt; 51 51 begin 52 52 Result := FData[Address]; 53 53 end; 54 54 55 procedure T Memory.WritePos(Data: TInt);55 procedure TIntMemory.WritePos(Data: TInt); 56 56 begin 57 57 Write(FPosition, Data); … … 59 59 end; 60 60 61 function T Memory.ReadPos: TInt;61 function TIntMemory.ReadPos: TInt; 62 62 begin 63 63 Result := Read(FPosition); … … 65 65 end; 66 66 67 procedure T Memory.CopyFrom(Source: TMemory; Dst, Src, Count: TInt);67 procedure TIntMemory.CopyFrom(Source: TIntMemory; Dst, Src, Count: TInt); 68 68 var 69 69 I: Integer; … … 76 76 end; 77 77 78 procedure T Memory.WriteStringPos(Value: string);78 procedure TIntMemory.WriteStringPos(Value: string); 79 79 var 80 80 I: Integer; -
branches/bigint/Machine.pas
r2 r8 4 4 5 5 uses 6 Classes, SysUtils, Cpu, Memory, Console, DeviceManager;6 Classes, SysUtils, Cpu, IntMemory, Console, DeviceManager; 7 7 8 8 type … … 12 12 TMachine = class 13 13 Cpu: TCpu; 14 Memory: T Memory;14 Memory: TIntMemory; 15 15 Console: TConsole; 16 16 DeviceManager: TDeviceManager; … … 26 26 constructor TMachine.Create; 27 27 begin 28 Memory := T Memory.Create;28 Memory := TIntMemory.Create; 29 29 Memory.Size := 10000; 30 30 Console := TConsole.Create;
Note:
See TracChangeset
for help on using the changeset viewer.