32 lines
536 B
C
32 lines
536 B
C
#ifndef __EMULATOR__
|
|
#define __EMULATOR__
|
|
#include "global.h"
|
|
#include <stdbool.h>
|
|
|
|
/************************************
|
|
* DEFINITIONS
|
|
************************************/
|
|
|
|
#define BYTE_BITS 8
|
|
#define WORD_BITS 32
|
|
|
|
/************************************
|
|
* STRUCTS
|
|
************************************/
|
|
|
|
typedef struct {
|
|
bool Negative;
|
|
bool Zero;
|
|
bool Carry;
|
|
bool Overflow;
|
|
} PState;
|
|
|
|
typedef struct {
|
|
word registers[REGISTER_COUNT];
|
|
word pc;
|
|
byte *memory;
|
|
PState conditionCodes;
|
|
} Machine;
|
|
|
|
#endif
|