mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add opcode_81(0x81) instruction
This commit is contained in:
@@ -87,6 +87,7 @@ public:
|
|||||||
void push_imm8(); // 0x6a
|
void push_imm8(); // 0x6a
|
||||||
void je_imm8(); // 0x74
|
void je_imm8(); // 0x74
|
||||||
void jne_imm8(); // 0x75
|
void jne_imm8(); // 0x75
|
||||||
|
void opcode_81(); // 0x81
|
||||||
void opcode_83(); // 0x83
|
void opcode_83(); // 0x83
|
||||||
void mov_rm32_r32(); // 0x89
|
void mov_rm32_r32(); // 0x89
|
||||||
void mov_r32_rm32(); // 0x8b
|
void mov_r32_rm32(); // 0x8b
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ void Instructions::init_instructions(){
|
|||||||
this->instructions[0x6a] = &Instructions::push_imm8;
|
this->instructions[0x6a] = &Instructions::push_imm8;
|
||||||
this->instructions[0x74] = &Instructions::je_imm8;
|
this->instructions[0x74] = &Instructions::je_imm8;
|
||||||
this->instructions[0x75] = &Instructions::jne_imm8;
|
this->instructions[0x75] = &Instructions::jne_imm8;
|
||||||
|
this->instructions[0x83] = &Instructions::opcode_81;
|
||||||
this->instructions[0x83] = &Instructions::opcode_83;
|
this->instructions[0x83] = &Instructions::opcode_83;
|
||||||
this->instructions[0x89] = &Instructions::mov_rm32_r32;
|
this->instructions[0x89] = &Instructions::mov_rm32_r32;
|
||||||
this->instructions[0x8b] = &Instructions::mov_r32_rm32;
|
this->instructions[0x8b] = &Instructions::mov_r32_rm32;
|
||||||
@@ -1157,6 +1158,42 @@ void Instructions::jne_imm8(){
|
|||||||
this->eip++;
|
this->eip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::opcode_81(){
|
||||||
|
//printf("opcode_81 called.\n");
|
||||||
|
|
||||||
|
this->modrm = memory.read_uint8(this->eip);
|
||||||
|
this->calc_modrm();
|
||||||
|
|
||||||
|
switch (this->R) {
|
||||||
|
case 0:
|
||||||
|
add_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// TODO: or_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// TODO: adc_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// TODO: sbb_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// TODO: and_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
// TODO: sub_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
// TODO: xor_rm32_imm32();
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
// TODO: cmp_rm32_imm8();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Instructions::opcode_83(){
|
void Instructions::opcode_83(){
|
||||||
//printf("opcode_83 called.\n");
|
//printf("opcode_83 called.\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user