Class: AVR::OpcodeDecoder::DecodedOpcode
- Inherits:
-
Object
- Object
- AVR::OpcodeDecoder::DecodedOpcode
- Extended by:
- T::Sig
- Defined in:
- lib/avr/opcode_decoder.rb
Instance Attribute Summary collapse
-
#opcode_definition ⇒ Object
readonly
Returns the value of attribute opcode_definition.
-
#operands ⇒ Object
readonly
Returns the value of attribute operands.
Instance Method Summary collapse
-
#initialize(opcode_definition, operands) ⇒ DecodedOpcode
constructor
A new instance of DecodedOpcode.
- #prepare_operands(cpu) ⇒ Object
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_definition ⇒ Object (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 |
#operands ⇒ Object (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 |