Ignore:
Timestamp:
Apr 11, 2019, 11:43:06 PM (6 years ago)
Author:
chronos
Message:
  • Added: More instructions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/virtualcpu4/UInstructionWriter.pas

    r171 r173  
    2424    procedure Nop;
    2525    procedure Halt;
    26     procedure LoadConst(Reg: Byte; Value: QWord);
    27     procedure Increment(Reg: Byte);
    28     procedure Decrement(Reg: Byte);
     26    procedure Loadi(Reg: TRegIndex; Value: QWord);
     27    procedure Increment(Reg: TRegIndex);
     28    procedure Decrement(Reg: TRegIndex);
    2929    procedure Jump(Value: QWord);
    3030    procedure JumpNotZero(Value: QWord);
    3131    procedure DataPrefix8;
    32     procedure StoreMem(RegAddr, RegSrc: Byte);
    33     procedure LoadMem(RegDst, RegAddr: Byte);
    34     procedure Output(Port: TAddress; Reg: Byte);
    35     procedure Input(Reg: Byte; Port: TAddress);
    36     procedure Test(Reg: Byte);
     32    procedure DataPrefix16;
     33    procedure DataPrefix32;
     34    procedure DataPrefix64;
     35    procedure StoreMem(RegAddr, RegSrc: TRegIndex);
     36    procedure LoadMem(RegDst, RegAddr: TRegIndex);
     37    procedure Output(Port: TAddress; Reg: TRegIndex);
     38    procedure Input(Reg: TRegIndex; Port: TAddress);
     39    procedure Test(Reg: TRegIndex);
    3740  end;
    3841
     
    5255end;
    5356
    54 procedure TInstructionWriter.LoadConst(Reg: Byte; Value: QWord);
     57procedure TInstructionWriter.Loadi(Reg: TRegIndex; Value: QWord);
    5558begin
    56   Write8(Byte(opLoadConst));
     59  Write8(Byte(opLoadi));
    5760  Write8(Reg);
    5861  WriteData(Value);
    5962end;
    6063
    61 procedure TInstructionWriter.Increment(Reg: Byte);
     64procedure TInstructionWriter.Increment(Reg: TRegIndex);
    6265begin
    6366  Write8(Byte(opInc));
     
    6568end;
    6669
    67 procedure TInstructionWriter.Decrement(Reg: Byte);
     70procedure TInstructionWriter.Decrement(Reg: TRegIndex);
    6871begin
    6972  Write8(Byte(opDec));
     
    8891end;
    8992
    90 procedure TInstructionWriter.StoreMem(RegAddr, RegSrc: Byte);
     93procedure TInstructionWriter.DataPrefix16;
     94begin
     95  Write8(Byte(opDataPrefix16));
     96end;
     97
     98procedure TInstructionWriter.DataPrefix32;
     99begin
     100  Write8(Byte(opDataPrefix32));
     101end;
     102
     103procedure TInstructionWriter.DataPrefix64;
     104begin
     105  Write8(Byte(opDataPrefix64));
     106end;
     107
     108procedure TInstructionWriter.StoreMem(RegAddr, RegSrc: TRegIndex);
    91109begin
    92110  Write8(Byte(opStoreMem));
     
    95113end;
    96114
    97 procedure TInstructionWriter.LoadMem(RegDst, RegAddr: Byte);
     115procedure TInstructionWriter.LoadMem(RegDst, RegAddr: TRegIndex);
    98116begin
    99117  Write8(Byte(opLoadMem));
     
    102120end;
    103121
    104 procedure TInstructionWriter.Output(Port: TAddress; Reg: Byte);
     122procedure TInstructionWriter.Output(Port: TAddress; Reg: TRegIndex);
    105123begin
    106124  Write8(Byte(opOut));
     
    109127end;
    110128
    111 procedure TInstructionWriter.Input(Reg: Byte; Port: TAddress);
     129procedure TInstructionWriter.Input(Reg: TRegIndex; Port: TAddress);
    112130begin
    113131  Write8(Byte(opIn));
     
    116134end;
    117135
    118 procedure TInstructionWriter.Test(Reg: Byte);
     136procedure TInstructionWriter.Test(Reg: TRegIndex);
    119137begin
    120138  Write8(Byte(opTest));
Note: See TracChangeset for help on using the changeset viewer.