rubyx/lib/slot_machine/macro/method_missing.rb
Torsten Rüger d1f8733623 Rename Vool to Sol
Simple is really the descriptive name for the layer
Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified)
Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else
Just cause i was renaming anyway
2019-10-04 00:38:47 +03:00

22 lines
615 B
Ruby

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