This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811840-1222360292-1140726990=:14222 Content-Type: TEXT/PLAIN; CHARSET=X-UNKNOWN; FORMAT=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by pch.mit.edu id k1NLL5gS003784 On Thu, 23 Feb 2006, [ISO-8859-2] J=E1hn Bal=E1zs wrote: > Bob Axtell wrote: > >> Another way to ask this question is to ask for an >> '8-bit BIN to DEC' converter. > > I wasn't carefull, and I don't tell everything sorry. > > In my variable there are only 00h-63h (0d-99d). And I want divide it b= y > 10... I tought there is a very simple method, but I don't know it. N/10 =3D N/8 - N/32 + N/128 ; untested code, isochronous, 13 clocks (11 if FN_GT_127 is ; undefined) ; input is Fn, output is Fy, Fn emerges divided by four swapf Fn,w ; W =3D Fn/16 andlw 0x0F movwf Fy ; Fy =3D N/16 rrf Fy,f ; Fy =3D N/32 comf Fy,f incf Fy,f ; Fy =3D - N/32 #ifdef FN_GT_127 btfsc Fn,7 incf Fy,f ; Fy =3D - Fn/32 + Fn/128 #endif rrf Fn,f rrf Fn,f rrf Fn,w andlw 0x1F ; W =3D Fn/8 addwf Fy,f ; Fy =3D Fn/8 - Fn/32 + Fn/128 I am sure that one of the geniuses will optimize this. Peter ---1463811840-1222360292-1140726990=:14222 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ---1463811840-1222360292-1140726990=:14222--