Class: Ronin::Code::ASM::ImmediateOperand
- Inherits:
-
Struct
- Object
- Struct
- Ronin::Code::ASM::ImmediateOperand
- Defined in:
- lib/ronin/code/asm/immediate_operand.rb
Overview
Represents an Immediate Data Operand.
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
-
#width ⇒ 8, ...
The width of the immediate operand.
Instance Method Summary collapse
-
#initialize(value, width = nil) ⇒ ImmediateOperand
constructor
Initializes a new Immediate Operand.
-
#to_i ⇒ Integer
Converts the operand to an Integer.
-
#to_s ⇒ String
Converts the operand to a String.
Constructor Details
#initialize(value, width = nil) ⇒ ImmediateOperand
Initializes a new Immediate Operand.
40 41 42 |
# File 'lib/ronin/code/asm/immediate_operand.rb', line 40 def initialize(value,width=nil) super(value.to_i,width) end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value
29 30 31 |
# File 'lib/ronin/code/asm/immediate_operand.rb', line 29 def value @value end |
#width ⇒ 8, ...
The width of the immediate operand.
29 30 31 |
# File 'lib/ronin/code/asm/immediate_operand.rb', line 29 def width @width end |
Instance Method Details
#to_i ⇒ Integer
Converts the operand to an Integer.
67 68 69 |
# File 'lib/ronin/code/asm/immediate_operand.rb', line 67 def to_i self.value end |
#to_s ⇒ String
Converts the operand to a String.
77 78 79 |
# File 'lib/ronin/code/asm/immediate_operand.rb', line 77 def to_s self.value.to_s end |