*
* Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
*
- * Written by Karl Bongers karl@turbobit.com
- *
* To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
+ * Other contributors include:
+ * Karl Bongers karl@turbobit.com,
+ * Johan Knol
*
*/
#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,
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,
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,
DIRECT_DATA4,
REG_ALONE,
+ IREG_ALONE,
+ BIT_ALONE,
+ BIT_REL8,
+ DIRECT_ALONE,
+ RLIST,
ADDR24,
REG_REL8,
- DIRECT_REL8
+ DIRECT_REL8,
+
+ REL8,
+ REL16,
+
+ REG_DIRECT_REL8,
+ REG_DATA8_REL8,
+ REG_DATA16_REL8,
+ IREG_DATA8_REL8,
+ IREG_DATA16_REL8
+
};
// table of dissassembled instructions
uint code, mask;
char branch;
uchar length;
-// enum op_mnemonic mnemonic;
-// enum op_operands operands;
int mnemonic;
int operands;
};