Ignore:
Timestamp:
Jul 5, 2022, 8:28:18 PM (23 months ago)
Author:
chronos
Message:
  • Modified: Improved sample code execution.
  • Added: Memory map form.
Location:
branches/UltimatOS
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/UltimatOS

    • Property svn:ignore set to
      UltimatOS
      UltimatOS.lps
      UltimatOS.res
      lib
  • branches/UltimatOS/Forms/UFormMain.pas

    r29 r30  
    1212
    1313  TFormMain = class(TForm)
     14    ButtonMemory: TButton;
    1415    ButtonRun: TButton;
     16    Label1: TLabel;
    1517    MemoCode: TMemo;
    1618    PaintBox1: TPaintBox;
    1719    Timer1: TTimer;
     20    procedure ButtonMemoryClick(Sender: TObject);
    1821    procedure ButtonRunClick(Sender: TObject);
    1922    procedure FormCreate(Sender: TObject);
     
    3740
    3841uses
    39   UInstructionWriter;
     42  UInstructionWriter, UFormMemory;
    4043
    4144{ TFormMain }
     
    4952procedure TFormMain.ButtonRunClick(Sender: TObject);
    5053begin
     54  Machine.Reset;
    5155  with TInstructionWriter.Create do
    5256  try
     
    5660    Free;
    5761  end;
    58   Machine.Reset;
    5962  Machine.Cpu.Run;
     63  Label1.Caption := 'Executed instructions: ' + IntToStr(Machine.Cpu.ExecutedCount);
     64end;
     65
     66procedure TFormMain.ButtonMemoryClick(Sender: TObject);
     67begin
     68  FormMemory.Memory := Machine.Memory;
     69  FormMemory.Show;
    6070end;
    6171
Note: See TracChangeset for help on using the changeset viewer.