>Howdy! > >I have not actually tried to complement the C bit directly in a PIC. >However, based on this discuession I took a careful look at the docs, and >they seem to imply that: > >> movlw 1 >> xorlw STATUS, F > >WILL NOT WORK. I guess the simulator in MPLAB has a bug in this regard, or >is an undocumented feature? In "Programming and Customizing the PIC Microcontroller", I made this mistake in one of the early experiments that show how the different instructions change the STATUS Register. The MS-DOS Command Line "MPSIM" that is supplied with the book will allow the status register to be updated in this case. The simulators available from Microchip (and others?) are definitely spotty in this regard. Some do work correctly and some don't. In the actual PICMicro hardware themselves, having the STATUS Register the destination of an arithmetic or bitwise operation will not set the Carry, Digit Carry or Zero Flag as you would expect. Instead, for the sequence above, you would have to use: movlw 1 xorwf STATUS, w movwf STATUS myke Jeffrey Deaver has brought back Lincoln Rhymes and Amelia Sachs in "The Coffin Dancer": this week's book at: http://www.myke.com/Book_Room/book1a.htm Also look at: http://www.myke.com/My_Books/homcu.htm for information on "Handbook of Microcontrollers" which has been named the Main Selection for November 1998 for the Electronics Book Club!