project64/Source/Project64/N64System/Debugger/Assembler.h

31 lines
524 B
C
Raw Normal View History

2017-08-18 05:08:22 +00:00
#pragma once
#include <stdint.h>
typedef void(*SYNTAX)(uint32_t* opcode);
typedef struct {
2017-09-13 10:36:03 +00:00
const char* name;
uint32_t val;
uint32_t(*base)(uint32_t val); // value shift
SYNTAX* syntax; // arguments
2017-08-18 05:08:22 +00:00
} INSTRUCTION;
typedef struct {
2017-09-13 10:36:03 +00:00
const char* name;
uint32_t val;
2017-08-18 05:08:22 +00:00
} REGISTER;
enum ParseError
{
2017-09-13 10:36:03 +00:00
ERR_NONE,
ERR_EXPECTED_REG,
ERR_INVALID_REG,
ERR_EXPECTED_VAL
2017-08-18 05:08:22 +00:00
};
class CAssembler {
public:
2017-09-13 10:36:03 +00:00
static bool AssembleLine(char* line, uint32_t* opcode, uint32_t address = 0x00000000);
2017-08-18 05:08:22 +00:00
};