toka.nbk: Home | Index | Next Page: WordClasses | Previous Page: Variables


 vm.c

Use

Implements the heart of the virtual machine.

Functions Provided

Variables:
  Inst *heap
  Pointer into the current heap

  Inst *ip
  The instruction pointer

  long stack[100], rstack[100]
  The data and return stacks

  long sp, rsp
  The stack pointers

vm_run(Inst)
Run through a list of instructions
Side effects:
  modifes *ip

vm_stack_check()
Check for over/underflow and reset if detected
If the return stack over/underflows, exit Toka

push(long a)
Push a number to the stack.

lit()
Push the value in the following memory location
to the stack

Primitives Provided

heap

toka.nbk: Home | Index | Next Page: WordClasses | Previous Page: Variables


Notebook exported on Sunday, 1 July 2007, 19:54:43 PM EDT