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 446 of file math8.h.
446 {
447#if MUL8_C == 1
448 return ((int)i * (int)(j)) & 0xFF;
449#elif MUL8_AVRASM == 1
450 asm volatile(
451
452 "mul %0, %1 \n\t"
453
454 "mov %0, r0 \n\t"
455
456 "clr __zero_reg__ \n\t"
457 : "+r"(i)
458 : "r"(j)
459 : "r0", "r1");
460 return i;
461#else
462#error "No implementation for mul8 available."
463#endif
464}
References LIB8STATIC_ALWAYS_INLINE.