source/vm.c
/******************************************************
 * Initialize the VM
 * This will clear the memory and stacks, and set the
 * registers to zero.
 ******************************************************/
Initialize the VM
This will clear the memory and stacks, and set the
registers to zero.
Initialize the VM This will clear the memory and stacks and set the registers to zero .
void init_vm(VM *vm)
{
   int a;
   vm->ip = 0;
   vm->sp = 0;
   vm->rsp = 0;
   for (a = 0; a < STACK_DEPTH; a++)
      vm->data[a] = 0;
   for (a = 0; a < ADDRESSES; a++)
      vm->address[a] = 0;
   for (a = 0; a < IMAGE_SIZE; a++)
      vm->image[a] = 0;
   for (a = 0; a < 1024; a++)
      vm->ports[a] = 0;
   comp_init (COMP_BUFFER);
}
void init_vm ( VM * vm ) { int a ; vm -> ip = 0 ; vm -> sp = 0 ; vm -> rsp = 0 ; for ( a = 0 ; a < STACK_DEPTH ; a ++ ) vm -> data [ a ] = 0 ; for ( a = 0 ; a < ADDRESSES ; a ++ ) vm -> address [ a ] = 0 ; for ( a = 0 ; a < IMAGE_SIZE ; a ++ ) vm -> image [ a ] = 0 ; for ( a = 0 ; a < 1024 ; a ++ ) vm -> ports [ a ] = 0 ; comp_init ( COMP_BUFFER ) ; }
Initialize the VM
 This will clear the memory and stacks, and set the
 registers to zero.
Initialize the VM This will clear the memory and stacks and set the registers to zero .