Oh well, I was just trying to make a point and that code had the different things I wanted to point out. But then, that's what disclaimers are for. Al Williams AWC * Floating point A/D http://www.al-williams.com/awce/pak9.htm > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Scott Dattalo > Sent: Friday, March 29, 2002 8:44 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: RE: Macro or Goto > > > On Fri, 29 Mar 2002, Al Williams wrote: > > > So for example, suppose you want to multiply num by 10 (perhaps not > > the best way to do it, but that's OK; and from memory, so maybe not > > exactly right even): > > > > X10: bcf status,c > > rlf num,f > > movf num,w ; w=num*2 > > bcf status,c > > rlf num,f > > bcf status,c > > rlf num,f ; num=num*8 > > addwf num,f ; num = num*2 + num*8 = 10*num > > return > > You're right, it's not the best way. This way is better: > > X10: > > movf num,w ; w = num > addwf num,f ;num = 2*num > addwf num,w ; w = 3*num > addwf num,f ;num = 5*num > movf num,w ; w = 5*num > addwf num,f ;num = 10*num > > > :) > > -- > http://www.piclist.com hint: The list server can filter out > subtopics (like ads or off topics) for you. See > http://www.piclist.com/#topics > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics