This commit is contained in:
2024-10-24 20:58:09 -05:00
commit 8923a2006d
4 changed files with 126 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef OPCODES_H
#define OPCODES_H
#include <string.h>
#include <errno.h>
#include <stdio.h>
typedef enum {
R1 = 0, R2, R3, R4, R5, R6, R7, R8 = 7
} Registers;
typedef enum {
ADD = 0x01, SUB, MUL, DIV, AND, OR, XOR, NOT, SHL, SHR, NOP, CMP, JMP, JG, JL,
OUTB, INB, HLT, ENI, INT, LIVT, PUSHA, POPA, CALL, RET, PUSH, POP
} Mnemonic;
int IsOpcode(const char*, Mnemonic*);
int IsRegister(const char*, Registers*);
void GetMnemonicText(Mnemonic mnemonic, char buffer[12]);
void GetRegisterText(Registers reg, char buffer[3]);
#endif