Class: Amaterasu::GameBoy::Cpu::Instructions::CbSwap
- Includes:
- Utils::BitOps
- Defined in:
- lib/amaterasu/game_boy/cpu/instructions/cb_swap.rb
Overview
Holds the logic of all the SWAP instructions.
-
SWAP r8
-
SWAP [HL]
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(cpu:, target:) ⇒ CbSwap
constructor
A new instance of CbSwap.
Methods included from Utils::BitOps
Methods inherited from Base
Constructor Details
#initialize(cpu:, target:) ⇒ CbSwap
Returns a new instance of CbSwap.
14 15 16 17 18 19 |
# File 'lib/amaterasu/game_boy/cpu/instructions/cb_swap.rb', line 14 def initialize(cpu:, target:) super(cpu:) @mnemonic = "SWAP #{format_operand(target)}" @logic = build_logic(target) end |