Class: Amaterasu::GameBoy::Cpu::Instructions::Rotate

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

Overview

Holds the logic of all the Rotate instructions.

  • RLCA: Rotate Left Circular A.

  • RRCA: Rotate Right Circular A.

  • RLA: Rotate Left Through Carry A.

  • RRA: Rotate Right Through Carry A.

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:, operation:) ⇒ Rotate

Returns a new instance of Rotate.



16
17
18
19
20
21
# File 'lib/amaterasu/game_boy/cpu/instructions/rotate.rb', line 16

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

  @mnemonic = format_operand(operation).to_s
  @logic    = build_logic(operation)
end