rubyx/lib/slot_machine/macro/method_missing.rb
Torsten 90935bfbbc risc is GREEN
totally, man.
Small fix in method missing fixed last block tests
(why, i do not know)
2020-03-22 15:58:19 +02:00

21 lines
630 B
Ruby

module SlotMachine
class MethodMissing < Macro
attr_reader :name_reg
def initialize( source , name_reg )
super(source)
name_reg = Risc::RegisterValue.new(name_reg , :Word) if name_reg.class == Symbol
raise "No reg #{name_reg.class}" unless name_reg.is_a? Risc::RegisterValue
@name_reg = name_reg
end
def to_risc(compiler)
builder = compiler.builder(compiler.source_name)
to = Risc::RegisterValue.new(:r1 , :Word)
builder.add_code Risc::Transfer.new(self , name_reg , to)
builder.add_code Risc::Syscall.new(self, :died )
return compiler
end
end
end