diff --git a/include/instructions.h b/include/instructions.h index 65c2033..c5626f2 100644 --- a/include/instructions.h +++ b/include/instructions.h @@ -29,6 +29,14 @@ public: void add_rm32_r32(); // 0x01 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_ecx(); // 0x49 void dec_edx(); // 0x4a diff --git a/instructions.cpp b/instructions.cpp index 1697262..84574fd 100644 --- a/instructions.cpp +++ b/instructions.cpp @@ -22,6 +22,14 @@ void Instructions::init_instructions(){ this->instructions[0x01] = &Instructions::add_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[0x49] = &Instructions::dec_ecx; 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(){ //printf("dec_eax called.\n"); this->registers[0]--;