Class: Crabstone::X86::Operand
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Crabstone::X86::Operand
- Defined in:
- lib/arch/x86.rb
Instance Method Summary collapse
- #fp? ⇒ Boolean
- #imm? ⇒ Boolean
- #mem? ⇒ Boolean
- #reg? ⇒ Boolean
- #valid? ⇒ Boolean
-
#value ⇒ Object
A spoonful of sugar…
Instance Method Details
#fp? ⇒ Boolean
70 71 72 |
# File 'lib/arch/x86.rb', line 70 def fp? self[:type] == OP_FP end |
#imm? ⇒ Boolean
62 63 64 |
# File 'lib/arch/x86.rb', line 62 def imm? self[:type] == OP_IMM end |
#mem? ⇒ Boolean
66 67 68 |
# File 'lib/arch/x86.rb', line 66 def mem? self[:type] == OP_MEM end |
#reg? ⇒ Boolean
58 59 60 |
# File 'lib/arch/x86.rb', line 58 def reg? self[:type] == OP_REG end |
#valid? ⇒ Boolean
74 75 76 |
# File 'lib/arch/x86.rb', line 74 def valid? [OP_MEM, OP_IMM, OP_FP, OP_REG].include? self[:type] end |
#value ⇒ Object
A spoonful of sugar…
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/arch/x86.rb', line 43 def value case self[:type] when OP_REG self[:value][:reg] when OP_IMM self[:value][:imm] when OP_MEM self[:value][:mem] when OP_FP self[:value][:fp] else nil end end |