mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 13:04:35 +03:00
Add add_rm32_imm32(0x81) instruction
This commit is contained in:
@@ -109,6 +109,9 @@ public:
|
|||||||
void hlt(); // 0xf4
|
void hlt(); // 0xf4
|
||||||
void opcode_ff(); // 0xff
|
void opcode_ff(); // 0xff
|
||||||
|
|
||||||
|
// called by opcode_81
|
||||||
|
void add_rm32_imm32();
|
||||||
|
|
||||||
// called by opcode_83
|
// called by opcode_83
|
||||||
void add_rm32_imm8();
|
void add_rm32_imm8();
|
||||||
void cmp_rm32_imm8();
|
void cmp_rm32_imm8();
|
||||||
|
|||||||
@@ -80,7 +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[0x81] = &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;
|
||||||
@@ -1478,6 +1478,18 @@ void Instructions::opcode_ff(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::add_rm32_imm32(){
|
||||||
|
//printf("add_rm32_imm32 called.\n");
|
||||||
|
|
||||||
|
this->eip++;
|
||||||
|
uint32_t imm32 = memory.read_uint32(this->eip);
|
||||||
|
imm32 = swap_endian32(imm32);
|
||||||
|
//printf("imm32: 0x%08x (%d)\n", imm32, imm32);
|
||||||
|
this->registers[this->M] += imm32;
|
||||||
|
|
||||||
|
this->eip++;
|
||||||
|
}
|
||||||
|
|
||||||
void Instructions::add_rm32_imm8(){
|
void Instructions::add_rm32_imm8(){
|
||||||
//printf("add_rm32_imm8 called.\n");
|
//printf("add_rm32_imm8 called.\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user