22 lines
552 B
C
22 lines
552 B
C
#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, MOV, 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 |