Class: Amaterasu::GameBoy::Cpu::Instructions::Jp

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

Overview

Holds the logic of all the load instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, location:, condition: nil) ⇒ Jp

Returns a new instance of Jp.



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

def initialize(cpu:, location:, condition: nil)
  super(cpu:)

  @mnemonic = "JP #{format_operand(condition)}, #{format_operand(location)}"
  @logic    = build_logic(location, condition)
end