Class: AVR::OpcodeDecoder::DecodedOpcode

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/avr/opcode_decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opcode_definition, operands) ⇒ DecodedOpcode

Returns a new instance of DecodedOpcode.



122
123
124
125
# File 'lib/avr/opcode_decoder.rb', line 122

def initialize(opcode_definition, operands)
  @opcode_definition = opcode_definition
  @operands = operands
end

Instance Attribute Details

#opcode_definitionObject (readonly)

Returns the value of attribute opcode_definition.



116
117
118
# File 'lib/avr/opcode_decoder.rb', line 116

def opcode_definition
  @opcode_definition
end

#operandsObject (readonly)

Returns the value of attribute operands.



119
120
121
# File 'lib/avr/opcode_decoder.rb', line 119

def operands
  @operands
end

Instance Method Details

#prepare_operands(cpu) ⇒ Object



128
129
130
131
# File 'lib/avr/opcode_decoder.rb', line 128

def prepare_operands(cpu)
  parser = OpcodeDecoder.operand_parsers[opcode_definition.operand_pattern]
  parser&.parse(cpu, operands) || operands
end