Hi, replies from the 'masters' :) well well.. Scott Dattalo wrote: >I just so happen to know that Nikolai is away from his computer at the moment... > >The following section may be shortened slightly in one of two ways: > > rlf known_zero,w ;a trick learned from payson > addwf Product+2,f > rlf known_zero,w > addwf Product+1,f > rlf known_zero,w > addwf Product+0,f Yes I know he is away, still his was kind enough to reply to an e-mail of mine prior to posting this ( asked if he had any objections/suggestions, = which he did not have ). And yes the 'known zero' trick, I observed that on some code snippets on the faq site, very clever, but it's 'harder' to understand the effect = at first sight. Therefore to make the code somewhat easier to read I normally leave out such optimisations ( until I really need them :) ). But You are correct ofcource. However this one: > skpnc > incf Product+2,f > skpnc > incf Product+1,f > skpnc > incf Product+0,f Will not work. Carry not affected by INCF. ( also noted by Bob Ammerman ) >Thanks for posting this , Tony If it wasn't for the *active* on this list I would still be trying to turn on the darn LED :). Bob Ammerman wrote: >This looks real good. I especially like the four instruction snippet: > >movf ,W >skpnc >incfsz ,W >addwf ,F > >As a slick way to do handle carries in an N-byte multiple precision add. If >this trick is well-known, it has somehow escaped me. [James: how about a >section on N-byte arithmetic in the code snippets archive?] Where do you think I got that from :), i.e. I take NO credit from that part, someone else already thought of it ( Payson ? ). >I don't understand how this can be true when all accesses to RAM are byte >wide and indeed the individual bytes of each value can be anywhere in memory >with no change in performance. Neither do I, but other people has suggested from time to time that ( according to their expirience ) big endian can 'save' a few cycles. For example Nikolai's code generator will have an variance of a few cycles depending on big or little endian, I dont know why but I does. ( that's the one with constant multiplication ) I'll let it rest, no flames please. ( should have left that part out :) ) /Tony Tony K=FCbek, Flintab AB = =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2 E-mail: tony.kubek@flintab.com =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: "[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads