Class: GBRb::InstructionSet::Ldhlda

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) ⇒ Ldhlda

Returns a new instance of Ldhlda.



107
108
109
# File 'lib/gbrb/instruction_set/ld.rb', line 107

def initialize m=2, t=8
  super
end

Instance Method Details

#call(r, mem) ⇒ Object



111
112
113
114
# File 'lib/gbrb/instruction_set/ld.rb', line 111

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