[Coco] Clearing condition code register

KnudsenMJ at aol.com KnudsenMJ at aol.com
Mon Mar 28 21:45:51 EST 2005


 
In a message dated 3/27/05 3:17:47 PM Eastern Standard Time,  
jdaggett at gate.net writes:

>The  COM instruction will always set the Carry bit. The NEG will set 
>the  carry bit if there is a borrow, otherwise it is  cleared.



Are you sure?  ISTR that the COM instruction just inverts all the  bits, and 
should never set the Carry or Overflow bits.  
 
NEG does a COM and then adds 1, which will set the Carry bit if the  register 
was 0 or held the largest negative number (which has no positive  
representation).
 
But if you've got the 6809 manual handy, then you're right.  --Mike  K.
 



More information about the Coco mailing list