Files
lang-assm/includes/opcodes.h
T

23 lines
698 B
C

#ifndef OPCODES_H
#define OPCODES_H
#include <string.h>
#include <errno.h>
#include <stdio.h>
typedef enum {
R1 = 1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19,
R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31, R32, RBP, RSP, RIP
} Registers;
typedef enum {
ADD = 0x01, SUB, MUL, DIV, MOV, AND, OR, XOR, NOT, SHL, SHR, NOP, CMP, JMP, JZ, JG, JL,
OUTB, INB, HLT, CLI, ENI, INT, LIVT, PUSHA, POPA, CALL, RET, PUSH, POP
} Mnemonics;
int IsOpcode(const char*, Mnemonics*);
int IsRegister(const char*, Registers*);
void GetMnemonicText(Mnemonics mnemonic, char buffer[12]);
void GetRegisterText(Registers reg, char buffer[5]);
#endif