Virtual machine

All scripts run on a virtual machine (VM). VM simulates hardware and an operating system. A script is given in high level SC language, to run on VM it must be compiled to bytecode recongnized by it. Full compilation is done before running, so it may run faster, errors are known immediately.

Before using any script you must create a virtual machine. The code below is based on the example from the previous chapter;

  ISCVM *vm = env->CreateVM("vm1", NULL); //env is a valid ISCEnv object
  if(!vm)
     return -1;

You can pass as the second argument the object of ISCVMDesc type. Currently it contains only one member:

Typically you need just one virtual machine, a script runs only on the virtual machine that created it.