Multiplying in Assembly

dsptl's Avatar, Join Date: Jun 2009
Light Poster
How can you multiply the content of register %o0 by 15 without calling .mul or ading %o0 to itself 15 times in Assembly?
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Shift it left 4 times (equivalent to multiplying by 16) and subtract the original value.

0x0012 << 4 = 0x0120
0x0120-0x0012=0x010e=0x0012*0x000f

Last edited by xpi0t0s; 2Jul2009 at 15:09..