next up previous
Next: Virtual Machine Instructions Up: Virtual Machine for CS394 Previous: Virtual Machine for CS394

Virtual Machine Data Structures

  1. The machine has eight general purpose registers R0 to R7.
  2. It has special purpose registers BP and SP with the usual meaning.
  3. It has a stack whose size is given by a constant called STACKSIZE.

All this is encapsulated in a set of C declarations which look like this:

#define STACKSIZE 1000
int stack[STACKSIZE];
int R0, R1, R2, R3, R4, R5, R6, R7;
int SP, BP;



2006-03-18