mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add or_rm32_imm(0x81,0x83) instruction
This commit is contained in:
@@ -1169,7 +1169,7 @@ void Instructions::opcode_81(){
|
||||
add_rm32_imm(IMM32);
|
||||
break;
|
||||
case 1:
|
||||
// TODO: or_rm32_imm32();
|
||||
or_rm32_imm(IMM32);
|
||||
break;
|
||||
case 2:
|
||||
// TODO: adc_rm32_imm32();
|
||||
@@ -1205,7 +1205,7 @@ void Instructions::opcode_83(){
|
||||
add_rm32_imm(IMM8);
|
||||
break;
|
||||
case 1:
|
||||
// TODO: or_rm32_imm8();
|
||||
or_rm32_imm(IMM8);
|
||||
break;
|
||||
case 2:
|
||||
// TODO: adc_rm32_imm8();
|
||||
@@ -1496,6 +1496,24 @@ void Instructions::add_rm32_imm(int imm_flag){
|
||||
this->eip++;
|
||||
}
|
||||
|
||||
void Instructions::or_rm32_imm(int imm_flag){
|
||||
//printf("or_rm32_imm called.\n");
|
||||
|
||||
this->eip++;
|
||||
|
||||
if(imm_flag == IMM8){
|
||||
uint8_t imm8 = memory.read_uint8(this->eip);
|
||||
this->registers[this->M] |= imm8;
|
||||
} else if(imm_flag == IMM32){
|
||||
uint32_t imm32 = memory.read_uint32(this->eip);
|
||||
imm32 = swap_endian32(imm32);
|
||||
this->registers[this->M] |= imm32;
|
||||
} else {
|
||||
}
|
||||
|
||||
this->eip++;
|
||||
}
|
||||
|
||||
void Instructions::cmp_rm32_imm8(){
|
||||
//printf("cmp_rm32_imm8 called.\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user