Ignore:
Timestamp:
Nov 25, 2023, 11:47:52 PM (12 months ago)
Author:
chronos
Message:
  • Fixed: Assembler and disassembler to work correctly with supported instructions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ByteArray/Core.pas

    r58 r59  
    7878begin
    7979  Machine := TMachine.Create;
    80   InitMachine;
     80  //InitMachine;
    8181  LoadConfig;
    8282
     
    118118  end;
    119119  FormDisassembler.Disassembler.Memory := Machine.Memory;
     120  FormDisassembler.Disassembler.DataWidth := Machine.Cpu.DataWidth;
     121  FormDisassembler.Disassembler.AddressWidth := Machine.Cpu.AddressWidth;
    120122  FormDisassembler.Show;
    121123end;
     
    222224    // LD A, 'A'
    223225    WriteInstruction(inLoadConst);
    224     WriteRegister(riA);
     226    WriteRegister(0);
    225227    Write(DataWidth, Ord('A'));
    226228
    227229    // LD B, 8
    228230    WriteInstruction(inLoadConst);
    229     WriteRegister(riB);
     231    WriteRegister(1);
    230232    Write(DataWidth, Machine.Serial.BaseAddress);
    231233
    232234    // OUT (B), A
    233235    WriteInstruction(inOutput);
    234     WriteRegister(riB);
    235     WriteRegister(riA);
     236    WriteRegister(1);
     237    WriteRegister(0);
    236238
    237239    // LD B,
    238240    WriteInstruction(inLoadConst);
    239     WriteRegister(riB);
     241    WriteRegister(1);
    240242    Write(DataWidth, Machine.FrameBuffer.BaseAddress);
    241243
    242244    WriteInstruction(inLoadConst);
    243     WriteRegister(riC);
     245    WriteRegister(2);
    244246    Write(DataWidth, 10);
    245247
     
    247249
    248250    WriteInstruction(inOutput);
    249     WriteRegister(riB);
    250     WriteRegister(riA);
     251    WriteRegister(1);
     252    WriteRegister(0);
    251253
    252254    WriteInstruction(inInc);
    253     WriteRegister(riA);
     255    WriteRegister(0);
    254256
    255257    WriteInstruction(inDec);
    256     WriteRegister(riC);
     258    WriteRegister(2);
    257259
    258260    WriteInstruction(inJumpNotZero);
    259     WriteRegister(riC);
     261    WriteRegister(2);
    260262    Write(AddressWidth, Loop);
    261263
     
    278280      else ThemeManager1.Theme := ThemeManager1.Themes.FindByName('System');
    279281    StartUpForm := ReadStringWithDefault('StartUpForm', 'Screen');
     282    AutoStartMachine := ReadBoolWithDefault('AutoStartMachine', True);
    280283  finally
    281284    Free;
     
    295298      else DeleteValue('Theme');
    296299    WriteString('StartUpForm', StartUpForm);
     300    WriteBool('AutoStartMachine', AutoStartMachine);
    297301  finally
    298302    Free;
Note: See TracChangeset for help on using the changeset viewer.