diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-05-09 18:54:46 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-05-09 18:54:46 -0400 |
| commit | 3cfd8e1da5dedecf9c306770acbc7125ec874d35 (patch) | |
| tree | 23c7cfa69278e99d4cd08de3126a6ba074acbd95 /qdme.h | |
| parent | 3f51c2469c71154f6ce7cb75460488fd8e58e3ec (diff) | |
Move to Big Endian Binaries
Diffstat (limited to 'qdme.h')
| -rw-r--r-- | qdme.h | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -0,0 +1,50 @@ +#ifndef _QDME_H +#define _QDME_H + +#include <stdint.h> + +#define MEM_SIZE 36 +#define RA 31 +#define V0 2 +#define V1 3 +#define A0 4 +#define A1 5 +#define A2 6 +#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; + +#endif + |
