19 #ifndef CS_X86_DISASSEMBLERDECODER_H
20 #define CS_X86_DISASSEMBLERDECODER_H
22 #if defined(CAPSTONE_HAS_OSXKERNEL)
23 #include <libkern/libkern.h>
33 #define modFromModRM(modRM) (((modRM) & 0xc0) >> 6)
34 #define regFromModRM(modRM) (((modRM) & 0x38) >> 3)
35 #define rmFromModRM(modRM) ((modRM) & 0x7)
36 #define scaleFromSIB(sib) (((sib) & 0xc0) >> 6)
37 #define indexFromSIB(sib) (((sib) & 0x38) >> 3)
38 #define baseFromSIB(sib) ((sib) & 0x7)
39 #define wFromREX(rex) (((rex) & 0x8) >> 3)
40 #define rFromREX(rex) (((rex) & 0x4) >> 2)
41 #define xFromREX(rex) (((rex) & 0x2) >> 1)
42 #define bFromREX(rex) ((rex) & 0x1)
44 #define rFromEVEX2of4(evex) (((~(evex)) & 0x80) >> 7)
45 #define xFromEVEX2of4(evex) (((~(evex)) & 0x40) >> 6)
46 #define bFromEVEX2of4(evex) (((~(evex)) & 0x20) >> 5)
47 #define r2FromEVEX2of4(evex) (((~(evex)) & 0x10) >> 4)
48 #define mmFromEVEX2of4(evex) ((evex) & 0x3)
49 #define wFromEVEX3of4(evex) (((evex) & 0x80) >> 7)
50 #define vvvvFromEVEX3of4(evex) (((~(evex)) & 0x78) >> 3)
51 #define ppFromEVEX3of4(evex) ((evex) & 0x3)
52 #define zFromEVEX4of4(evex) (((evex) & 0x80) >> 7)
53 #define l2FromEVEX4of4(evex) (((evex) & 0x40) >> 6)
54 #define lFromEVEX4of4(evex) (((evex) & 0x20) >> 5)
55 #define bFromEVEX4of4(evex) (((evex) & 0x10) >> 4)
56 #define v2FromEVEX4of4(evex) (((~evex) & 0x8) >> 3)
57 #define aaaFromEVEX4of4(evex) ((evex) & 0x7)
59 #define rFromVEX2of3(vex) (((~(vex)) & 0x80) >> 7)
60 #define xFromVEX2of3(vex) (((~(vex)) & 0x40) >> 6)
61 #define bFromVEX2of3(vex) (((~(vex)) & 0x20) >> 5)
62 #define mmmmmFromVEX2of3(vex) ((vex) & 0x1f)
63 #define wFromVEX3of3(vex) (((vex) & 0x80) >> 7)
64 #define vvvvFromVEX3of3(vex) (((~(vex)) & 0x78) >> 3)
65 #define lFromVEX3of3(vex) (((vex) & 0x4) >> 2)
66 #define ppFromVEX3of3(vex) ((vex) & 0x3)
68 #define rFromVEX2of2(vex) (((~(vex)) & 0x80) >> 7)
69 #define vvvvFromVEX2of2(vex) (((~(vex)) & 0x78) >> 3)
70 #define lFromVEX2of2(vex) (((vex) & 0x4) >> 2)
71 #define ppFromVEX2of2(vex) ((vex) & 0x3)
73 #define rFromXOP2of3(xop) (((~(xop)) & 0x80) >> 7)
74 #define xFromXOP2of3(xop) (((~(xop)) & 0x40) >> 6)
75 #define bFromXOP2of3(xop) (((~(xop)) & 0x20) >> 5)
76 #define mmmmmFromXOP2of3(xop) ((xop) & 0x1f)
77 #define wFromXOP3of3(xop) (((xop) & 0x80) >> 7)
78 #define vvvvFromXOP3of3(vex) (((~(vex)) & 0x78) >> 3)
79 #define lFromXOP3of3(xop) (((xop) & 0x4) >> 2)
80 #define ppFromXOP3of3(xop) ((xop) & 0x3)
108 #define EA_BASES_16BIT \
144 #define EA_BASES_32BIT \
180 #define EA_BASES_64BIT \
339 #define REGS_SEGMENT \
365 #define REGS_CONTROL \
383 #define ALL_EA_BASES \
388 #define ALL_SIB_BASES \
415 #define ENTRY(x) EA_BASE_##x,
418 #define ENTRY(x) EA_REG_##x,
432 #define ENTRY(x) SIB_INDEX_##x,
446 #define ENTRY(x) SIB_BASE_##x,
467 #define ENTRY(x) MODRM_REG_##x,
552 #ifdef CAPSTONE_X86_REDUCE
739 const void* readerArg,
int decodeInstruction(struct InternalInstruction *insn, byteReader_t reader, const void *readerArg, uint64_t startLoc, DisassemblerMode mode)
void(* dlog_t)(void *arg, const char *log)
struct InternalInstruction InternalInstruction
int(* byteReader_t)(const struct reader_info *arg, uint8_t *byte, uint64_t address)
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
EADisplacement eaDisplacement
const struct InstructionSpecifier * spec
uint8_t numImmediatesConsumed
uint64_t necessaryPrefixLocation
uint8_t displacementOffset
uint8_t numImmediatesTranslated
VectorExtensionType vectorExtensionType
uint8_t vectorExtensionPrefix[4]
const struct OperandSpecifier * operands
bool consumedDisplacement
SegmentOverride segmentOverride