Ignore:
Timestamp:
Apr 25, 2019, 4:20:43 PM (6 years ago)
Author:
chronos
Message:
  • Added: Basic assembler window.
Location:
branches/virtualcpu4/Forms
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/virtualcpu4/Forms/UFormDisassembler.lfm

    r181 r184  
    11object FormDisassembler: TFormDisassembler
    2   Left = 687
    3   Height = 691
    4   Top = 416
    5   Width = 721
     2  Left = 587
     3  Height = 576
     4  Top = 248
     5  Width = 601
    66  Caption = 'Disassembler'
    7   ClientHeight = 691
    8   ClientWidth = 721
    9   DesignTimePPI = 144
     7  ClientHeight = 576
     8  ClientWidth = 601
     9  DesignTimePPI = 120
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    12   LCLVersion = '2.0.0.4'
     12  OnShow = FormShow
     13  LCLVersion = '2.0.2.0'
    1314  object ListView1: TListView
    14     Left = 8
    15     Height = 675
    16     Top = 8
    17     Width = 705
    18     Align = alClient
    19     BorderSpacing.Around = 8
     15    Left = 7
     16    Height = 521
     17    Top = 7
     18    Width = 587
     19    Align = alCustom
     20    Anchors = [akTop, akLeft, akRight, akBottom]
     21    BorderSpacing.Around = 7
    2022    Columns = <   
    2123      item
    2224        Caption = 'Address'
    23         Width = 100
     25        Width = 83
    2426      end   
    2527      item
    2628        Caption = 'Opcode'
    27         Width = 150
     29        Width = 125
    2830      end   
    2931      item
    3032        Caption = 'Assembly'
    31         Width = 440
     33        Width = 367
    3234      end>
    3335    OwnerData = True
     36    ParentFont = False
    3437    ReadOnly = True
    3538    RowSelect = True
     
    3841    OnData = ListView1Data
    3942  end
     43  object ButtonReload: TButton
     44    Left = 7
     45    Height = 31
     46    Top = 536
     47    Width = 94
     48    Anchors = [akLeft, akBottom]
     49    Caption = 'Reload'
     50    OnClick = ButtonReloadClick
     51    TabOrder = 1
     52  end
    4053end
  • branches/virtualcpu4/Forms/UFormDisassembler.pas

    r181 r184  
    66
    77uses
    8   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls,
     8  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
    99  UDisassembler;
    1010
     
    1414
    1515  TFormDisassembler = class(TForm)
     16    ButtonReload: TButton;
    1617    ListView1: TListView;
     18    procedure ButtonReloadClick(Sender: TObject);
    1719    procedure FormCreate(Sender: TObject);
    1820    procedure FormDestroy(Sender: TObject);
     21    procedure FormShow(Sender: TObject);
    1922    procedure ListView1Data(Sender: TObject; Item: TListItem);
    2023  private
     
    3942end;
    4043
     44procedure TFormDisassembler.ButtonReloadClick(Sender: TObject);
     45begin
     46  Disassembler.Process;
     47  Reload;
     48end;
     49
    4150procedure TFormDisassembler.FormDestroy(Sender: TObject);
    4251begin
    4352  Disassembler.Free;
     53end;
     54
     55procedure TFormDisassembler.FormShow(Sender: TObject);
     56begin
     57  ButtonReload.Click;
    4458end;
    4559
  • branches/virtualcpu4/Forms/UFormMain.lfm

    r183 r184  
    8282    TabOrder = 6
    8383  end
     84  object ButtonAssembler: TButton
     85    Left = 309
     86    Height = 32
     87    Top = 128
     88    Width = 154
     89    Caption = 'Assembler'
     90    OnClick = ButtonAssemblerClick
     91    ParentFont = False
     92    TabOrder = 7
     93  end
    8494end
  • branches/virtualcpu4/Forms/UFormMain.pas

    r183 r184  
    1414
    1515  TFormMain = class(TForm)
     16    ButtonAssembler: TButton;
    1617    ButtonScreen: TButton;
    1718    ButtonDisassembler: TButton;
     
    2122    ButtonStart: TButton;
    2223    ButtonStop: TButton;
     24    procedure ButtonAssemblerClick(Sender: TObject);
    2325    procedure ButtonConsoleClick(Sender: TObject);
    2426    procedure ButtonCpuStateClick(Sender: TObject);
     
    4749
    4850uses
    49   UFormDisassembler, UFormMemory, UFormCpuState, UFormScreen, UFormConsole;
     51  UFormDisassembler, UFormMemory, UFormCpuState, UFormScreen, UFormConsole,
     52  UFormAssembler;
    5053
    5154{ TFormMain }
     
    6164    FormDisassembler := TFormDisassembler.Create(Self);
    6265  FormDisassembler.Disassembler.Cpu := Machine.Cpu;
    63   FormDisassembler.Disassembler.Process;
    6466  FormDisassembler.Show;
    6567  FormDisassembler.Reload;
     
    99101  FormConsole.Machine := Machine;
    100102  FormConsole.Show;
     103end;
     104
     105procedure TFormMain.ButtonAssemblerClick(Sender: TObject);
     106begin
     107  if not Assigned(FormAssembler) then
     108    FormAssembler := TFormAssembler.Create(Self);
     109  FormAssembler.Assembler.InstructionWriter.Cpu := Machine.Cpu;
     110  FormAssembler.Show;
    101111end;
    102112
Note: See TracChangeset for help on using the changeset viewer.