Carole To wrote: >=20 > [PIC]:Hi , I'd like to make an operation on a 16-bit data (like an = addwf)in > assembler > I was wondering if this could be possible since the registers in th= e 16c717 > are 8-bit wide. > So my question is : how can I make an operation on a 16-bit data( w= ith the > MSB and LSB) and then separate the 8 MSB datas and the 8 LSB datas = so that I > can store them in the SSPBUF register on the I=B2C bus? > Thanks >=20 =09movf ByteL,W=09=09; low byte of 16 bit value =09addwf ResultL=09=09; add it to low result =09btfsc STATUS,C=09=09; increment high result if carry set =09incf ResultH =09movf ByteH,W=09=09; high byte of 16 but value =09addwf ResultH=09=09; add it to high result =09movf ResultH,W=09=09; send high result =09call SendToI2C =09movf ResultL,W=09=09; send low result =09call SendToI2C --=20 Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.