Class: Amaterasu::GameBoy::Cpu::Instructions::Ret
- Defined in:
- lib/amaterasu/game_boy/cpu/instructions/ret.rb
Overview
Holds the logic of all the RET + RETI instructions.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(cpu:, condition: nil, enable_ime: false) ⇒ Ret
constructor
Creates a Ret instruction object with a mnemonic and logic to be executed.
Methods inherited from Base
Constructor Details
#initialize(cpu:, condition: nil, enable_ime: false) ⇒ Ret
Creates a Ret instruction object with a mnemonic and logic to be executed.
10 11 12 13 14 15 |
# File 'lib/amaterasu/game_boy/cpu/instructions/ret.rb', line 10 def initialize(cpu:, condition: nil, enable_ime: false) super(cpu:) @mnemonic = enable_ime ? 'RETI' : "RET #{format_operand(condition)}".strip @logic = build_logic(condition, enable_ime) end |