Woops no z should have been x on bottom line -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Steve Smith Sent: 24 October 2003 17:03 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: how to compare to numbers Well it works something like this x-y=w with flags set clrc ; ensure carry is empty before starting movlw x ; grab first number (maybe from file) subwf y,w ; subtract from second number (result in w (w trashed)) btfsc status,z ; test for the same goto x=y ; do same result btfsc status,c ; test which is bigger goto x>y ; do result goto y>z -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Luis Moreira Sent: 24 October 2003 16:15 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: how to compare to numbers Hello Guys I need to compare to numbers to see which of them is higher can someone point me on the right direction? Thanks Luis -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads