1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Take a stab at group 8.

This commit is contained in:
Thomas Harte 2022-03-07 16:34:56 -05:00
parent 0e16e7935e
commit 8e669a32a3
2 changed files with 21 additions and 5 deletions

View File

@ -524,10 +524,10 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
RequiresMin(i80386); RequiresMin(i80386);
MemRegReg(MOVZX, Reg_MemReg, DataSize::Word); MemRegReg(MOVZX, Reg_MemReg, DataSize::Word);
break; break;
// TODO: 0xba: Grp8 Ev, Ib case 0xba: RequiresMin(i80386); MemRegReg(Invalid, MemRegBT_to_BTC, data_size_); break;
case 0xbb: RequiresMin(i80386); MemRegReg(BTC, MemReg_Reg, data_size_); break; case 0xbb: RequiresMin(i80386); MemRegReg(BTC, MemReg_Reg, data_size_); break;
case 0xbc: RequiresMin(i80386); MemRegReg(BSF, MemReg_Reg, data_size_); break; case 0xbc: RequiresMin(i80386); MemRegReg(BSF, MemReg_Reg, data_size_); break;
case 0xbd: RequiresMin(i80386); MemRegReg(BSR, MemReg_Reg, data_size_); break; case 0xbd: RequiresMin(i80386); MemRegReg(BSR, MemReg_Reg, data_size_); break;
case 0xbe: case 0xbe:
RequiresMin(i80386); RequiresMin(i80386);
MemRegReg(MOVSX, Reg_MemReg, DataSize::Byte); MemRegReg(MOVSX, Reg_MemReg, DataSize::Byte);
@ -776,6 +776,21 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
} }
break; break;
case ModRegRMFormat::MemRegBT_to_BTC:
destination_ = memreg;
source_ = Source::Immediate;
operand_size_ = DataSize::Byte;
switch(reg) {
default: undefined();
case 4: operation_ = Operation::BT; break;
case 5: operation_ = Operation::BTS; break;
case 6: operation_ = Operation::BTR; break;
case 7: operation_ = Operation::BTC; break;
}
break;
default: assert(false); default: assert(false);
} }

View File

@ -156,7 +156,8 @@ template <Model model> class Decoder {
// 'Group 8' // 'Group 8'
// //
// TODO. // Parse for mode and register/memory field, populating destination,
// and prepare to read a single byte as source.
MemRegBT_to_BTC, MemRegBT_to_BTC,
} modregrm_format_ = ModRegRMFormat::MemReg_Reg; } modregrm_format_ = ModRegRMFormat::MemReg_Reg;