Add je_imm8(0x74) instruction

This commit is contained in:
tuz358
2018-03-14 08:32:04 +09:00
parent 7d0bda78ce
commit 2bd7b72618
2 changed files with 15 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ void Instructions::init_instructions(){
this->instructions[0x15] = &Instructions::adc_eax_imm32;
this->instructions[0x19] = &Instructions::sbb_rm32_r32;
this->instructions[0x1b] = &Instructions::sbb_r32_rm32;
this->instructions[0x1d] = &Instructions::sbb_eax_imm32;
this->instructions[0x1d] = &Instructions::sbb_eax_imm32;
this->instructions[0x21] = &Instructions::and_rm32_r32;
this->instructions[0x23] = &Instructions::and_r32_rm32;
this->instructions[0x25] = &Instructions::and_eax_imm32;
@@ -78,6 +78,7 @@ void Instructions::init_instructions(){
this->instructions[0x5f] = &Instructions::pop_edi;
this->instructions[0x68] = &Instructions::push_imm32;
this->instructions[0x6a] = &Instructions::push_imm8;
this->instructions[0x74] = &Instructions::je_imm8;
this->instructions[0x75] = &Instructions::jne_imm8;
this->instructions[0x83] = &Instructions::opcode_83;
this->instructions[0x89] = &Instructions::mov_rm32_r32;
@@ -1132,6 +1133,18 @@ void Instructions::push_imm8(){
this->eip++;
}
void Instructions::je_imm8(){
//printf("je_imm8 called.\n");
int8_t imm8 = memory.read_int8(this->eip);
int zero_flag = this->get_flag(ZF);
if (zero_flag){
this->eip += imm8;
}
this->eip++;
}
void Instructions::jne_imm8(){
//printf("jne_imm8 called.\n");