1
0
mirror of https://github.com/jborza/emu6502.git synced 2024-11-28 08:49:46 +00:00
emu6502/flags.h

15 lines
622 B
C
Raw Normal View History

2019-04-13 08:02:18 +00:00
#pragma once
2019-04-13 08:28:57 +00:00
//#include <cstdint>
#include "types.h"
2019-04-13 08:02:18 +00:00
typedef struct Flags {
2019-04-13 08:28:57 +00:00
//flags high to low: NV-BDIZC
uint8_t c : 1; //set if last operation caused an overflow from bit 7 of the result or an underflow from bit 0
uint8_t z : 1; //set if the result of the last operation was zero
uint8_t i : 1; //set with SEI and cleared with CLI
uint8_t d : 1; //set with SEC and cleared with CLD
uint8_t b : 1; //set when BRK executed
uint8_t pad : 1; //not used
uint8_t v : 1; //if the result has yielded an invalid two's complement result
uint8_t n : 1; //set if the result of the last operation set bit 7 to one
2019-04-13 08:02:18 +00:00
} Flags;