mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add dec_ecx(0x49) instruction
This commit is contained in:
@@ -25,6 +25,7 @@ public:
|
|||||||
|
|
||||||
void add_rm32_r32(); // 0x01
|
void add_rm32_r32(); // 0x01
|
||||||
void xor_rm32_r32(); // 0x31
|
void xor_rm32_r32(); // 0x31
|
||||||
|
void dec_ecx(); // 0x49
|
||||||
void mov_rm32_r32(); // 0x89
|
void mov_rm32_r32(); // 0x89
|
||||||
void nop(); // 0x90
|
void nop(); // 0x90
|
||||||
void mov_ecx_imm32(); // 0xb9
|
void mov_ecx_imm32(); // 0xb9
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ void Instructions::init_instructions(){
|
|||||||
|
|
||||||
this->instructions[0x01] = &Instructions::add_rm32_r32;
|
this->instructions[0x01] = &Instructions::add_rm32_r32;
|
||||||
this->instructions[0x31] = &Instructions::xor_rm32_r32;
|
this->instructions[0x31] = &Instructions::xor_rm32_r32;
|
||||||
|
this->instructions[0x49] = &Instructions::dec_ecx;
|
||||||
this->instructions[0x89] = &Instructions::mov_rm32_r32;
|
this->instructions[0x89] = &Instructions::mov_rm32_r32;
|
||||||
this->instructions[0x90] = &Instructions::nop;
|
this->instructions[0x90] = &Instructions::nop;
|
||||||
this->instructions[0xb9] = &Instructions::mov_ecx_imm32;
|
this->instructions[0xb9] = &Instructions::mov_ecx_imm32;
|
||||||
@@ -146,6 +147,11 @@ void Instructions::xor_rm32_r32(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::dec_ecx(){
|
||||||
|
printf("dec_ecx called.\n");
|
||||||
|
this->registers[1]--;
|
||||||
|
}
|
||||||
|
|
||||||
void Instructions::mov_rm32_r32(){
|
void Instructions::mov_rm32_r32(){
|
||||||
printf("mov_rm32_r32 called.\n");
|
printf("mov_rm32_r32 called.\n");
|
||||||
uint32_t addr, imm32;
|
uint32_t addr, imm32;
|
||||||
|
|||||||
Reference in New Issue
Block a user