[UNTESTED] refactor how instructions are parsed

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-09-14 10:12:30 +05:30
parent 3cf5cbd024
commit 0b674c7c64
11 changed files with 742 additions and 389 deletions

View File

@@ -72,6 +72,20 @@ enum class ShiftType {
ROR = 0b11
};
struct ShiftData {
ShiftType type;
bool immediate;
uint8_t operand;
};
struct Shift {
uint8_t rm;
ShiftData data;
};
uint32_t
eval_shift(ShiftType shift_type, uint32_t value, uint8_t amount, bool& carry);
// https://fmt.dev/dev/api.html#std-ostream-support
std::ostream&
operator<<(std::ostream& os, const ShiftType cond);