rename RiscTransfer to Transfer
This commit is contained in:
@ -31,7 +31,7 @@ module Arm
|
||||
ArmMachine.str( :lr , code.register , arm_index(code) )
|
||||
end
|
||||
|
||||
def translate_RiscTransfer( code )
|
||||
def translate_Transfer( code )
|
||||
# Risc machine convention is from => to
|
||||
# But arm has the receiver/result as the first
|
||||
ArmMachine.mov( code.to , code.from)
|
||||
|
@ -7,7 +7,7 @@ module Risc
|
||||
# This is because that is what cpu's can do. In programming terms this would be accessing
|
||||
# an element in an array, in the case of RegToSlot setting the register in the array.
|
||||
|
||||
# btw: to move data between registers, use RiscTransfer
|
||||
# btw: to move data between registers, use Transfer
|
||||
|
||||
class RegToSlot < Setter
|
||||
|
||||
|
@ -7,7 +7,7 @@ module Risc
|
||||
# This is because that is what cpu's can do. In programming terms this would be accessing
|
||||
# an element in an array, in the case of SlotToReg setting the value in the array.
|
||||
|
||||
# btw: to move data between registers, use RiscTransfer
|
||||
# btw: to move data between registers, use Transfer
|
||||
|
||||
class SlotToReg < Getter
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
module Risc
|
||||
|
||||
# transfer the constents of one register to another.
|
||||
# Transfer the constents of one register to another.
|
||||
# possibly called move in some cpus
|
||||
|
||||
# There are other instructions to move data from / to memory, namely SlotToReg and RegToSlot
|
||||
@ -10,13 +10,13 @@ module Risc
|
||||
# Also it is used for moving temorary data
|
||||
#
|
||||
|
||||
class RiscTransfer < Instruction
|
||||
class Transfer < Instruction
|
||||
# initialize with from and to registers.
|
||||
# First argument from
|
||||
# second argument to
|
||||
#
|
||||
# Note: this may be reversed from some assembler notations (also arm)
|
||||
def initialize source , from , to
|
||||
def initialize( source , from , to )
|
||||
super(source)
|
||||
@from = from
|
||||
@to = to
|
||||
@ -26,10 +26,10 @@ module Risc
|
||||
attr_reader :from, :to
|
||||
|
||||
def to_s
|
||||
"RiscTransfer: #{from} -> #{to}"
|
||||
"Transfer: #{from} -> #{to}"
|
||||
end
|
||||
end
|
||||
def self.transfer( source , from , to)
|
||||
RiscTransfer.new( source , from , to)
|
||||
Transfer.new( source , from , to)
|
||||
end
|
||||
end
|
@ -184,7 +184,7 @@ module Risc
|
||||
true
|
||||
end
|
||||
|
||||
def execute_RiscTransfer
|
||||
def execute_Transfer
|
||||
value = get_register @instruction.from
|
||||
set_register @instruction.to , value
|
||||
true
|
||||
|
Reference in New Issue
Block a user