Class: Amaterasu::GameBoy::Cpu::Instructions::Inc

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

Overview

Holds the logic of all the INC (Increment) instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, operand:) ⇒ Inc

Returns a new instance of Inc.



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

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

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