2014-10-04 11:51:08 +02:00
|
|
|
module Register
|
|
|
|
|
2015-06-21 20:00:16 +02:00
|
|
|
# transfer the constents of one register to another.
|
|
|
|
# possibly called move in some cpus
|
2014-10-04 11:51:08 +02:00
|
|
|
|
2015-06-21 20:00:16 +02:00
|
|
|
# There are other instructions to move data from / to memory, namely GetSlot and SetSlot
|
|
|
|
|
|
|
|
# Get/Set Slot move data around in vm objects, but transfer moves the objects (in the machine)
|
|
|
|
#
|
|
|
|
# Also it is used for moving temorary data
|
|
|
|
|
2014-10-04 11:51:08 +02:00
|
|
|
class RegisterTransfer < Instruction
|
|
|
|
def initialize from , to
|
2014-10-07 11:23:08 +02:00
|
|
|
@from = wrap_register(from)
|
|
|
|
@to = wrap_register(to)
|
2014-10-04 11:51:08 +02:00
|
|
|
end
|
|
|
|
attr_reader :from, :to
|
|
|
|
end
|
2015-06-21 20:00:16 +02:00
|
|
|
end
|