Changeset 4 for branches/bigint/FormMain.pas
- Timestamp:
- Aug 1, 2024, 10:47:04 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bigint/FormMain.pas
r3 r4 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Machine, Int, 7 Cpu ;7 Cpu, Assembler; 8 8 9 9 type … … 45 45 procedure TFormMain.FormShow(Sender: TObject); 46 46 var 47 Label1: TInt; 47 Assembler: TAssembler; 48 Lines: TStringList; 48 49 begin 49 with Machine.Memory do begin 50 WritePos(TInt(inLoadConst)); 51 WritePos(1000); 52 WritePos(Ord('A')); 50 Lines := TStringList.Create; 51 Lines.LoadFromFile('Example.asm'); 53 52 54 WritePos(TInt(inLoadConst)); 55 WritePos(1001); 56 WritePos(20); 53 Assembler := TAssembler.Create; 54 with Assembler do begin 55 Compile(Lines.Text); 56 Machine.Memory.CopyFrom(Memory, 0, 0, Memory.Size); 57 Free; 58 end; 57 59 58 Label1 := Position;60 Lines.Free; 59 61 60 WritePos(TInt(inOutput));61 WritePos(0);62 WritePos(1000);63 64 WritePos(TInt(inInc));65 WritePos(1000);66 67 WritePos(TInt(inDec));68 WritePos(1001);69 70 WritePos(TInt(inJumpNotZero));71 WritePos(1001);72 WritePos(Label1);73 74 WritePos(TInt(inHalt));75 end;76 62 Machine.Run; 77 63 end;
Note:
See TracChangeset
for help on using the changeset viewer.