Class: Fisk::Instructions::Instruction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#formsObject

Returns the value of attribute forms

Returns:

  • (Object)

    the current value of forms



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

def forms
  @forms
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

Instance Method Details

#check_performance(operands) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/fisk/instructions.rb', line 40

def check_performance(operands)
  case name
  when Instructions::MOV.name
    if operands[0].register? && operands[1].register? && operands[0].name == operands[1].name
      return "MOV with same register (#{operands[0].name})"
    end
  end
end