Class: Fisk::Registers::Register
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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 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.
52 53 54 55 56 |
# File 'lib/fisk.rb', line 52 def initialize name, type, value @name = name @type = type @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
50 51 52 |
# File 'lib/fisk.rb', line 50 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
50 51 52 |
# File 'lib/fisk.rb', line 50 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
50 51 52 |
# File 'lib/fisk.rb', line 50 def value @value end |
Instance Method Details
#extended_register? ⇒ Boolean
67 68 69 |
# File 'lib/fisk.rb', line 67 def extended_register? @value > 7 || EXTENDED_R8.include?(self) end |
#op_value ⇒ Object
63 64 65 |
# File 'lib/fisk.rb', line 63 def op_value value end |
#register? ⇒ Boolean
71 |
# File 'lib/fisk.rb', line 71 def register?; true; end |
#to_register ⇒ Object
73 74 75 |
# File 'lib/fisk.rb', line 73 def to_register self end |
#works?(op) ⇒ Boolean
58 59 60 61 |
# File 'lib/fisk.rb', line 58 def works? op type = op.type type == self.name || type == self.type end |