Handle address size overrides

This commit is contained in:
Alexis Engelke
2019-01-13 14:27:04 +01:00
parent 80458e3288
commit d1110fae6a
2 changed files with 18 additions and 18 deletions

View File

@@ -118,6 +118,7 @@ struct Instr
struct Operand operands[4];
uint8_t segment : 3;
uint8_t width : 3;
uint8_t addr_size : 2;
/**
* Encoded as 1 << (scale - 1) **or** no scaled register at all if zero.
@@ -137,6 +138,7 @@ typedef struct Instr Instr;
#define INSTR_SEGMENT(instr) ((instr)->segment)
#define INSTR_WIDTH(instr) ((1 << (instr)->width) >> 1)
#define INSTR_ADDRSZ(instr) ((1 << (instr)->addr_size) >> 1)
#define INSTR_HAS_REP(instr) ((instr)->prefixes & PREFIX_REP)
#define INSTR_HAS_REPNZ(instr) ((instr)->prefixes & PREFIX_REPNZ)
#define INSTR_HAS_LOCK(instr) ((instr)->prefixes & PREFIX_LOCK)