|
I tried running the MemoryAccess/BasicTest.vm on the VM emulator and noticed that push and pop only works sometimes.
E.g:
push constant 10 (works)
push local 0 (does not work)(out of segment space)
and
pop local 0 (does not work)(out of segment space)
pop temp 6 (does work)
From what I understand, this happens when there is no start address(pointer) assigned to the particular segment yet.
However, why does 'pop local 0' not work while 'pop temp 6' works fine?
Also, for translating into assembly code, do you need to check for such out of segment errors and skip such VM commands? I also read that the VM code should be assumed error free. If so, then is the code in BasicTest.vm purposefully wrong?
|