Problem with staticsTest.tst

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with staticsTest.tst

nandona
Is it supposed to set RAM[0] to 256? because then the test fails even if all my output, relatively to the stack starting at 256, are -2 and 8.
My final stack looks like this
RAM[256] -2
RAM[257] 8
RAM[0] 258
However in the vmtest the stack starts at 261 so if I change my test file to set RAM[0] to 261 at the beginning my program passes the test
Reply | Threaded
Open this post in threaded view
|

Re: Problem with staticsTest.tst

WBahn
Administrator
What is your bootstrap code doing?

It sounds like you are not calling Sys.init().

Reply | Threaded
Open this post in threaded view
|

Re: Problem with staticsTest.tst

nandona
I ran my translator on Sys.vm and then changed the file name lol. I probably needed to make like a StaticsTest.vm which contains call Sys.init 0 and then run it on this one. Did I get that right now?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with staticsTest.tst

WBahn
Administrator
nandona wrote
I ran my translator on Sys.vm and then changed the file name lol. I probably needed to make like a StaticsTest.vm which contains call Sys.init 0 and then run it on this one. Did I get that right now?
I don't follow what you are trying to say. Changed the name of what file? To what? Why?

All of the .vm files you need are right there in the StaticsTest directory.

At the point where you are performing this test, you are supposed to have your full-up translator implemented, which includes the bootstrap code. What the bootstrap code does is detailed at the end of Section 8.3.1.

If you have implemented your translator correctly, all you need to do is run it on the StaticsTest folder and then run the StaticsTest.tst file using the CPU Emulator.

If all else fails, walk through the execution of the .vm files by hand with pen and paper to see why the values in the comparison file are what they are.