Class: Crabstone::XCore::Operand
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Crabstone::XCore::Operand
- Defined in:
- lib/arch/xcore.rb
Instance Method Summary collapse
Instance Method Details
#imm? ⇒ Boolean
53 54 55 |
# File 'lib/arch/xcore.rb', line 53 def imm? self[:type] == OP_IMM end |
#mem? ⇒ Boolean
57 58 59 |
# File 'lib/arch/xcore.rb', line 57 def mem? self[:type] == OP_MEM end |
#reg? ⇒ Boolean
49 50 51 |
# File 'lib/arch/xcore.rb', line 49 def reg? self[:type] == OP_REG end |
#valid? ⇒ Boolean
61 62 63 |
# File 'lib/arch/xcore.rb', line 61 def valid? [OP_MEM, OP_IMM, OP_REG].include? self[:type] end |
#value ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/arch/xcore.rb', line 36 def value case self[:type] when OP_REG self[:value][:reg] when OP_IMM self[:value][:imm] when OP_MEM self[:value][:mem] else nil end end |