Class: Amaterasu::GameBoy::Cpu::Instructions::Sub
- Defined in:
- lib/amaterasu/game_boy/cpu/instructions/sub.rb
Overview
Handles the logic related to all possible SUB instructions
-
SUB A, r8
-
SUB A, [HL]
-
SUB A, n8
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(cpu:, source:) ⇒ Sub
constructor
A new instance of Sub.
Methods inherited from Base
Constructor Details
#initialize(cpu:, source:) ⇒ Sub
Returns a new instance of Sub.
15 16 17 18 19 20 |
# File 'lib/amaterasu/game_boy/cpu/instructions/sub.rb', line 15 def initialize(cpu:, source:) super(cpu:) @mnemonic = "SUB A, #{format_operand(source)}" @logic = build_logic(source) end |