On Mon, 3 Jun 2002, Dmitriy A. Kiryashov wrote: > 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 ? > How about: sdcc -S -mpic14 c.c ... ;; Unrolled 8 X 8 multiplication ;#CSRC c.c 71 ; achar0 = achar0*2 + 1; MOVF _achar0,W ;key=000,flow seq=001 MOVWF r0x20 ;key=001,flow seq=001 ADDWF r0x20,F ;key=002,flow seq=001 CLRF r0x21 ;key=003,flow seq=001 RLF r0x21,F ;key=004,flow seq=001 INCF r0x20,W ;key=005,flow seq=001 MOVWF _achar0 ;key=006,flow seq=001 I think I hate C compilers. :) -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body