eflags affected vs. used
git-svn-id: file:///home/svn/incoming/trunk@3362 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
28e5a8dd49
commit
12b30e56b5
|
@ -556,6 +556,18 @@ static VALUE instruction_eflags_affected(VALUE self)
|
|||
return INT2FIX(inst->inst.eflags_affected);
|
||||
}
|
||||
|
||||
//
|
||||
// Returns the eflags that are used by this instruction.
|
||||
//
|
||||
static VALUE instruction_eflags_used(VALUE self)
|
||||
{
|
||||
PINSTRUCTION_OBJECT inst;
|
||||
|
||||
rb_instruction_cast(self, inst);
|
||||
|
||||
return INT2FIX(inst->inst.eflags_used);
|
||||
}
|
||||
|
||||
////
|
||||
//
|
||||
// Dasm class
|
||||
|
@ -850,6 +862,7 @@ void Init_dasm()
|
|||
rb_define_method(instr_klass, "op2", instruction_op2, 0);
|
||||
rb_define_method(instr_klass, "op3", instruction_op3, 0);
|
||||
rb_define_method(instr_klass, "eflags_affected", instruction_eflags_affected, 0);
|
||||
rb_define_method(instr_klass, "eflags_used", instruction_eflags_used, 0);
|
||||
|
||||
// Operand
|
||||
oper_klass = rb_define_class_under(dasm_klass, "Operand",
|
||||
|
|
|
@ -45,6 +45,7 @@ class Ext::Disassembler::X86::Dasm::UnitTest < Test::Unit::TestCase
|
|||
d.set_format("att")
|
||||
assert_equal("inc %ecx", inst.to_s);
|
||||
assert_equal(X86::EFL_OF | X86::EFL_SF | X86::EFL_ZF | X86::EFL_AF | X86::EFL_PF, inst.eflags_affected)
|
||||
assert_equal(0, inst.eflags_used)
|
||||
end
|
||||
|
||||
def test_operand
|
||||
|
|
|
@ -293,7 +293,8 @@ typedef struct _INST {
|
|||
int flags2; // Second operand flags (if any)
|
||||
int flags3; // Additional operand flags (if any)
|
||||
int modrm; // Is MODRM byte present?
|
||||
int eflags_affected; // Processor eflags affected
|
||||
short eflags_affected; // Processor eflags affected
|
||||
short eflags_used; // Processor eflags used by this instruction
|
||||
} INST, *PINST;
|
||||
|
||||
// Operands for the instruction
|
||||
|
@ -332,7 +333,8 @@ typedef struct _INSTRUCTION {
|
|||
OPERAND op3; // Additional operand (if any)
|
||||
PINST ptr; // Pointer to instruction table
|
||||
int flags; // Instruction flags
|
||||
int eflags_affected; // Process eflags affected
|
||||
short eflags_affected; // Process eflags affected
|
||||
short eflags_used; // Processor eflags used by this instruction
|
||||
} INSTRUCTION, *PINSTRUCTION;
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue