Class: GBRb::InstructionSet::Ldann

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

Returns a new instance of Ldann.



119
120
121
122
# File 'lib/gbrb/instruction_set/ld.rb', line 119

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

Instance Method Details

#call(r, mem) ⇒ Object



124
125
126
# File 'lib/gbrb/instruction_set/ld.rb', line 124

def call r, mem
  r.a.store mem.read_byte r.public_send(@target).read
end