Class: Crabstone::ARM::Operand
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Crabstone::ARM::Operand
- Defined in:
- lib/arch/arm.rb
Instance Method Summary collapse
- #cimm? ⇒ Boolean
- #fp? ⇒ Boolean
- #imm? ⇒ Boolean
- #mem? ⇒ Boolean
- #pimm? ⇒ Boolean
- #reg? ⇒ Boolean
- #sysreg? ⇒ Boolean
- #valid? ⇒ Boolean
- #value ⇒ Object
Instance Method Details
#cimm? ⇒ Boolean
73 74 75 |
# File 'lib/arch/arm.rb', line 73 def cimm? self[:type] == OP_CIMM end |
#fp? ⇒ Boolean
85 86 87 |
# File 'lib/arch/arm.rb', line 85 def fp? self[:type] == OP_FP end |
#imm? ⇒ Boolean
69 70 71 |
# File 'lib/arch/arm.rb', line 69 def imm? [OP_IMM, OP_CIMM, OP_PIMM].include? self[:type] end |
#mem? ⇒ Boolean
81 82 83 |
# File 'lib/arch/arm.rb', line 81 def mem? self[:type] == OP_MEM end |
#pimm? ⇒ Boolean
77 78 79 |
# File 'lib/arch/arm.rb', line 77 def pimm? self[:type] == OP_PIMM end |
#reg? ⇒ Boolean
65 66 67 |
# File 'lib/arch/arm.rb', line 65 def reg? [OP_REG, OP_SYSREG].include? self[:type] end |
#sysreg? ⇒ Boolean
89 90 91 |
# File 'lib/arch/arm.rb', line 89 def sysreg? self[:type] == OP_SYSREG end |
#valid? ⇒ Boolean
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/arch/arm.rb', line 93 def valid? [ OP_MEM, OP_IMM, OP_CIMM, OP_PIMM, OP_FP, OP_REG, OP_SYSREG, OP_SETEND ].include? self[:type] end |
#value ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/arch/arm.rb', line 48 def value case self[:type] when *[OP_REG, OP_SYSREG] self[:value][:reg] when *[OP_IMM, OP_CIMM, OP_PIMM] self[:value][:imm] when OP_MEM self[:value][:mem] when OP_FP self[:value][:fp] when OP_SETEND self[:value][:setend] else nil end end |