summaryrefslogtreecommitdiff
path: root/qdme.h
diff options
context:
space:
mode:
Diffstat (limited to 'qdme.h')
-rwxr-xr-xqdme.h40
1 files changed, 8 insertions, 32 deletions
diff --git a/qdme.h b/qdme.h
index 611278f..eb70d25 100755
--- a/qdme.h
+++ b/qdme.h
@@ -1,7 +1,9 @@
#ifndef _QDME_H
#define _QDME_H
+#include <stdbool.h>
#include <stdint.h>
+#include <stddef.h>
#define MEM_PADD 12
#define RA 31
@@ -13,38 +15,12 @@
#define A3 7
#define WORD_SIZE 4
-typedef struct {
- unsigned int op: 6;
- unsigned int rs: 5;
- unsigned int rt: 5;
- unsigned int rd: 5;
- unsigned int shamt: 5;
- unsigned int func: 6;
-} rtype_t;
-
-typedef struct {
- unsigned int op: 6;
- unsigned int rs: 5;
- unsigned int rt: 5;
- unsigned int imm: 16;
-} itype_t;
-
-typedef struct {
- unsigned int op: 6;
- unsigned int addr: 26;
-} jtype_t;
-
-typedef enum { NOP, RTYPE, ITYPE, JTYPE } type_t;
-
-typedef struct {
- type_t type;
- union {
- rtype_t r;
- jtype_t j;
- itype_t i;
- uint32_t value;
- };
-} inst_t;
+extern uint8_t *memory;
+extern size_t memsize;
+extern uint32_t pc, hi, lo;
+extern uint32_t regFile[32];
+extern int exitStatus;
+extern bool run;
#endif