Class: GBRb::InstructionSet::Ldhln

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(target, m = 2, t = 8) ⇒ Ldhln

Returns a new instance of Ldhln.



31
32
33
34
# File 'lib/gbrb/instruction_set/ld.rb', line 31

def initialize target, m=2, t=8
  super m, t
  @target = target.to_sym
end

Instance Method Details

#call(r, mem) ⇒ Object



36
37
38
# File 'lib/gbrb/instruction_set/ld.rb', line 36

def call r, mem
  mem.write_byte r.hl.read, r.public_send(@target).read
end