Class: Amaterasu::GameBoy::Cpu::Instructions::Push

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

Overview

Holds the logic of all the PUSH instructions.

Instance Attribute Summary

Attributes inherited from Base

#mnemonic

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(cpu:, reg16:) ⇒ Push

Creates a Push instruction object with a mnemonic and logic to be executed.



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

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

  @mnemonic = "PUSH #{format_operand(reg16)}"
  @logic    = build_logic(reg16)
end