Return to_risc

remove the index from FunctionReturn, just jump to the register address
This commit is contained in:
Torsten Ruger
2018-03-21 15:48:50 +05:30
parent b4489b1093
commit 61a801b00c
2 changed files with 18 additions and 9 deletions

View File

@ -1,22 +1,21 @@
module Risc
# return from a function call
# register and index specify where the return address is stored
# register specifes where the return address is stored
class FunctionReturn < Instruction
def initialize( source , register , index)
def initialize( source , register )
super(source)
@register = register
@index = index
end
attr_reader :register , :index
attr_reader :register
def to_s
"FunctionReturn: #{register} [#{index}]"
"FunctionReturn: #{register} "
end
end
def self.function_return( source , register , index)
FunctionReturn.new( source , register , index)
def self.function_return( source , register )
FunctionReturn.new( source , register )
end
end