fn sub(&mut self, n: u8) {
        let a = self.registers.a;
        let r = a.wrapping_sub(n);
        self.flags.z = r == 0x00;
        self.flags.s = bit::get(r, 7);
        self.flags.p = r.count_ones() & 0x01 == 0x00;
        self.flags.a = (a as i8 & 0x0f) - (n as i8 & 0x0f) >= 0x00;
        self.flags.c = u16::from(a) < u16::from(n);
        self.registers.a = r;
    }
// SUB register or memory from Accumulator
SUB register or memory from Accumulator
SUB register or memory from Accumulator
fn sub(&mut self, n: u8) {
        let a = self.registers.a;
        let r = a.wrapping_sub(n);
        self.flags.z = r == 0x00;
        self.flags.s = bit::get(r, 7);
        self.flags.p = r.count_ones() & 0x01 == 0x00;
        self.flags.a = (a as i8 & 0x0f) - (n as i8 & 0x0f) >= 0x00;
        self.flags.c = u16::from(a) < u16::from(n);
        self.registers.a = r;
    }
fn sub ( & mut self , n : u8 ) { let a = self . registers . a ; let r = a . wrapping_sub ( n ) ; self . flags . z = r == 0x00 ; self . flags . s = bit :: get ( r , 7 ) ; self . flags . p = r . count_ones ( ) & 0x01 == 0x00 ; self . flags . a = ( a as i8 & 0x0f ) - ( n as i8 & 0x0f ) >= 0x00 ; self . flags . c = u16 :: from ( a ) < u16 :: from ( n ) ; self . registers . a = r ; }
SUB register or memory from Accumulator
SUB register or memory from Accumulator
&mut self
n
u8
&mut self
n
u8