Add add_rm32_imm32(0x81) instruction

This commit is contained in:
tuz358
2018-03-16 12:36:43 +09:00
parent 795395758d
commit 183607f2de
2 changed files with 16 additions and 1 deletions

View File

@@ -109,6 +109,9 @@ public:
void hlt(); // 0xf4
void opcode_ff(); // 0xff
// called by opcode_81
void add_rm32_imm32();
// called by opcode_83
void add_rm32_imm8();
void cmp_rm32_imm8();

View File

@@ -80,7 +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[0x81] = &Instructions::opcode_81;
this->instructions[0x83] = &Instructions::opcode_83;
this->instructions[0x89] = &Instructions::mov_rm32_r32;
this->instructions[0x8b] = &Instructions::mov_r32_rm32;
@@ -1478,6 +1478,18 @@ void Instructions::opcode_ff(){
}
}
void Instructions::add_rm32_imm32(){
//printf("add_rm32_imm32 called.\n");
this->eip++;
uint32_t imm32 = memory.read_uint32(this->eip);
imm32 = swap_endian32(imm32);
//printf("imm32: 0x%08x (%d)\n", imm32, imm32);
this->registers[this->M] += imm32;
this->eip++;
}
void Instructions::add_rm32_imm8(){
//printf("add_rm32_imm8 called.\n");