Class: Amaterasu::GameBoy::Cpu::Instructions::Ld8

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

Overview

Holds the logic of all the 8-bit Load instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, target:, source:) ⇒ Ld8

Returns a new instance of Ld8.



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

def initialize(cpu:, target:, source:)
  super(cpu:)

  @mnemonic = "LD #{format_operand(target)}, #{format_operand(source)}"
  @logic    = build_logic(target, source)
end