if i read it correctly you want to know this. if (17.0 <= x ) and ( x <= 19.6 ) then TRUE else FALSE movf MSB,w sublw .16 ; 16 - MSB = ? btfsc status,c goto return_false ; MSB is 16 or less movf MSB,w sublw .19 ; 19 - MSB btfss status,c goto return_false ; MSB it greater than 19 btfss status,z goto return_true movf LSB,w sublw .6 ; 6 - LSB btfss status,c goto return_false goto return_true this code is not debugged (and assume it's buggy) but will give you an idea of how to start. michael You may leave the list at any time by writing "SIGNOFF PICLIST" in the body of a message to LISTSERV@MITVMA.MIT.EDU. -----Original Message----- From: Mauro Costa Sollar To: PICLIST@MITVMA.MIT.EDU Date: Thursday, October 01, 1998 2:10 PM Subject: how to compare number - (DS1624) >Hi All, > > i'm working with the sensor of temperature DS1624 (I2C), >it me return 2 bytes MSB=data integer and LSB=data decimal, how to >compare this data with one table of temperature range, or where find >routines of this type. > >Ex.: the data sensor is: 18,5 > > > my table: 15,2 to 16,9 > 17,0 to 19,6 item is true (on range of 18,5) > 19,7 to 22,2 > > >thanks, > >Mauro Costa Sollar >