Class: GBRb::InstructionSet::Ldahld

Inherits:
Instruction show all
Defined in:
lib/gbrb/instruction_set/ld.rb

Instance Attribute Summary

Attributes inherited from Instruction

#i, #m, #t

Instance Method Summary collapse

Methods inherited from Instruction

#carry?, #immediate_count

Constructor Details

#initialize(m = 2, t = 8) ⇒ Ldahld

Returns a new instance of Ldahld.



96
97
98
# File 'lib/gbrb/instruction_set/ld.rb', line 96

def initialize m=2, t=8
  super
end

Instance Method Details

#call(r, mem) ⇒ Object



100
101
102
103
# File 'lib/gbrb/instruction_set/ld.rb', line 100

def call r, mem
  r.a.store mem.read_byte r.hl.read
  r.hl.store r.hl.read - 1
end