Project 8: Additonal VM Call test

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Project 8: Additonal VM Call test

cadet1620
Administrator
Contributed by Mark Armbrust
11 June 2014
Extract this archive into your nand2tetris/projects/08/FunctionCalls directory.
  NestedCall.zip
It will create a NestedCall subdirectory in FunctionCalls.

NestedCall is an intermediate test between SimpleFunction and FibonacciElement in complexity. It may be useful when SimpleFunction passes but FibonacciElement fails or crashes. NestedCall also tests several requirements of the Function Calling Protocol that are not verified by any of the supplied tests.

Nested call can be used with or without the VM bootstrap code.

The NestedCall.tst script sets up the stack to simulate the bootstrap's call to Sys.init() and runs the program. If the bootstrap is not present, the program begins running with Sys.init() since it is the first function in Sys.vm.

If the program starts with the bootstrap, the bootstrap will initialize the stack and call Sys.init(), so the test should see the same environment either way it gets to Sys.init().

Additional details are in NestedCall.html in the archive.


Loading...