mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 21:14:35 +03:00
Add adc_rm32_imm(0x81,0x83) instruction
This commit is contained in:
@@ -117,5 +117,6 @@ public:
|
|||||||
// called by opcode_81 and opcode_83
|
// called by opcode_81 and opcode_83
|
||||||
void add_rm32_imm(int imm_flag);
|
void add_rm32_imm(int imm_flag);
|
||||||
void or_rm32_imm(int imm_flag);
|
void or_rm32_imm(int imm_flag);
|
||||||
|
void adc_rm32_imm(int imm_flag);
|
||||||
void cmp_rm32_imm8();
|
void cmp_rm32_imm8();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1172,7 +1172,7 @@ void Instructions::opcode_81(){
|
|||||||
or_rm32_imm(IMM32);
|
or_rm32_imm(IMM32);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// TODO: adc_rm32_imm32();
|
adc_rm32_imm(IMM32);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// TODO: sbb_rm32_imm32();
|
// TODO: sbb_rm32_imm32();
|
||||||
@@ -1208,7 +1208,7 @@ void Instructions::opcode_83(){
|
|||||||
or_rm32_imm(IMM8);
|
or_rm32_imm(IMM8);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// TODO: adc_rm32_imm8();
|
adc_rm32_imm(IMM8);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// TODO: sbb_rm32_imm8();
|
// TODO: sbb_rm32_imm8();
|
||||||
@@ -1514,6 +1514,24 @@ void Instructions::or_rm32_imm(int imm_flag){
|
|||||||
this->eip++;
|
this->eip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instructions::adc_rm32_imm(int imm_flag){
|
||||||
|
//printf("adc_rm32_imm called.\n");
|
||||||
|
|
||||||
|
this->eip++;
|
||||||
|
|
||||||
|
if(imm_flag == IMM8){
|
||||||
|
uint8_t imm8 = memory.read_uint8(this->eip);
|
||||||
|
this->registers[this->M] += imm8 + get_flag(CF);
|
||||||
|
} else if(imm_flag == IMM32){
|
||||||
|
uint32_t imm32 = memory.read_uint32(this->eip);
|
||||||
|
imm32 = swap_endian32(imm32);
|
||||||
|
this->registers[this->M] += imm32 + get_flag(CF);
|
||||||
|
} 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