#include "stypes.h"
-
-#if 0
-enum {
- REG,
- IND_REG,
- IND_REG_PLUS,
- IND_REG_OFFSET,
- DIRECT,
- DATA8,
- DATA16
-};
-#endif
-
+/* this needs to match char *op_mnemonic_str[] definition in glob.cc */
enum {
BAD_OPCODE=0,
ADD,
NEG,
SEXT,
MUL,
-DIV,
+DIV_w,
+DIV_d,
+DIVU_b,
+DIVU_w,
+DIVU_d,
DA,
ASL,
ASR,
MOVC,
MOVX,
PUSH,
+PUSHU,
POP,
+POPU,
XCH,
SETB,
CLR,
MOV,
ANL,
ORL,
-BR,
JMP,
CALL,
RET,
-Bcc,
+RETI,
+BCC,
+BCS,
+BEQ,
+BG,
+BGE,
+BGT,
+BL,
+BLE,
+BLT,
+BMI,
+BNE,
+BNV,
+BOV,
+BPL,
+BR,
JB,
+JBC,
JNB,
CJNE,
DJNZ,
BKPT,
TRAP,
RESET,
+FCALL,
+FJMP,
+IREG,
};
extern char *op_mnemonic_str[];
+/* this classifies the operands and is used in the dissassembly
+ to print the operands. Its also used in the simulation to characterize
+ the op-code function.
+ */
enum op_operands {
- // the repeating common parameter encoding for ADD, ADDC, SUB, AND...
+ // the repeating parameter encoding for ADD, ADDC, SUB, SUBB, AND, XOR, ...
REG_REG ,
REG_IREG ,
IREG_REG ,
// odd-ball ones
NO_OPERANDS, // for NOP
C_BIT,
- NOTC_BIT,
+ C_NOTBIT,
REG_DATA4,
IREG_DATA4,
IREGINC_DATA4,
IREGOFF8_DATA4,
IREGOFF16_DATA4,
- DIRECT_DATA4
+ DIRECT_DATA4,
+
+ REG_ALONE,
+ IREG_ALONE,
+ BIT_ALONE,
+ BIT_REL8,
+ DIRECT_ALONE,
+ RLIST,
+ ADDR24,
+ REG_REL8,
+ DIRECT_REL8,
+
+ REL8,
+ REL16
};
// table of dissassembled instructions
uint code, mask;
char branch;
uchar length;
-// enum op_mnemonic mnemonic;
-// enum op_operands operands;
int mnemonic;
int operands;
};