The_Larks wrote
I'm a little perplexed here. Bootstrap is supposed to set SP to 256, then *literally* call Sys.int(). Then, we let our regular VM take over in parsing the rest (and **ALL**) of Sys.vm for FibonacciElement?
My code passes all tests, including a "Call only" test, but it fails on bootstrap. I'm probably not understanding exactly what they are asking for, but is it just me, or shouldn't bootstrap be a fairly simple implementation once you get to it?
The bootstrap code is just what you describe. From my VM translator (in Python):
def WriteInit(self):
"""
Write the VM initialization code:
Set the SP to 256.
Call Sys.Init()
Halt loop
"""
self._WriteCode('@256, D=A, @SP, M=D')
self.WriteCall('Sys.init', '0')
self._WriteCode(self._CodeHalt())
Note that the halt loop after the call is not strictly required; it's a safety feature in case some errant Sys.ini returned.
I don't understand what you mean by "fails on bootstrap".
All of the tests in ProgramFlow will fail if you include bootstrap code, as will FunctionCalls/SimpleFunction.
FunctonCalls/NestedCall can run with or without bootstrap code.
FunctonCalls/FibonacciElement and FunctonCalls/StaticsTest require bootstrap code.
I added a command option -n (no-bootstrap) to my translator so that I could still run the earlier tests.
You mention FibbonacciElement. Are you padding NestedCall? It is an intermediate test between SimpleFunction and FibbonacciElement.
--Mark