You probably won't gain too much my looking at the assembly of C output since there are multiply and divide instructions for x86.
Say you have your values you wish to multiply together in two registers (R1 & R2), you will simply need to add the value within R1 R2 times.
I.E. 2 * 3 = 2 + 2 + 2
Since i don't know MCU I'll use pseudocode
Code:
//R1 * R2 -> R3
MOV 0 to R3 //clears R3
TEST R1 //set condition codes for R1 -- ADD 0 to R1 would also work
Branch on zero to End:
TEST R2 //set condition codes for R2 -- ADD 0 to R2 would also work
Branch on zero to End:
MUL:
ADD R1 to R3
ADD -1 to R2
Branch on zero flag to End // done
Branch Unconditionally to MUL: //continue adding
End:
//R3 now contains the result
Integer division would be similar, but a little more complicated. Hope that helps.
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum