mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Albeit that it requires nuanced shift/roll semantics, eliminates CL
constant.
Shifts and rolls are already slightly semantically special for being undefined for values greater than 8/16/32 — i.e. in some implementations they don't even use the entirety of CL, just the low five bits. Which makes me feel a little better. The upside of no ambiguity between eCX size 1 and CL justifies the trade.
This commit is contained in:
parent
a5113998e2
commit
75d2d64e7c
@ -318,7 +318,7 @@ std::pair<int, InstructionSet::x86::Instruction> Decoder::decode(const uint8_t *
|
|||||||
phase_ = Phase::ModRegRM;
|
phase_ = Phase::ModRegRM;
|
||||||
modregrm_format_ = ModRegRMFormat::MemRegROL_to_SAR;
|
modregrm_format_ = ModRegRMFormat::MemRegROL_to_SAR;
|
||||||
operation_size_ = 1 + (instr_ & 1);
|
operation_size_ = 1 + (instr_ & 1);
|
||||||
source_ = Source::CL;
|
source_ = Source::eCX;
|
||||||
break;
|
break;
|
||||||
case 0xd4: RegData(AAM, eAX, 1); break;
|
case 0xd4: RegData(AAM, eAX, 1); break;
|
||||||
case 0xd5: RegData(AAD, eAX, 1); break;
|
case 0xd5: RegData(AAD, eAX, 1); break;
|
||||||
|
@ -156,19 +156,19 @@ enum class Operation: uint8_t {
|
|||||||
PUSH,
|
PUSH,
|
||||||
/// PUSH the flags register to the stack.
|
/// PUSH the flags register to the stack.
|
||||||
PUSHF,
|
PUSHF,
|
||||||
/// Rotate the destination left through carry the number of bits indicated by source.
|
/// Rotate the destination left through carry the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
RCL,
|
RCL,
|
||||||
/// Rotate the destination right through carry the number of bits indicated by source.
|
/// Rotate the destination right through carry the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
RCR,
|
RCR,
|
||||||
/// Rotate the destination left the number of bits indicated by source.
|
/// Rotate the destination left the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
ROL,
|
ROL,
|
||||||
/// Rotate the destination right the number of bits indicated by source.
|
/// Rotate the destination right the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
ROR,
|
ROR,
|
||||||
/// Arithmetic shift left the destination by the number of bits indicated by source.
|
/// Arithmetic shift left the destination by the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
SAL,
|
SAL,
|
||||||
/// Arithmetic shift right the destination by the number of bits indicated by source.
|
/// Arithmetic shift right the destination by the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
SAR,
|
SAR,
|
||||||
/// Logical shift right the destination by the number of bits indicated by source.
|
/// Logical shift right the destination by the number of bits indicated by source; if the source is a register then implicitly its size is 1.
|
||||||
SHR,
|
SHR,
|
||||||
|
|
||||||
/// Clear carry flag; no source or destination provided.
|
/// Clear carry flag; no source or destination provided.
|
||||||
@ -323,18 +323,20 @@ enum class Source: uint8_t {
|
|||||||
// instruction's data size.
|
// instruction's data size.
|
||||||
eAX, eCX, eDX, eBX, eSP, eBP, eSI, eDI,
|
eAX, eCX, eDX, eBX, eSP, eBP, eSI, eDI,
|
||||||
|
|
||||||
// Selectors are provided as a group.
|
// Selectors.
|
||||||
CS, DS, ES, SS, FS, GS,
|
CS, DS, ES, SS, FS, GS,
|
||||||
|
|
||||||
DirectAddress,
|
// Legacy 8-bit registers that can't be described as e.g. 8-bit eAX.
|
||||||
Immediate,
|
|
||||||
Indirect,
|
|
||||||
|
|
||||||
// Legacy 8-bit registers that can't be described as e.g. 8-bit eAX,
|
|
||||||
// or where the source is 8-bit but the destination is 16-bit.
|
|
||||||
CL,
|
|
||||||
AH, BH, CH, DH,
|
AH, BH, CH, DH,
|
||||||
|
|
||||||
|
// Sources that are not a register.
|
||||||
|
/// The address included within this instruction should be used as the source.
|
||||||
|
DirectAddress,
|
||||||
|
/// The immediate value included within this instruction should be used as the source.
|
||||||
|
Immediate,
|
||||||
|
/// The ScaleIndexBase associated with this source should be used.
|
||||||
|
Indirect,
|
||||||
|
|
||||||
// TODO: compact and replace with a reference to a SIB.
|
// TODO: compact and replace with a reference to a SIB.
|
||||||
IndBXPlusSI,
|
IndBXPlusSI,
|
||||||
IndBXPlusDI,
|
IndBXPlusDI,
|
||||||
|
Loading…
Reference in New Issue
Block a user