mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 13:04:35 +03:00
Add add_rm32_imm8(0x83) instruction
This commit is contained in:
@@ -108,5 +108,7 @@ public:
|
||||
void hlt(); // 0xf4
|
||||
void opcode_ff(); // 0xff
|
||||
|
||||
void cmp_rm32_imm8(); // called by opcode_83
|
||||
// called by opcode_83
|
||||
void add_rm32_imm8();
|
||||
void cmp_rm32_imm8();
|
||||
};
|
||||
|
||||
@@ -1164,6 +1164,9 @@ void Instructions::opcode_83(){
|
||||
this->calc_modrm();
|
||||
|
||||
switch (this->R) {
|
||||
case 0:
|
||||
add_rm32_imm8();
|
||||
break;
|
||||
case 7:
|
||||
cmp_rm32_imm8();
|
||||
break;
|
||||
@@ -1420,6 +1423,17 @@ void Instructions::opcode_ff(){
|
||||
}
|
||||
}
|
||||
|
||||
void Instructions::add_rm32_imm8(){
|
||||
//printf("add_rm32_imm8 called.\n");
|
||||
|
||||
this->eip++;
|
||||
uint8_t imm8 = memory.read_uint8(this->eip);
|
||||
//printf("imm8: 0x%08x (%d)\n", imm8, imm8);
|
||||
this->registers[this->M] += imm8;
|
||||
|
||||
this->eip++;
|
||||
}
|
||||
|
||||
void Instructions::cmp_rm32_imm8(){
|
||||
//printf("cmp_rm32_imm8 called.\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user