Add template_r32_rm32(int calc_type) function

This commit is contained in:
tuz358
2018-03-16 13:57:25 +09:00
parent 6092f27761
commit 5395554d77
2 changed files with 94 additions and 0 deletions

View File

@@ -13,6 +13,16 @@ const uint32_t ZF = 1 << 6;
const int IMM8 = 0;
const int IMM32 = 1;
// calculation type
const int ADD = 0;
const int OR = 1;
const int ADC = 2;
const int SBB = 3;
const int AND = 4;
const int SUB = 5;
const int XOR = 6;
const int CMP = 7;
class Instructions{
private:
void init_instructions();
@@ -33,6 +43,10 @@ public:
void calc_modrm();
void execute_opcode(uint8_t opcode);
// templates
void template_r32_rm32(int calc_type);
void calc_r32_rm32(uint32_t *src, uint32_t *dst, int calc_type);
void add_rm32_r32(); // 0x01
void add_r32_rm32(); // 0x03
void add_eax_imm32(); // 0x05