ARMv8/src/emulator.h
2024-06-03 14:37:08 +01:00

33 lines
609 B
C

#ifndef __EMULATOR__
#define __EMULATOR__
#include "global.h"
#include <stdbool.h>
/************************************
* DEFINITIONS
************************************/
#define BYTE_BITS 8
#define WORD_BITS (BYTE_BITS * sizeof(word))
#define DWORD_BITS (BYTE_BITS * sizeof(dword))
/************************************
* STRUCTS
************************************/
typedef struct {
bool Negative;
bool Zero;
bool Carry;
bool Overflow;
} PState;
typedef struct {
dword registers[REGISTER_COUNT];
dword pc;
byte *memory;
PState conditionCodes;
} Machine;
#endif