wouter van ooijen wrote: >>its peculiar instructions, I ended up with a "integer >>constant parser" >>which was able to generate the lowest possible number of >>instructions to >>express it (using Shifts etc). > > Why would a compiler want to do that, for speed? For size 1 instruction > + 1 PC-relative-adressable constant is enough! Well, now I don't remember the exact reasons, but: (I still have the sources!) more or less, since the 32bit Op-Code could handle only some limited Constant Value in its fields, say 10 bits (i.e. max = 1023), but there was also a "Shift" field, say up to 8, you could sayt that: * for numbers below 1023, use MOV D0,#number,Shift=0 * for numbers >= 1024 but with zero bits in the lowest positions and a total amount of significative bits still <= 10, use MOV D0,#number,Shift=shift * for other numbers >= 1024 , MOV D0,#(number & 1023),Shift=0 .. ADD DO,#(number >> 10),Shift=shift -- Ciao, Dario -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist