summaryrefslogtreecommitdiff
path: root/miniasm/optable.h
blob: d0b18b30c542ad8e1d9655e62944dfdc981ee945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

enum {
	NOF_OPCODES = 20,
	MAX_MNEMONIC_SIZE = 5,
	MAX_OPERANDS = 2
};

typedef struct OpcodeInfo
{
	char mnemonic[MAX_MNEMONIC_SIZE];
	Opcode opcode;
	int operands;
} OpcodeInfo;

OpcodeInfo opcodeTable[NOF_OPCODES];

intHashTable opcode_ht;

void opcode_table_init( );
void opcode_table_done( );
OpcodeInfo *lookup_opcode( char *mnemonic );