On Thu, 16 May 2019, Dwayne Reid wrote: > Hi there, Mike. > > I think your routine is brilliant! I'm not seeing any flaws and I'll > give it a try tomorrow. > > Many thanks! > > dwayne > > > At 01:34 AM 5/16/2019, Mike Rigby-Jones wrote: >> We've not had a coding challenge in ages, I really miss those days! I'v= e >> not used PIC assembler for a long time so I'm pretty rusty, so there may= be >> a bonehead mistake in this: >> >> ; Input in ACC0 >> ; 12 cycles, no temp variables >> >> clrf ACC1 ; Clear MSB >> movf ACC0,w ; save ACC0 in w >> clrc >> rlf ACC0,f >> rlf ACC1,f >> rlf ACC0,f >> rlf ACC1,f >> rlf ACC0,f >> rlf ACC1,f ; ACC1:ACC0 =3D 8 * input >> addwf ACC1,f ; C + ACC1:ACC0 =3D 264 * input >> rrf ACC1,f >> rrf ACC0,f ; ACC1:ACC0 =3D 132 * input >> Not wishing to steal any thunder from Mike's great bit of code but I=20 thought I'd mention that with a tiny extension this can be made to=20 multiply by 133 addwf ACC0,f ; ACC0 =3D 133 * input btfsc STATUS,C incf ACC1,f ; ACC1:ACC0 =3D 133 * input Regards Sergio --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .