Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

MUL Rd,Rr

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

0 <= d <= 31, 0 <= r <= 31

PC = PC + 1

100111rdddddrrrr

Description

This instruction performs 8-bit × 8-bit -> 16-bit unsigned 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 unsigned numbers. The 16-bit unsigned product is placed in R1 (high byte) and R0 (low byte). Note that if the multiplicand or the multiplier is selected from R0 or R1, the result will overwrite those after multiplication.

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:

      mul   r5,r4   ; Multiply unsigned r5 and r4
      movw  r4,r0   ; Copy result back in r5:r4

Words

1 (2 bytes)

Table Cycles

Name

Cycles

AVRe

2

AVRxm

2

AVRxt

2

AVRrc

N/A