//Creates OPERAND_TYPE_REG operand of given type. static void create_reg_operand(ref INSTRUCTION instr, int op_index, REG_TYPE type, byte code, OP_SIZE size) { instr.ops[op_index].flags |= (byte)OP_TYPE.OPERAND_TYPE_REG; instr.ops[op_index].value.reg.type = type; instr.ops[op_index].value.reg.code = code; instr.ops[op_index].size = (ushort)size; }
static void create_xmmreg_operand(ref INSTRUCTION instr, int op_index, byte code, OP_SIZE size, byte rex, ref INTERNAL_DATA idata, DISMODE mode) { if ((mode == DISMODE.DISASSEMBLE_MODE_64) && (idata.prefixes[PREF_REX_INDEX] != 0xFF)) { if ((instr.rex & rex)!=0) { code |= REG_CODE_64; idata.is_rex_used = 1; } } create_reg_operand(ref instr, op_index, REG_TYPE.REG_TYPE_XMM, code, size); }
static void create_genreg_operand(ref INSTRUCTION instr, int op_index, byte code, OP_SIZE size, byte rex, ref INTERNAL_DATA idata, DISMODE mode) { if (mode == DISMODE.DISASSEMBLE_MODE_64 && idata.prefixes[PREF_REX_INDEX] != 0xFF) { if (code > REG_CODE_BX && size == OP_SIZE.OPERAND_SIZE_8) { code |= REG_CODE_64; code += 0x4; idata.is_rex_used = 1; } if ((instr.rex & rex)!=0) { code |= REG_CODE_64; idata.is_rex_used = 1; } } create_reg_operand(ref instr, op_index, REG_TYPE.REG_TYPE_GEN, code, size); }