2017-01-19 09:02:29 +02:00
|
|
|
module Risc
|
2014-10-03 14:32:54 +03: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 12:21:20 +03:00
|
|
|
def initialize( source , method)
|
2015-07-27 12:13:39 +03:00
|
|
|
super(source)
|
2014-10-03 14:32:54 +03:00
|
|
|
@method = method
|
|
|
|
end
|
2018-05-19 12:21:20 +03:00
|
|
|
attr_reader :method
|
2015-07-24 13:23:56 +03:00
|
|
|
|
|
|
|
def to_s
|
2018-03-22 18:38:19 +02:00
|
|
|
class_source method.name
|
2015-07-24 13:23:56 +03:00
|
|
|
end
|
2015-10-18 19:27:46 +03:00
|
|
|
end
|
2015-07-24 13:23:56 +03:00
|
|
|
|
2018-05-19 12:21:20 +03:00
|
|
|
def self.function_call( source , method )
|
|
|
|
Risc::FunctionCall.new( source , method )
|
2016-12-28 19:01:58 +02:00
|
|
|
end
|
|
|
|
|
2015-07-24 13:23:56 +03:00
|
|
|
end
|