Class: Amaterasu::GameBoy::Cpu::Instructions::Jr

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

Overview

Holds the logic of all the JR (Jump Relative) instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, condition: nil) ⇒ Jr

Returns a new instance of Jr.



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

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

  @mnemonic = "JR #{format_operand(condition)}, e8"
  @logic    = build_logic(condition)
end