Mark Jurras wrote: >I am using a pic 16c73 to read a Maxim 12-bit A/D. I am looking for a >compact routine to determine if the 16-bit word stored, high byte low byte, >is greater than a stored maximum or less than a stored minimum. Hi Mark, First, a compare macro: ;Compare_word compares two words and exits with carry set if ;the first is equal to or greater than the second. compare_word: macro aaa, bbb local exit movf (bbb), w subwf (aaa), w btfss STATUS, Z goto exit movf (bbb + 1), w subwf (aaa + 1), w exit: endm Now suppose that you have three register pairs - max, min, temp arranged high byte, low byte. Then: compare max, temp bc temp_gtn_max compare temp, min bnc temp_ltn_min -- Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com