mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add xor_rm32_imm(0x81,0x83) instruction
This commit is contained in:
@@ -138,5 +138,6 @@ public:
|
|||||||
void sbb_rm32_imm(int imm_flag);
|
void sbb_rm32_imm(int imm_flag);
|
||||||
void and_rm32_imm(int imm_flag);
|
void and_rm32_imm(int imm_flag);
|
||||||
void sub_rm32_imm(int imm_flag);
|
void sub_rm32_imm(int imm_flag);
|
||||||
|
void xor_rm32_imm(int imm_flag);
|
||||||
void cmp_rm32_imm8();
|
void cmp_rm32_imm8();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ void Instructions::opcode_81(){
|
|||||||
sub_rm32_imm(IMM32);
|
sub_rm32_imm(IMM32);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
// TODO: xor_rm32_imm32();
|
xor_rm32_imm(IMM32);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
// TODO: cmp_rm32_imm8();
|
// TODO: cmp_rm32_imm8();
|
||||||
@@ -526,7 +526,7 @@ void Instructions::opcode_83(){
|
|||||||
sub_rm32_imm(IMM8);
|
sub_rm32_imm(IMM8);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
// TODO: xor_rm32_imm8();
|
xor_rm32_imm(IMM8);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
cmp_rm32_imm8();
|
cmp_rm32_imm8();
|
||||||
@@ -892,6 +892,24 @@ void Instructions::sub_rm32_imm(int imm_flag){
|
|||||||
this->eip++;
|
this->eip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::xor_rm32_imm(int imm_flag){
|
||||||
|
//printf("xor_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(){
|
void Instructions::cmp_rm32_imm8(){
|
||||||
//printf("cmp_rm32_imm8 called.\n");
|
//printf("cmp_rm32_imm8 called.\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user