struct Flags { union { uint8_t data = 0; BooleanBitField n; BooleanBitField v; BooleanBitField d; BooleanBitField i; BooleanBitField z; BooleanBitField c; }; inline operator uint() { return data; } inline auto& operator =(uint value) { return data = value, *this; } inline auto& operator&=(uint value) { return data &= value, *this; } inline auto& operator|=(uint value) { return data |= value, *this; } inline auto& operator^=(uint value) { return data ^= value, *this; } }; struct Registers { uint8 mdr; uint16 pc; uint8 a, x, y, s; Flags p; } regs; struct Register16 { union { uint16_t w; NaturalBitField l; NaturalBitField h; }; } abs, iabs; uint8 rd; uint8 zp; uint16 aa;