vsm2

exeprimental virtual stack machine for *nix
Log | Files | Refs

mem.h (387B)


      1 /* concerning the memory management */
      2 
      3 /* currently memory structure is a simple
      4    array of Cells. */
      5 
      6 #define MaxRAM 4096
      7 
      8 typedef struct Mem Mem;
      9 typedef struct MemCmd MemCmd;
     10 
     11 struct Mem {
     12 	Bus *bus;
     13 	Cell ram[MaxRAM];
     14 };
     15 
     16 struct MemCmd {
     17 	char op;
     18 	int addr;
     19 };
     20 
     21 Mem * createmem(Bus *);
     22 int memstep(void *);
     23 
     24 void memfetch(int, Mem *, int);
     25 void memstore(int, Mem *, int, Cell *);