Ignore:
Timestamp:
Oct 14, 2020, 7:51:40 PM (4 years ago)
Author:
chronos
Message:
  • Added: Support for indirect instruction parameters used mailny for LD, ST, IN and OUT.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/UInstructions.pas

    r216 r218  
    99
    1010type
    11   TParamType = (ptNone, ptNumber, ptReg);
     11  TParamType = (ptNone, ptNumber, ptReg, ptRegIndirect);
    1212  TParamTypeArray = array of TParamType;
     13
    1314  TInstructionInfo = class
    1415    Instruction: TInstruction;
     
    7778  AddNew(inInc, 'INC', [ptReg], 'Increments value in specified register.');
    7879  AddNew(inDec, 'DEC', [ptReg], 'Decrements value in specified register.');
    79   AddNew(inLoad, 'LD', [ptReg, ptReg], 'Loads value from memory to register.');
    80   AddNew(inStore, 'ST', [ptReg, ptReg], 'Stores value from register to memory.');
     80  AddNew(inLoad, 'LD', [ptReg, ptRegIndirect], 'Loads value from memory to register.');
     81  AddNew(inStore, 'ST', [ptRegIndirect, ptReg], 'Stores value from register to memory.');
    8182  AddNew(inAdd, 'ADD', [ptReg, ptReg], 'Adds second register to first register.');
    8283  AddNew(inSub, 'SUB', [ptReg, ptReg], 'Subtracts second register from first register.');
    83   AddNew(inIn, 'IN', [ptReg, ptReg], 'Reads value from input port to register.');
    84   AddNew(inOut, 'OUT', [ptReg, ptReg], 'Writes value from register to output port.');
     84  AddNew(inIn, 'IN', [ptReg, ptRegIndirect], 'Reads value from input port to register.');
     85  AddNew(inOut, 'OUT', [ptRegIndirect, ptReg], 'Writes value from register to output port.');
    8586  AddNew(inJumpZero, 'JZ', [ptReg, ptNumber], 'Jumps to given address if value of register is zero');
    8687  AddNew(inJumpNotZero, 'JNZ', [ptReg, ptNumber], 'Jumps to given address if value of register is not zero');
Note: See TracChangeset for help on using the changeset viewer.