3 #ifndef ROSE_ASSEMBLER_X86_H
4 #define ROSE_ASSEMBLER_X86_H
111 static const unsigned od_cb = 0x00001000;
112 static const unsigned od_cw = 0x00002000;
113 static const unsigned od_cd = 0x00003000;
114 static const unsigned od_cp = 0x00004000;
115 static const unsigned od_co = 0x00005000;
116 static const unsigned od_ct = 0x00006000;
121 static const unsigned od_ib = 0x00010000;
122 static const unsigned od_iw = 0x00020000;
123 static const unsigned od_id = 0x00030000;
124 static const unsigned od_io = 0x00040000;
129 static const unsigned od_rb = 0x00100000;
130 static const unsigned od_rw = 0x00200000;
131 static const unsigned od_rd = 0x00300000;
132 static const unsigned od_ro = 0x00400000;
137 static const unsigned od_i = 0x00000004;
328 static uint8_t
build_modrm(
unsigned mod,
unsigned reg,
unsigned rm) {
329 return ((mod&0x3)<<6) | ((reg&0x7)<<3) | (rm&0x7);
333 static unsigned modrm_mod(uint8_t modrm) {
return modrm>>6; }
336 static unsigned modrm_reg(uint8_t modrm) {
return (modrm>>3) & 0x7; }
339 static unsigned modrm_rm(uint8_t modrm) {
return modrm & 0x7; }
342 static uint8_t
build_sib(
unsigned ss,
unsigned index,
unsigned base) {
343 return ((ss&0x3)<<6) | ((index&0x7)<<3) | (base&0x7);
347 static unsigned sib_ss(uint8_t sib) {
return sib>>6; }
350 static unsigned sib_index(uint8_t sib) {
return (sib>>3) & 0x7; }
353 static unsigned sib_base(uint8_t sib) {
return sib & 0x7; }
363 : mnemonic(mnemonic), kind(kind), compatibility(compatibility), opcode(opcode), opcode_modifiers(opcode_modifiers) {
369 std::string
to_str()
const;
455 uint8_t *sib, int64_t *displacement, uint8_t *rex)
const;