4.1 Example 5 – Basic Usage 8-bit x 8-bit = 16-bit Signed Fractional Multiply
This example shows an assembly code that reads the port B input value and multiplies this value with a fractional constant (-0.625) before storing the result in register pair R17:R16.
in r16,PINB ; Read pin values ldi r17,$B0 ; Load -0.625 into r17 fmuls r16,r17 ; r1:r0 = r17 * r16 movw r17:r16,r1:r0 ; Move the result to the r17:r16 register pair
Note that the usage of the FMULS (and FMUL) instructions is very similar to the usage of the MULS and MUL instructions.