http://www.piclist.com/faq click on routines in the resources section and then scroll down to conditionals (just under math) I'm really trying to get everything in the FAQ. Please let me know what I'm missing. --- James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 http://techref.massmind.org NEW! FINALLY A REAL NAME! Members can add private/public comments/pages ($0 TANSTAAFL web hosting) -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Martin McCormick Sent: Tuesday, February 22, 2000 14:27 To: PICLIST@MITVMA.MIT.EDU Subject: > < Problems I have been on this list for about 6 years, I think, and am working on my first actual PIC program. One of the things I discovered that kind of surprised me was the lack of any instructions that can test to see if some value is => or < some other value. Testing to see if 2 values are exactly equal is easy with the xorwf instruction because the result is 0 if the two values are the same. It finally hit me that what I could do is to take the value I am testing against, get the 2's compliment by xorwf'ing it with 0xff and then adding 1, and then taking that value to add to the unknown value to see if the carry sets. If it sets, the unknown value was = or > the test value. This works fine, but am I missing something more simple? My previous assembler coding has been in the Motorola 68HC11, 8086, and 6502 assemblers. There are instructions that branch on carry set or clear and the status of the Z flag as well as some branches that work on signed arithmetic and others that work on unsigned values. I realized that the PIC instructions do exactly the same thing, but the details are more visible. There is nothing like actually getting in there and designing a project to let one really learn the instruction set. Martin McCormick WB5AGZ Stillwater, OK OSU Center for Computing and Information Services Data Communications Group