Class: Amaterasu::GameBoy::Cpu::Instructions::CbSrl

Inherits:
Base
  • Object
show all
Includes:
Utils::BitOps
Defined in:
lib/amaterasu/game_boy/cpu/instructions/cb_srl.rb

Overview

Holds the logic of all the SRL instructions.

  • SRL r8

  • SRL [HL]

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods included from Utils::BitOps

bit, clear_bit, set_bit

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, target:) ⇒ CbSrl

Returns a new instance of CbSrl.



14
15
16
17
18
19
# File 'lib/amaterasu/game_boy/cpu/instructions/cb_srl.rb', line 14

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

  @mnemonic = "SRL #{format_operand(target)}"
  @logic    = build_logic(target)
end