Administrator
|
SimpleFunction does get executed and does return.
The test script loads SimpleFunction.asm or SimpleFunction.vm, depending on which script/emulator you are using. This results in the IP pointing to the first instruction in the loaded .asm/.vm file. The script then sets up a stack frame as if SimpleFunction had been called. The script then begins running the emulator.
In the case of the CPU Emulator test, SimpleFunction returns to 1000, which is assumed to be beyond the end of the .asm code generated for SimpleFunction.vm, and the Emulator executes NOPs until the end of the test. The stack frame after SimpleFunction returns is compared to the expected values.
In the case of the VM Emulator, SimpleFunction returns to 9 which is the return statement. but the return does not get executed a second time because the test script only executes 9 instructions.
--Mark
|