Not using w or any other register except X. Only works for X<=0x7f unsigned. bsf STATUS,CARRY rlf x,f Since 2X always gives an even result (bit 0=0), setting CY to 1 before rlf has the effect of adding 1 to the result. Ruben > Hi guys. Here is tiny challendge to warm up. ;) > > We have X variable. What is shortest possible > code to obtain 2X + 1 result back into X cell ? > > WBR Dmitry. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > ============================== Ruben Jvnsson AB Liros Electronic Box 9124, 200 39 Malmv, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se ============================== -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.