Ignore:
Timestamp:
Oct 23, 2023, 11:34:54 PM (13 months ago)
Author:
chronos
Message:
  • Added: Various useful forms, assembler and disassembler classes.
Location:
branches/ByteArray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ByteArray

    • Property svn:ignore set to
      heaptrclog.trc
      lib
      ByteArray
      ByteArray.exe
      ByteArray.lps
      ByteArray.res
      ByteArray.dbg
  • branches/ByteArray/Cpu.pas

    r45 r46  
    2222    inJump, inJumpSize,
    2323    inJumpNotZero, inJumpNotZeroSize,
     24    inJumpZero, inJumpZeroSize,
    2425    inJumpRel, inJumpRelSize,
    2526    inCall, inCallSize,
     
    3637    inOtir, inOti, inOtdr, inOtd,
    3738    inCpir, inCpi, inCpdr, inCpd,
    38     inEx,
    39     inCp);
     39    inEx, inEnableInterrupts, inDisableInterrupts,
     40    inCompare);
    4041
    4142  TRegIndex = (riA, riB, riC, riD, riE, riF, riG, riH);
     
    6465    procedure InstructionJumpNotZero;
    6566    procedure InstructionJumpNotZeroSize;
     67    procedure InstructionJumpZero;
     68    procedure InstructionJumpZeroSize;
    6669    procedure InstructionJumpRel;
    6770    procedure InstructionJumpRelSize;
     
    257260end;
    258261
     262procedure TCpu.InstructionJumpZero;
     263var
     264  RegIndex: TRegIndex;
     265  Address: TBigInt;
     266begin
     267  RegIndex := ReadRegIndex;
     268  Address := Read(AddressWidth);
     269  if Byte(Regs[RegIndex]) = 0 then
     270    PC := Address;
     271end;
     272
     273procedure TCpu.InstructionJumpZeroSize;
     274var
     275  RegIndex: TRegIndex;
     276  Address: TBigInt;
     277  DataSize: Byte;
     278  AddressSize: Byte;
     279begin
     280  DataSize := Read(1);
     281  AddressSize := Read(1);
     282  RegIndex := ReadRegIndex;
     283  Address := Read(AddressSize);
     284  if Int64(Regs[RegIndex].Copy(DataSize)) = 0 then
     285    PC := Address;
     286end;
     287
    259288procedure TCpu.InstructionJumpRel;
    260289begin
     
    430459  Instructions[inJumpNotZero] := InstructionJumpNotZero;
    431460  Instructions[inJumpNotZeroSize] := InstructionJumpNotZeroSize;
     461  Instructions[inJumpZero] := InstructionJumpZero;
     462  Instructions[inJumpZeroSize] := InstructionJumpZeroSize;
    432463  Instructions[inJumpRel] := InstructionJumpRel;
    433464  Instructions[inJumpRelSize] := InstructionJumpRelSize;
Note: See TracChangeset for help on using the changeset viewer.