From d7f56e47f79baa742bf1702c7f8d2969310e2adb Mon Sep 17 00:00:00 2001 From: sBubshait Date: Wed, 29 May 2024 14:27:52 +0100 Subject: [PATCH] Update defs.h: Define Machine, PSTATE --- src/emulator/defs.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/emulator/defs.h b/src/emulator/defs.h index 62cd9e5..5eca223 100644 --- a/src/emulator/defs.h +++ b/src/emulator/defs.h @@ -9,18 +9,30 @@ #define DEFS_H #include "../global.h" #include +#include /************************************ * 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 \ No newline at end of file