mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 13:04:35 +03:00
Add je_imm8(0x74) instruction
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user