Class: Amaterasu::GameBoy::Cpu::Instructions::Dec

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

Overview

Holds the logic of all the Decrement instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, operand:) ⇒ Dec

Returns a new instance of Dec.



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

def initialize(cpu:, operand:)
  super(cpu:)

  @mnemonic = "DEC #{format_operand(operand)}"
  @logic    = build_logic(operand)
end