Public feed #381408

Stuff

public text v1 · immutable
Raw Edit
·published 2007-03-04 20:51 UTC
rendered paste body
typedef unsigned int word;

enum op_code {
  ADD,
  SUB,
  MUL,
  DIV,
  CMP,
  JMP,
  JMPI,
  SAVE,   /* save state */
  REST,   /* restore state */
  HALT,
  PRINT,
  LOAD,
};


struct instruction {
  enum op_code op;
  word a;
  word b;
  word c;
};

struct state {
  word regs[1024];
  word pc;
};