here is that code fragment. Not the mose efficent way, etc. but a way. Anyway. replacing the 'clrc' with 'nop' caused it to not work - hence I inserted the clrc bits. And I did try with nops just to make sure about paging issues weren't clouding the issue, etc. Doing a similar thing, but adding a negative number rather than subtracting a positive one, worked okay. The program measures a voltage on the A2D and makes a decision based upon which window it lands in. clrc movlw .143 ; 2.25V input threshold subwf ADRESH,w skpc goto result_c ; = below 2.25v clrc movlw .175 ; 2.75V input threshold subwf ADRESH,w skpc goto result_b ; = between 2.25v and 2.75v, i.e. 2.5 Volts clrc movlw .207 ; 3.25V input threshold subwf ADRESH,w skpc goto result_a ; = between 2.75v and 3.25v, i.e. 3.0 Volts ----- Original Message ----- From: "David Cary" To: Sent: Friday, May 18, 2001 5:39 PM Subject: Re: [EE]: carry result: Robin Abbott > Bob Ammerman on 2001-05-18 08:57:36 AM claimed > >The value of carry at the start of the SUBWF instruction isn't applicable at > >all! > > > >The SUBWF instruction _always_ either sets or clears carry. It _never_ > >leaves carry unchanged. > > Yes, that's what all the data sheets say. > > Kevin, would you mind giving us some code that demonstrates your PIC acting > wierd ? That would make it easier for us to confirm it. > > -- > David Cary > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu