8x8 bit multiplication, with 8-bit result.
- Parameters
-
i | first byte to multiply |
j | second byte to multiply |
- Returns
- the product of i * j
- Note
- This does not saturate and may overflow!
Definition at line 462 of file math8.h.
462 {
463#if MUL8_C == 1
464 return ((int)i * (int)(j)) & 0xFF;
465#elif MUL8_AVRASM == 1
466 asm volatile(
467
468 "mul %0, %1 \n\t"
469
470 "mov %0, r0 \n\t"
471
472 "clr __zero_reg__ \n\t"
473 : "+r"(i)
474 : "r"(j)
475 : "r0", "r1");
476 return i;
477#else
478#error "No implementation for mul8 available."
479#endif
480}
References LIB8STATIC_ALWAYS_INLINE.