Update defs.h: Define Machine, PSTATE
This commit is contained in:
parent
f70ab669d6
commit
d7f56e47f7
@ -9,18 +9,30 @@
|
||||
#define DEFS_H
|
||||
#include "../global.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/************************************
|
||||
* MACROS AND CONSTANTS
|
||||
************************************/
|
||||
#define EXIT_FAILURE 1
|
||||
#define EXIT_SUCCESS 0
|
||||
#define HALT_INSTRUCTION 0x8a000000;
|
||||
|
||||
/************************************
|
||||
* TYPEDEFS
|
||||
************************************/
|
||||
|
||||
typedef uint8_t Byte;
|
||||
typedef uint8_t byte;
|
||||
typedef struct {
|
||||
bool Negative;
|
||||
bool Zero;
|
||||
bool Carry;
|
||||
bool Overflow;
|
||||
} PSTATE;
|
||||
typedef struct {
|
||||
word registers[REGISTER_COUNT];
|
||||
word PC;
|
||||
byte memory[MEMORY_SIZE];
|
||||
PSTATE conditionCodes;
|
||||
} Machine;
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user