/* params.h: virtual machine parameters */ /* Charles Eric LaForest, April 2008 */ /* laforest AT eecg.utoronto.ca */ #define STACK_DEPTH 32 #define STACK_DEPTH_MASK 0x1f /*Must match STACK_DEPTH*/ #define OPCODE_WIDTH 5 #define OPCODE_MASK 0x1f /*Must match OPCODE_WIDTH*/ #define CYCLE_COUNTER (mem_size - 5) /*in bytes, simulator uses ints, so 128 ints per block*/ #define DISK_BLOCK_SIZE 512 #define DISK_READ_PORT (mem_size - 4) #define DISK_WRITE_PORT (mem_size - 3) #define MEM_INPUT (mem_size - 2) #define MEM_OUTPUT (mem_size - 1) enum { PCFETCH = 0, /*PC@ *must* be opcode 0*/ CALL, RET, JMP, JMPZERO, JMPPLUS, FETCHA, STOREA, FETCHAPLUS, STOREAPLUS, FETCHRPLUS, STORERPLUS, LIT, RTU, /* Return To User*/ UNDEF1, UNDEF2, XOR, AND, NOT, TWOSTAR, TWOSLASH, PLUS, PLUSSTAR, DUP, DROP, OVER, TOR, RFROM, TOA, AFROM, NOP, UNDEF3 };