Class: Crabstone::M68K::Operand

Inherits:
FFI::Struct
  • Object
show all
Includes:
Extension::Operand
Defined in:
lib/crabstone/arch/4/m68k.rb,
lib/crabstone/arch/5/m68k.rb

Instance Method Summary collapse

Methods included from Extension::Operand

#valid?

Instance Method Details

#br_disp?Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/crabstone/arch/4/m68k.rb', line 107

def br_disp?
  self[:type] == OP_BR_DISP
end

#fp_double?Boolean Also known as: dimm?

Returns:

  • (Boolean)


94
95
96
# File 'lib/crabstone/arch/4/m68k.rb', line 94

def fp_double?
  self[:type] == OP_FP_DOUBLE
end

#fp_single?Boolean Also known as: simm?

Returns:

  • (Boolean)


89
90
91
# File 'lib/crabstone/arch/4/m68k.rb', line 89

def fp_single?
  self[:type] == OP_FP_SINGLE
end

#imm?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/crabstone/arch/4/m68k.rb', line 81

def imm?
  self[:type] == OP_IMM
end

#mem?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/crabstone/arch/4/m68k.rb', line 85

def mem?
  self[:type] == OP_MEM
end

#reg?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/crabstone/arch/4/m68k.rb', line 77

def reg?
  self[:type] == OP_REG
end

#reg_bits?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/crabstone/arch/4/m68k.rb', line 99

def reg_bits?
  self[:type] == OP_REG_BITS
end

#reg_pair?Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/crabstone/arch/4/m68k.rb', line 103

def reg_pair?
  self[:type] == OP_REG_PAIR
end

#super_valueObject

Use Extension::Operand#value first



65
66
67
68
69
70
71
72
73
# File 'lib/crabstone/arch/4/m68k.rb', line 65

def value
  super_value || if mem?
                   self[:mem]
                 elsif br_disp?
                   self[:br_disp]
                 elsif reg_bits?
                   self[:register_bits]
                 end
end

#valueObject



67
68
69
70
71
72
73
74
75
# File 'lib/crabstone/arch/4/m68k.rb', line 67

def value
  super_value || if mem?
                   self[:mem]
                 elsif br_disp?
                   self[:br_disp]
                 elsif reg_bits?
                   self[:register_bits]
                 end
end