Two virtual machines can be linked together and call each other's functions. In addition, the virtual machine itself provides functions (as opposed to opcodes) that an assembly program can call. Calls of either type are referred to as remote procedure calls. Using these functions is similar to a normal function call, as far as setting up the stack goes. However, RPCs return two values. The first value is whether or not the remote call succeeded. A remote can fail for any number of reasons:
- The virtual machine does not recognize the specified function, and the linked virtual machine does not have the function (or there is no linked virtual machine).
- The number of arguments pushed onto the stack was insufficient.
- On a linked call, the call threw a runtime error.
The actual return value of the function is pushed onto the top of the stack.
Mason Smith
2008-06-11