Add jmp_imm8(0xeb) instruction

This commit is contained in:
tuz358
2018-03-04 22:31:35 +09:00
parent cdf2d00777
commit 5c3fdd32b6
2 changed files with 10 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ void Instructions::init_instructions(){
this->instructions[0x90] = &Instructions::nop;
this->instructions[0xb9] = &Instructions::mov_ecx_imm32;
this->instructions[0xbb] = &Instructions::mov_ebx_imm32;
this->instructions[0xeb] = &Instructions::jmp_imm8;
this->instructions[0xf4] = &Instructions::hlt;
}
@@ -115,6 +116,14 @@ void Instructions::mov_ebx_imm32(){
this->eip += 3;
}
void jmp_imm8() {
printf("jmp_imm8 called.\n");
this->eip++;
uint8_t imm8 = memory.read_uint8(this->eip);
this->eip += imm8;
}
void Instructions::hlt(){
printf("hlt called.\n");
this->eip = 0x00;