Class: Fisk::Registers::Register

Inherits:
Operand
  • Object
show all
Defined in:
lib/fisk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Operand

#m64?, #register?, #rex_value, #temp_register?, #unknown_label?

Constructor Details

#initialize(name, type, value) ⇒ Register

Returns a new instance of Register.



42
43
44
45
46
# File 'lib/fisk.rb', line 42

def initialize name, type, value
  @name = name
  @type = type
  @value = value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'lib/fisk.rb', line 40

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



40
41
42
# File 'lib/fisk.rb', line 40

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



40
41
42
# File 'lib/fisk.rb', line 40

def value
  @value
end

Instance Method Details

#extended_register?Boolean

Returns:

  • (Boolean)


56
# File 'lib/fisk.rb', line 56

def extended_register?; @value > 7; end

#op_valueObject



52
53
54
# File 'lib/fisk.rb', line 52

def op_value
  value & 0x7
end

#works?(type) ⇒ Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/fisk.rb', line 48

def works? type
  type == self.name || type == self.type
end