rubyx/lib/risc/instructions/function_call.rb
Torsten c890e8402b change in register_names protocol
move to returning the attribute names
getting and setting can then be automated in the base class
2020-03-22 14:31:43 +02:00

28 lines
582 B
Ruby

module Risc
# name says it all really
# only arg is the method object we want to call
# assembly takes care of the rest (ie getting the address)
class FunctionCall < Instruction
def initialize( source , method)
super(source)
@method = method
end
attr_reader :method
# return an array of names of registers that is used by the instruction
def register_attributes
[]
end
def to_s
class_source method.name
end
end
def self.function_call( source , method )
Risc::FunctionCall.new( source , method )
end
end