I tried running the MemoryAccess/BasicTest.vm on the VM emulator and noticed that push and pop only works sometimes.
push constant 10 (works)
push local 0 (does not work)(out of segment space)
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?
Sorry. I guess I missed that there was a VM test script in addition to the CPU test script. Although I did read about .vm files not running normally, I hadn't properly understood that it was talking about initialization.
It all makes perfect sense now. Thank you!