Add add_rm32_imm8(0x83) instruction

This commit is contained in:
tuz358
2018-03-16 11:44:10 +09:00
parent 2bd7b72618
commit e9d71ae0f6
2 changed files with 17 additions and 1 deletions

View File

@@ -108,5 +108,7 @@ public:
void hlt(); // 0xf4 void hlt(); // 0xf4
void opcode_ff(); // 0xff void opcode_ff(); // 0xff
void cmp_rm32_imm8(); // called by opcode_83 // called by opcode_83
void add_rm32_imm8();
void cmp_rm32_imm8();
}; };

View File

@@ -1164,6 +1164,9 @@ void Instructions::opcode_83(){
this->calc_modrm(); this->calc_modrm();
switch (this->R) { switch (this->R) {
case 0:
add_rm32_imm8();
break;
case 7: case 7:
cmp_rm32_imm8(); cmp_rm32_imm8();
break; break;
@@ -1420,6 +1423,17 @@ void Instructions::opcode_ff(){
} }
} }
void Instructions::add_rm32_imm8(){
//printf("add_rm32_imm8 called.\n");
this->eip++;
uint8_t imm8 = memory.read_uint8(this->eip);
//printf("imm8: 0x%08x (%d)\n", imm8, imm8);
this->registers[this->M] += imm8;
this->eip++;
}
void Instructions::cmp_rm32_imm8(){ void Instructions::cmp_rm32_imm8(){
//printf("cmp_rm32_imm8 called.\n"); //printf("cmp_rm32_imm8 called.\n");