Add emulate constants and machine state, w/ T
This commit is contained in:
parent
4b10d18e26
commit
74bf3ed910
@ -3,8 +3,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "decode.h"
|
#include "decode.h"
|
||||||
|
|
||||||
#define BYTE_BITS 8
|
|
||||||
|
|
||||||
// Retrieve the bits between positions 'lsb' (inclusive) and 'msb' (exclusive) from a given word
|
// Retrieve the bits between positions 'lsb' (inclusive) and 'msb' (exclusive) from a given word
|
||||||
// as a new zero-extended word.
|
// as a new zero-extended word.
|
||||||
static word getBits(word wrd, uint8_t lsb, uint8_t msb) {
|
static word getBits(word wrd, uint8_t lsb, uint8_t msb) {
|
||||||
|
|||||||
24
src/emulator.h
Normal file
24
src/emulator.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
/************************************
|
||||||
|
* DEFINITIONS
|
||||||
|
************************************/
|
||||||
|
#define BYTE_BITS 8
|
||||||
|
|
||||||
|
/************************************
|
||||||
|
* STRUCTS
|
||||||
|
************************************/
|
||||||
|
|
||||||
|
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;
|
||||||
Loading…
Reference in New Issue
Block a user