Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

MULS Rd,Rr

R1:R0 = Rd × Rr (signed = signed × signed)

16 <= d <= 31, 16 <= r <= 31

PC = PC + 1

00000010ddddrrrr

Description

This instruction performs 8-bit × 8-bit -> 16-bit signed multiplication.

Rd

Rr

R1

R0

×

->

Product High

Product Low

Multiplicand

Multiplier

8

8

16

The multiplicand Rd and the multiplier Rr are two registers containing signed numbers. The 16-bit signed product is placed in R1 (high byte) and R0 (low byte).

This instruction is not available on all devices. Refer to Appendix A.

Status Register (SREG) and Boolean Formula

I

T

H

S

V

N

Z

~R15 AND ~R14 AND ~R13 AND ~R12 AND ~R11 AND ~R10 AND ~R9 AND ~R8 ANDR7 AND ~R6 AND ~R5 AND ~R4 AND ~R3 AND ~R2 AND ~R1 AND ~R0

Set if the result is 0x0000; cleared otherwise.

C

R15

R (Result)

R (Result) equals R1,R0 after the operation.

Example:

      muls  r21,r20  ; Multiply signed r21 and r20
      movw  r20,r0   ; Copy result back in r21:r20

Words

1 (2 bytes)

Table Cycles

Name

Cycles

AVRe

2

AVRxm

2

AVRxt

2

AVRrc

N/A