fn adc(&mut self, n: u8) {
        let c: u8 = match self.flags.c {
            false => 0,
            true => 1,
        };
        let a = self.registers.a;
        let r = a.wrapping_add(n).wrapping_add(c);
        self.flags.z = r == 0x00;
        self.flags.s = bit::get(r, 7);
        self.flags.p = r.count_ones() & 0x01 == 0x00;
        self.flags.a = (a & 0x0f) + (n & 0x0f) + c > 0x0f;
        self.flags.c = u16::from(a) + u16::from(n) + u16::from(c) > 0xff;
        self.registers.a = r;
    }
// ADD register or memory to Accumulator with carry
ADD register or memory to Accumulator with carry
ADD register or memory to Accumulator with carry
fn adc(&mut self, n: u8) {
        let c: u8 = match self.flags.c {
            false => 0,
            true => 1,
        };
        let a = self.registers.a;
        let r = a.wrapping_add(n).wrapping_add(c);
        self.flags.z = r == 0x00;
        self.flags.s = bit::get(r, 7);
        self.flags.p = r.count_ones() & 0x01 == 0x00;
        self.flags.a = (a & 0x0f) + (n & 0x0f) + c > 0x0f;
        self.flags.c = u16::from(a) + u16::from(n) + u16::from(c) > 0xff;
        self.registers.a = r;
    }
fn adc ( & mut self , n : u8 ) { let c : u8 = match self . flags . c { false => 0 , true => 1 , } ; let a = self . registers . a ; let r = a . wrapping_add ( n ) . wrapping_add ( c ) ; self . flags . z = r == 0x00 ; self . flags . s = bit :: get ( r , 7 ) ; self . flags . p = r . count_ones ( ) & 0x01 == 0x00 ; self . flags . a = ( a & 0x0f ) + ( n & 0x0f ) + c > 0x0f ; self . flags . c = u16 :: from ( a ) + u16 :: from ( n ) + u16 :: from ( c ) > 0xff ; self . registers . a = r ; }
ADD register or memory to Accumulator with carry
ADD register or memory to Accumulator with carry
&mut self
n
u8
&mut self
n
u8