#ifndef NQ_MNEMONICS_H
#define NQ_MNEMONICS_H

#include <stdint.h>

/* operand types */
#define REG      1
#define REGPTR   2
#define IMM      3
#define PCOFF    4

enum {
	MNEM_ADD,
	MNEM_SUB,
	MNEM_MUL,
	MNEM_DIV,
	MNEM_AND,
	MNEM_OR,
	MNEM_XOR,
	MNEM_LSL,
	MNEM_LSR,
	MNEM_ASL,
	MNEM_ASR,
	MNEM_ROL,
	MNEM_ROR,
	MNEM_NOT,
	MNEM_NEG,
	MNEM_BTC,
	MNEM_BTS,
	MNEM_MOV,
	MNEM_ST_B,
	MNEM_ST_W,
	MNEM_LD_BL,
	MNEM_LD_BH,
	MNEM_LD_W,
	MNEM_LDI_BL,
	MNEM_LDI_BH,
	MNEM_BEQ,
	MNEM_BNE,
	MNEM_BGT,
	MNEM_BGE,
	MNEM_BLT,
	MNEM_BLE,
	MNEM_BRA,
	MNEM_JMP,
	MNEM_ADDPC,
	MNEM_NOP,

	MNEM_LAST
};

struct operand {
	uint8_t type;
	uint8_t shift;
};

struct mnemonic {
	const char *mnem;
	uint16_t    bits;
	uint16_t    mask;
	struct operand operands[3];
};

extern const struct mnemonic mnemonics[];

#endif