Class: Amaterasu::GameBoy::Cpu::Instructions::Ei

Inherits:
Base
  • Object
show all
Defined in:
lib/amaterasu/game_boy/cpu/instructions/ei.rb

Overview

Holds the logic of the DI (Disable Interrupts) instruction.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:) ⇒ Ei

Returns a new instance of Ei.



9
10
11
12
13
14
# File 'lib/amaterasu/game_boy/cpu/instructions/ei.rb', line 9

def initialize(cpu:)
  super

  @mnemonic = 'EI'
  @logic    = -> { @cpu.enable_interrupts }
end