fn sbc(&mut self) -> bool {
        //    A - M - ~C
        // -> A - M - (1 - C)
        // -> A - M - 1 + C
        // -> A + ~M + C
        // everything's the same as ADC, but only the fetched data is inversed

        self.fetch();

        // invert the lower byte
        // NOTE: upper byte should be 0x00, but carry
        // out might change it
        let fetched: u16 =(self.fetched as u16) ^ 0x00FF;
        let acc: u16 = self.acc.into();

        let mut sub: u16 = acc + fetched;
        sub += if self.flags.carry { 1 } else { 0 };

        self.flags.set(Flags::N, sub & 0x80 != 0);

        // http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html
        self.flags.set(Flags::V, (!(acc ^ fetched) & (acc ^ sub) & 0x80) != 0);
        self.flags.set(Flags::Z, sub == 0);
        self.flags.set(Flags::C, sub > 0xFF);

        self.acc = (sub & 0x00FF) as u8;

        true
    }
// SBC: Subtract with carry
// Affects: N V Z C
Subtract with carry
Affects: N V Z C
Subtract with carry Affects : N V Z C
fn sbc(&mut self) -> bool {
        //    A - M - ~C
        // -> A - M - (1 - C)
        // -> A - M - 1 + C
        // -> A + ~M + C
        // everything's the same as ADC, but only the fetched data is inversed
        self.fetch();
        // invert the lower byte
        // NOTE: upper byte should be 0x00, but carry
        // out might change it
        let fetched: u16 =(self.fetched as u16) ^ 0x00FF;
        let acc: u16 = self.acc.into();
        let mut sub: u16 = acc + fetched;
        sub += if self.flags.carry { 1 } else { 0 };
        self.flags.set(Flags::N, sub & 0x80 != 0);
        // http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html
        self.flags.set(Flags::V, (!(acc ^ fetched) & (acc ^ sub) & 0x80) != 0);
        self.flags.set(Flags::Z, sub == 0);
        self.flags.set(Flags::C, sub > 0xFF);
        self.acc = (sub & 0x00FF) as u8;
        true
    }
fn sbc ( & mut self ) -> bool { //    A - M - ~C // -> A - M - (1 - C) // -> A - M - 1 + C // -> A + ~M + C // everything's the same as ADC, but only the fetched data is inversed self . fetch ( ) ; // invert the lower byte // NOTE: upper byte should be 0x00, but carry // out might change it let fetched : u16 = ( self . fetched as u16 ) ^ 0x00FF ; let acc : u16 = self . acc . into ( ) ; let mut sub : u16 = acc + fetched ; sub += if self . flags . carry { 1 } else { 0 } ; self . flags . set ( Flags :: N , sub & 0x80 != 0 ) ; // http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html self . flags . set ( Flags :: V , ( ! ( acc ^ fetched ) & ( acc ^ sub ) & 0x80 ) != 0 ) ; self . flags . set ( Flags :: Z , sub == 0 ) ; self . flags . set ( Flags :: C , sub > 0xFF ) ; self . acc = ( sub & 0x00FF ) as u8 ; true }
SBC: Subtract with carry
Affects: N V Z C
SBC : Subtract with carry Affects : N V Z C
&mut self