mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add inc_e**(0x40~0x47) instruction
This commit is contained in:
@@ -29,6 +29,14 @@ public:
|
|||||||
|
|
||||||
void add_rm32_r32(); // 0x01
|
void add_rm32_r32(); // 0x01
|
||||||
void xor_rm32_r32(); // 0x31
|
void xor_rm32_r32(); // 0x31
|
||||||
|
void inc_eax(); // 0x40
|
||||||
|
void inc_ecx(); // 0x41
|
||||||
|
void inc_edx(); // 0x42
|
||||||
|
void inc_ebx(); // 0x43
|
||||||
|
void inc_esp(); // 0x44
|
||||||
|
void inc_ebp(); // 0x45
|
||||||
|
void inc_esi(); // 0x46
|
||||||
|
void inc_edi(); // 0x47
|
||||||
void dec_eax(); // 0x48
|
void dec_eax(); // 0x48
|
||||||
void dec_ecx(); // 0x49
|
void dec_ecx(); // 0x49
|
||||||
void dec_edx(); // 0x4a
|
void dec_edx(); // 0x4a
|
||||||
|
|||||||
@@ -22,6 +22,14 @@ 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[0x40] = &Instructions::inc_eax;
|
||||||
|
this->instructions[0x41] = &Instructions::inc_ecx;
|
||||||
|
this->instructions[0x42] = &Instructions::inc_edx;
|
||||||
|
this->instructions[0x43] = &Instructions::inc_ebx;
|
||||||
|
this->instructions[0x44] = &Instructions::inc_esp;
|
||||||
|
this->instructions[0x45] = &Instructions::inc_ebp;
|
||||||
|
this->instructions[0x46] = &Instructions::inc_esi;
|
||||||
|
this->instructions[0x47] = &Instructions::inc_edi;
|
||||||
this->instructions[0x48] = &Instructions::dec_eax;
|
this->instructions[0x48] = &Instructions::dec_eax;
|
||||||
this->instructions[0x49] = &Instructions::dec_ecx;
|
this->instructions[0x49] = &Instructions::dec_ecx;
|
||||||
this->instructions[0x4a] = &Instructions::dec_edx;
|
this->instructions[0x4a] = &Instructions::dec_edx;
|
||||||
@@ -165,6 +173,46 @@ void Instructions::xor_rm32_r32(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_eax(){
|
||||||
|
//printf("inc_eax called.\n");
|
||||||
|
this->registers[0]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_ecx(){
|
||||||
|
//printf("inc_ecx called.\n");
|
||||||
|
this->registers[1]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_edx(){
|
||||||
|
//printf("inc_edx called.\n");
|
||||||
|
this->registers[2]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_ebx(){
|
||||||
|
//printf("inc_ebx called.\n");
|
||||||
|
this->registers[3]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_esp(){
|
||||||
|
//printf("inc_esp called.\n");
|
||||||
|
this->registers[4]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_ebp(){
|
||||||
|
//printf("inc_ebp called.\n");
|
||||||
|
this->registers[5]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_esi(){
|
||||||
|
//printf("inc_esi called.\n");
|
||||||
|
this->registers[6]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instructions::inc_edi(){
|
||||||
|
//printf("inc_edi called.\n");
|
||||||
|
this->registers[7]++;
|
||||||
|
}
|
||||||
|
|
||||||
void Instructions::dec_eax(){
|
void Instructions::dec_eax(){
|
||||||
//printf("dec_eax called.\n");
|
//printf("dec_eax called.\n");
|
||||||
this->registers[0]--;
|
this->registers[0]--;
|
||||||
|
|||||||
Reference in New Issue
Block a user