Files
assm-test/includes/opcodes.h
T

30 lines
625 B
C

#ifndef OPCODES_H
#define OPCODES_H
#include <string.h>
#include "token.h"
#define OPCODECOUNT 12
#define REGISTERCOUNT 8
typedef struct {
char* lexeme;
TokenType op;
TokenClass parameter_one;
TokenClass parameter_two;
} Instruction;
typedef struct {
char* lexeme;
TokenType type;
} Register;
extern Instruction instructions[OPCODECOUNT];
extern Register registers[REGISTERCOUNT];
int IsOpcode(const char*, TokenType*);
int IsRegister(const char*, TokenType*);
const Instruction* GetOpcodeDetails(TokenType);
unsigned char GetInstructionMask(TokenType type, TokenClass parameterOneType);
#endif