1 /* cpu.h OIL cpu-description header-file */ 2 /* (c) in 2007 by Volker Barthelmann */ 3 4 5 /* maximum number of operands in one mnemonic */ 6 #define MAX_OPERANDS 5 7 8 /* maximum number of mnemonic-qualifiers per mnemonic */ 9 #define MAX_QUALIFIERS 0 10 11 /* maximum number of additional command-line-flags for this cpu */ 12 13 /* data type to represent a target-address */ 14 typedef int32_t taddr; 15 typedef uint32_t utaddr; 16 17 #define LITTLEENDIAN 0 18 #define BIGENDIAN 1 19 #define VASM_CPU_OIL 1 20 21 /* minimum instruction alignment */ 22 #define INST_ALIGN 4 23 24 /* default alignment for n-bit data */ 25 #define DATA_ALIGN(n) ((n)<=8?1:4) 26 27 /* operand class for n-bit data definitions */ 28 #define DATA_OPERAND(n) OP_ADDR 29 30 #define ALLOW_EMPTY_OPS 1 31 32 #define cc reg 33 34 /* type to store each operand */ 35 typedef struct { 36 int type; 37 expr *value; 38 } operand; 39 40 /* operand-types */ 41 #define OP_NONE 0 42 #define OP_ADDR 1 43 #define OP_ADDR_IND 2 44 #define OP_INDEX 3 45 #define OP_DELEXT 4 46 #define OP_UE 5 47 #define OP_VALUE 6 48 #define OP_WPOS 7 49 #define OP_NUMBITS 8 50 #define OP_INIBITS 9 51 #define OP_STRUCTP 10 52 #define OP_DEVICE 11 53 54 typedef struct { 55 unsigned int opcode; 56 unsigned int encoding; 57 } mnemonic_extension; 58 59 /* encoding types */ 60 #define EN_NORMAL 0 61 #define EN_JIF 16 62