Herbert Graf wrote: > I am a little confused about these two instructions. I know what > they do, but my confusion is in the handling of the carry flag. The > manual says shift through carry, which I interperate to meaning > that if bit 7 is set and you RLF the carry flag is set. But when I > read the MPASM manual it has a diagram that suggests if you set the > carry flag and RLF bit0 of the file register is set, is this what > happens? It would be very usefull for my purposes if this is how it > worked. Herbert: That's how it works. The manual doesn't actually say, "shift through carry"; it says "ROTATE through carry"... The carry gets shifted in at one end of the register, each bit in the register is shifted over, and the bit that gets shifted out of the register goes into the carry: RLF (Rotate Left through carry): _______ | | +-------------------------> | Carry | --------------------------+ | |_______| | | ______ ______ ______ ______ ______ ______ ______ ______ | | | | | | | | | | | | +-- | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 | <-+ |______|______|______|______|______|______|______|______| RRF (Rotate Right through carry): _______ | | +-------------------------- | Carry | <-------------------------+ | |_______| | | ______ ______ ______ ______ ______ ______ ______ ______ | | | | | | | | | | | | +-> | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 | --+ |______|______|______|______|______|______|______|______| -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499