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

@@ -85,6 +85,7 @@ public:
void pop_edi(); // 0x5f
void push_imm32(); // 0x68
void push_imm8(); // 0x6a
void je_imm8(); // 0x74
void jne_imm8(); // 0x75
void opcode_83(); // 0x83
void mov_rm32_r32(); // 0x89

View File

@@ -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");