Class: Tataru::Instructions::ValueRomInstruction
- Inherits:
-
ImmediateModeInstruction
- Object
- Tataru::Instruction
- ImmediateModeInstruction
- Tataru::Instructions::ValueRomInstruction
- Includes:
- RomReader
- Defined in:
- lib/tataru/instructions/value_rom_instruction.rb
Overview
sets a hash entry and resolves from rom what was set
Instance Attribute Summary
Attributes inherited from Tataru::Instruction
Instance Method Summary collapse
Methods included from RomReader
#resolve, #resolve_array, #resolve_hash, #resolve_output, #rom
Methods inherited from ImmediateModeInstruction
Methods inherited from Tataru::Instruction
Constructor Details
This class inherits a constructor from Tataru::Instructions::ImmediateModeInstruction
Instance Method Details
#rom_object ⇒ Object
16 17 18 19 20 |
# File 'lib/tataru/instructions/value_rom_instruction.rb', line 16 def rom_object raise 'Not found' unless rom.key? @param rom[@param] end |
#run ⇒ Object
9 10 11 12 13 14 |
# File 'lib/tataru/instructions/value_rom_instruction.rb', line 9 def run return memory.error = 'No key set' unless memory.hash[:temp].key? :_key key = memory.hash[:temp].delete :_key memory.hash[:temp][key] = resolve(rom_object) end |