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

Legend:

Unmodified
Added
Removed
  • branches/UltimatOS

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

    r29 r30  
    3636    TabOrder = 1
    3737  end
     38  object Label1: TLabel
     39    Left = 662
     40    Height = 22
     41    Top = 500
     42    Width = 68
     43    Caption = 'Instrukcí:'
     44  end
     45  object ButtonMemory: TButton
     46    Left = 128
     47    Height = 33
     48    Top = 496
     49    Width = 98
     50    Caption = 'Memory'
     51    OnClick = ButtonMemoryClick
     52    TabOrder = 2
     53  end
    3854  object Timer1: TTimer
    3955    Interval = 20
  • 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.