Hi Scott. What range is original X and Y ? 8 bits ( byte ) ? What range is result ? Byte as well ? More clarity is required ;) WBR Dmitry. -----Original Message----- From: Scott Dattalo To: PICLIST@MITVMA.MIT.EDU Date: Tue, 25 Sep 2001 22:01:24 -0700 Subject: Challenge: Shifting by a variable amount > > In C: > > unsigned char x; > unsigned char y; > > ... > > x <<= y; > > How would you do this in PIC assembly? > > This has been discussed here before (but I couldn't find it in the > archives) and IIRC a 12 cycle solution was found (by Dmitry?). I've got a > 12-cycle solution, but thought it would be interesting to propose this as > a challenge. (The winner may simply find the answer in the archives :). > > Scott > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.