> In that case, one could argue it should be part of compiler's output itself 
> (like x / 2 <=> x >> 1)

The compiler does that already... To multiply x by ten and store the result in 
y, you can

y=x*10

Is great if the pic has a hardware multiplier. But if it hasn't, and x is a 
large variable, this one could be better:

y=x*2+x*8

Or even 

y=x*2
y=y+y*4

as it saves a shift operation. 

Or

y=x*2
y=y+x*8

as it might save an internal temp variable. 
If x may be modified...

x=x*2
y=x
x=x*4
y=y+x

might be the best solution, as it probably uses the least shift operations and 
no temp variables.

It is JAL, and it is optimized for smaller PICs, but not really more readable 
as the same in asm (both have to be explained in comments anyway).

Err... What was the point I was talking about? Perhaps there wasn't one. Sorry 
:-D

Greets,
Kiste

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to