Add opcode_81(0x81) instruction

This commit is contained in:
tuz358
2018-03-16 12:29:40 +09:00
parent 85f4e8d381
commit 795395758d
2 changed files with 38 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ public:
void push_imm8(); // 0x6a
void je_imm8(); // 0x74
void jne_imm8(); // 0x75
void opcode_81(); // 0x81
void opcode_83(); // 0x83
void mov_rm32_r32(); // 0x89
void mov_r32_rm32(); // 0x8b

View File

@@ -80,6 +80,7 @@ void Instructions::init_instructions(){
this->instructions[0x6a] = &Instructions::push_imm8;
this->instructions[0x74] = &Instructions::je_imm8;
this->instructions[0x75] = &Instructions::jne_imm8;
this->instructions[0x83] = &Instructions::opcode_81;
this->instructions[0x83] = &Instructions::opcode_83;
this->instructions[0x89] = &Instructions::mov_rm32_r32;
this->instructions[0x8b] = &Instructions::mov_r32_rm32;
@@ -1157,6 +1158,42 @@ void Instructions::jne_imm8(){
this->eip++;
}
void Instructions::opcode_81(){
//printf("opcode_81 called.\n");
this->modrm = memory.read_uint8(this->eip);
this->calc_modrm();
switch (this->R) {
case 0:
add_rm32_imm32();
break;
case 1:
// TODO: or_rm32_imm32();
break;
case 2:
// TODO: adc_rm32_imm32();
break;
case 3:
// TODO: sbb_rm32_imm32();
break;
case 4:
// TODO: and_rm32_imm32();
break;
case 5:
// TODO: sub_rm32_imm32();
break;
case 6:
// TODO: xor_rm32_imm32();
break;
case 7:
// TODO: cmp_rm32_imm8();
break;
default:
break;
}
}
void Instructions::opcode_83(){
//printf("opcode_83 called.\n");