On Fri, 29 Sep 2000, j newton wrote: > Ok, I have a code challenge... > > On a 16C5x (ok, actually an SX), I have a value in W and a value in a > register (call it fr), and I need to subtract W + 1 from the value of fr and > not put the result in fr. I.e. I need to find out if fr > w or maybe fr <= w > with out destroying fr. Munching W is, of course, ok. ;------------------- ; ; fr > W subwf fr,W skpnc skpnz goto fr_is_less_than_or_equal_to_W fr_is_greater_than_W If you subtract W from fr, then the Carry flag will be set and the Zero flag cleared when fr is greater than W. Is that what you want? Scott -- http://www.piclist.com hint: PICList Posts must start with ONE topic: "[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's