rename RiscTransfer to Transfer

This commit is contained in:
Torsten Ruger
2018-03-21 15:48:04 +05:30
parent fa797f722d
commit b4489b1093
15 changed files with 38 additions and 38 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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