removed blocks and moved to labels
somewhat easier to understand the code as a linked list relatively painless change, considering
This commit is contained in:
@@ -31,16 +31,18 @@ HERE
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Register.machine.init
|
||||
#show_ticks # get output of what is
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","GetSlot","SetSlot",
|
||||
"LoadConstant","SetSlot","LoadConstant","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","LoadConstant","OperatorInstruction",
|
||||
"IsZero","GetSlot","LoadConstant","SetSlot","LoadConstant",
|
||||
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
|
||||
"RegisterTransfer","Syscall","RegisterTransfer","RegisterTransfer","SetSlot",
|
||||
"RegisterTransfer","GetSlot","FunctionReturn","GetSlot","Branch",
|
||||
"RegisterTransfer","GetSlot","FunctionReturn","GetSlot","RegisterTransfer",
|
||||
"GetSlot","FunctionReturn","RegisterTransfer","Syscall","NilClass"].each_with_index do |name , index|
|
||||
["Branch","Label","LoadConstant","GetSlot","SetSlot",
|
||||
"RegisterTransfer","FunctionCall","Label","SaveReturn","GetSlot",
|
||||
"GetSlot","SetSlot","LoadConstant","SetSlot","LoadConstant",
|
||||
"SetSlot","RegisterTransfer","FunctionCall","Label","SaveReturn",
|
||||
"GetSlot","LoadConstant","OperatorInstruction","IsZero","GetSlot",
|
||||
"LoadConstant","SetSlot","LoadConstant","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","Label","SaveReturn","GetSlot","RegisterTransfer",
|
||||
"Syscall","RegisterTransfer","RegisterTransfer","SetSlot","Label",
|
||||
"RegisterTransfer","GetSlot","FunctionReturn","GetSlot","Branch",
|
||||
"Label","Label","RegisterTransfer","GetSlot","FunctionReturn",
|
||||
"GetSlot","Label","RegisterTransfer","GetSlot","FunctionReturn",
|
||||
"RegisterTransfer","Syscall","NilClass"].each_with_index do |name , index|
|
||||
got = ticks(1)
|
||||
assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user