Class: Crabstone::PPC::Operand
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Crabstone::PPC::Operand
- Defined in:
- lib/arch/ppc.rb
Instance Method Summary collapse
Instance Method Details
#imm? ⇒ Boolean
62 63 64 |
# File 'lib/arch/ppc.rb', line 62 def imm? self[:type] == OP_IMM end |
#mem? ⇒ Boolean
66 67 68 |
# File 'lib/arch/ppc.rb', line 66 def mem? self[:type] == OP_MEM end |
#reg? ⇒ Boolean
58 59 60 |
# File 'lib/arch/ppc.rb', line 58 def reg? self[:type] == OP_REG end |
#valid? ⇒ Boolean
70 71 72 |
# File 'lib/arch/ppc.rb', line 70 def valid? [OP_MEM, OP_IMM, OP_REG].include? self[:type] end |
#value ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/arch/ppc.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_CRX self[:value][:crx] else nil end end |