rubyx/lib/risc/instructions/function_call.rb

28 lines
582 B
Ruby
Raw Normal View History

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
2015-07-24 12:23:56 +02:00
# return an array of names of registers that is used by the instruction
def register_attributes
[]
end
2015-07-24 12:23:56 +02:00
def to_s
2018-03-22 17:38:19 +01:00
class_source method.name
2015-07-24 12:23:56 +02:00
end
end
2015-07-24 12:23:56 +02:00
def self.function_call( source , method )
Risc::FunctionCall.new( source , method )
end
2015-07-24 12:23:56 +02:00
end