Ignore:
Timestamp:
Jul 12, 2022, 10:43:40 PM (23 months ago)
Author:
chronos
Message:
  • Modified: More instructions.
  • Modified: Optimized instruction execution with procedure array instead case.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/Forms/UFormCpu.pas

    r216 r223  
    11unit UFormCpu;
    2 
    3 {$mode delphi}
    42
    53interface
     
    4947  I: Integer;
    5048begin
    51   if Item.Index * DataPerLine < Length(Cpu.Data) then begin
     49  if Item.Index * DataPerLine < Length(Cpu.Memory) then begin
    5250    Item.Caption := IntToHex(Item.Index * DataPerLine, 8);
    5351    Line := '';
    5452    for I := 0 to DataPerLine - 1 do
    55       Line := Line + IntToHex(Cpu.Data[Item.Index * DataPerLine + I], 4) + ' ';
     53      Line := Line + IntToHex(Cpu.Memory[Item.Index * DataPerLine + I], 4) + ' ';
    5654    Item.SubItems.Add(Line);
    5755  end;
     
    6361    if Item.Index = 0 then begin
    6462      Item.Caption := 'IP';
    65       Item.SubItems.Add(IntToHex(Cpu.IP, 8));
     63      Item.SubItems.Add(IntToHex(Cpu.InstructionPointer, 8));
    6664    end else
    6765    if Item.Index = 1 then begin
    6866      Item.Caption := 'SP';
    69       Item.SubItems.Add(IntToHex(Cpu.SP, 8));
     67      Item.SubItems.Add(IntToHex(Cpu.StackPointer, 8));
    7068    end else begin
    7169      Item.Caption := 'R' + IntToStr(Item.Index - 2);
     
    7775procedure TFormCpu.Timer1Timer(Sender: TObject);
    7876begin
    79   ListViewMemory.Items.Count := Length(Cpu.Data) div DataPerLine;
     77  ListViewMemory.Items.Count := Length(Cpu.Memory) div DataPerLine;
    8078  ListViewMemory.Refresh;
    8179  ListViewRegs.Items.Count := Length(Cpu.R) + 2;
Note: See TracChangeset for help on using the changeset viewer.