Ignore:
Timestamp:
Apr 25, 2019, 4:20:43 PM (6 years ago)
Author:
chronos
Message:
  • Added: Basic assembler window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/virtualcpu4/UCpu.pas

    r183 r184  
    138138  end;
    139139
    140   TOpcodeParam = (prNone, prReg, prData, prAddr, prAddrRel);
    141   TOpcodeDef = record
    142     Name: string;
    143     Param1: TOpcodeParam;
    144     Param2: TOpcodeParam;
    145     Param3: TOpcodeParam;
    146     Prefix: Boolean;
    147   end;
    148 
    149140const
    150141  BitWidthBytes: array[TBitWidth] of Byte = (0, 1, 2, 4, 8);
    151142  BitWidthText: array[TBitWidth] of string = ('None', '8-bit', '16-bit', '32-bit', '64-bit');
    152   OpcodeDef: array[TOpcode] of TOpcodeDef = (
    153     (Name: 'NOP'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    154     (Name: 'HALT'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    155     (Name: 'LD'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    156     (Name: 'LDI'; Param1: prReg; Param2: prData; Param3: prNone; Prefix: False),
    157     (Name: 'JP'; Param1: prAddr; Param2: prNone; Param3: prNone; Prefix: False),
    158     (Name: 'JPZ'; Param1: prAddr; Param2: prNone; Param3: prNone; Prefix: False),
    159     (Name: 'JPNZ'; Param1: prAddr; Param2: prNone; Param3: prNone; Prefix: False),
    160     (Name: 'JR'; Param1: prAddrRel; Param2: prNone; Param3: prNone; Prefix: False),
    161     (Name: 'JRZ'; Param1: prAddrRel; Param2: prNone; Param3: prNone; Prefix: False),
    162     (Name: 'JRNZ'; Param1: prAddrRel; Param2: prNone; Param3: prNone; Prefix: False),
    163     (Name: 'NEG'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    164     (Name: 'CLR'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    165     (Name: 'LDM'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    166     (Name: 'STM'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    167     (Name: 'EX'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    168     (Name: 'PUSH'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    169     (Name: 'POP'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    170     (Name: 'CALL'; Param1: prAddr; Param2: prNone; Param3: prNone; Prefix: False),
    171     (Name: 'RET'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    172     (Name: 'ADD'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    173     (Name: 'ADDI'; Param1: prReg; Param2: prData; Param3: prNone; Prefix: False),
    174     (Name: 'SUB'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    175     (Name: 'SUBI'; Param1: prReg; Param2: prData; Param3: prNone; Prefix: False),
    176     (Name: 'INC'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    177     (Name: 'DEC'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    178     (Name: 'IN'; Param1: prReg; Param2: prAddr; Param3: prNone; Prefix: False),
    179     (Name: 'OUT'; Param1: prAddr; Param2: prReg; Param3: prNone; Prefix: False),
    180     (Name: 'SHL'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    181     (Name: 'SHR'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    182     (Name: 'DP8'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    183     (Name: 'DP16'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    184     (Name: 'DP32'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    185     (Name: 'DP64'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    186     (Name: 'DS'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    187     (Name: 'AS'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: False),
    188     (Name: 'TEST'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: False),
    189     (Name: 'AND'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    190     (Name: 'OR'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    191     (Name: 'XOR'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    192     (Name: 'LDDR'; Param1: prReg; Param2: prReg; Param3: prReg; Prefix: False),
    193     (Name: 'LDDR'; Param1: prReg; Param2: prReg; Param3: prReg; Prefix: False),
    194     (Name: 'MUL'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    195     (Name: 'DIV'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    196     (Name: 'MOD'; Param1: prReg; Param2: prReg; Param3: prNone; Prefix: False),
    197     (Name: 'AP8'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    198     (Name: 'AP16'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    199     (Name: 'AP32'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    200     (Name: 'AP64'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True),
    201     (Name: 'CON'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: True)
    202   );
    203143
    204144implementation
Note: See TracChangeset for help on using the changeset viewer.