The 8051 family of microcontrollers has a very useful assembly instruction RRC. This instruction rotates carry into the MSB of the given register, shifts that register right by 1, and carry becomes equal to what used to be the LSB of the register.
bit NewCarry; unsigned char Data; NewCarry = Data & 0x01; Data = (Data >> 1); if (Carry){ Data = (Data | 0x80); } Carry = NewCarry;
would be the ability to compile .asm functions inline Whaddayamean "would be"? This ability exists. In a way so clumsy that I agree "this function does not exist" Erik
If I did use CY = Portpin, I would check the compiled assembly for side-affects. As for the inline assembly compiling thing, I will look into that more. Thanks for your help everyone ! -Tom