2017-01-19 08:02:29 +01:00
|
|
|
module Risc
|
2014-10-03 13:32:54 +02:00
|
|
|
# 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
|
2018-05-19 11:21:20 +02:00
|
|
|
def initialize( source , method)
|
2015-07-27 11:13:39 +02:00
|
|
|
super(source)
|
2014-10-03 13:32:54 +02:00
|
|
|
@method = method
|
|
|
|
end
|
2018-05-19 11:21:20 +02:00
|
|
|
attr_reader :method
|
2015-07-24 12:23:56 +02:00
|
|
|
|
2020-03-18 16:49:23 +01:00
|
|
|
# return an array of names of registers that is used by the instruction
|
2020-03-20 12:58:40 +01:00
|
|
|
def register_attributes
|
2020-03-18 16:49:23 +01:00
|
|
|
[]
|
|
|
|
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
|
2015-10-18 18:27:46 +02:00
|
|
|
end
|
2015-07-24 12:23:56 +02:00
|
|
|
|
2018-05-19 11:21:20 +02:00
|
|
|
def self.function_call( source , method )
|
|
|
|
Risc::FunctionCall.new( source , method )
|
2016-12-28 18:01:58 +01:00
|
|
|
end
|
|
|
|
|
2015-07-24 12:23:56 +02:00
|
|
|
end
|