Class: Fisk::Registers::Register
- Includes:
- OperandSize
- Defined in:
- lib/fisk.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #extended_register? ⇒ Boolean
-
#initialize(name, type, value) ⇒ Register
constructor
A new instance of Register.
- #op_value ⇒ Object
- #register? ⇒ Boolean
- #to_register ⇒ Object
- #works?(op) ⇒ Boolean
Methods included from OperandSize
Methods inherited from Operand
Methods included from OperandPredicates
#absolute_location?, #immediate?, #memory?, #rip?, #temp_register?, #unresolved?
Constructor Details
#initialize(name, type, value) ⇒ Register
Returns a new instance of Register.
70 71 72 73 74 75 |
# File 'lib/fisk.rb', line 70 def initialize name, type, value @name = name @type = type @value = value @size = compute_size(type) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
68 69 70 |
# File 'lib/fisk.rb', line 68 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
68 69 70 |
# File 'lib/fisk.rb', line 68 def size @size end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
68 69 70 |
# File 'lib/fisk.rb', line 68 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
68 69 70 |
# File 'lib/fisk.rb', line 68 def value @value end |
Instance Method Details
#extended_register? ⇒ Boolean
86 87 88 |
# File 'lib/fisk.rb', line 86 def extended_register? @value > 7 || EXTENDED_R8.include?(self) end |
#op_value ⇒ Object
82 83 84 |
# File 'lib/fisk.rb', line 82 def op_value value end |
#register? ⇒ Boolean
90 |
# File 'lib/fisk.rb', line 90 def register?; true; end |
#to_register ⇒ Object
92 93 94 |
# File 'lib/fisk.rb', line 92 def to_register self end |
#works?(op) ⇒ Boolean
77 78 79 80 |
# File 'lib/fisk.rb', line 77 def works? op type = op.type type == self.name || type == self.type end |