Class: Amaterasu::GameBoy::Cpu::Instructions::Base
- Inherits:
-
Object
- Object
- Amaterasu::GameBoy::Cpu::Instructions::Base
- Defined in:
- lib/amaterasu/game_boy/cpu/instructions/base.rb
Overview
Defines the mnemonic, bytes and logic for the NOP instruction.
Direct Known Subclasses
Adc, Add16, Add8, And, Call, CbBit, CbRes, CbRl, CbRlc, CbRr, CbRrc, CbSet, CbSla, CbSra, CbSrl, CbSwap, Cp, Daa, Dec, Di, Ei, Halt, Inc, Jp, Jr, Ld16, Ld8, Ldh, Misc, Nop, Or, Pop, Push, Ret, Rotate, Rst, Sbc, Stop, Sub, Xor
Instance Attribute Summary collapse
-
#mnemonic ⇒ Object
readonly
Returns the value of attribute mnemonic.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(cpu:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(cpu:) ⇒ Base
Returns a new instance of Base.
11 12 13 14 |
# File 'lib/amaterasu/game_boy/cpu/instructions/base.rb', line 11 def initialize(cpu:) @cpu = cpu @registers = cpu.registers end |
Instance Attribute Details
#mnemonic ⇒ Object (readonly)
Returns the value of attribute mnemonic.
9 10 11 |
# File 'lib/amaterasu/game_boy/cpu/instructions/base.rb', line 9 def mnemonic @mnemonic end |
Instance Method Details
#execute ⇒ Object
16 17 18 |
# File 'lib/amaterasu/game_boy/cpu/instructions/base.rb', line 16 def execute @logic.call end |