Add dec_ecx(0x49) instruction

This commit is contained in:
tuz358
2018-03-05 10:12:34 +09:00
parent feb1ec53dc
commit 1ce883a1a0
2 changed files with 7 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ public:
void add_rm32_r32(); // 0x01
void xor_rm32_r32(); // 0x31
void dec_ecx(); // 0x49
void mov_rm32_r32(); // 0x89
void nop(); // 0x90
void mov_ecx_imm32(); // 0xb9

View File

@@ -22,6 +22,7 @@ void Instructions::init_instructions(){
this->instructions[0x01] = &Instructions::add_rm32_r32;
this->instructions[0x31] = &Instructions::xor_rm32_r32;
this->instructions[0x49] = &Instructions::dec_ecx;
this->instructions[0x89] = &Instructions::mov_rm32_r32;
this->instructions[0x90] = &Instructions::nop;
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(){
printf("mov_rm32_r32 called.\n");
uint32_t addr, imm32;