4.6 Instruction Descriptions (E to MULUU)

EDSubtract and Square to Accumulator 
(Partial Euclidean Distance)
Syntax: {label}ED{.w} Wx, Wy,A{,AWB}
ED.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]4}

Operation:((Wx) - (Wy))2 → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modified Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110110ALwwwwssssIIIiiJJJjjaaa011
Description:Instruction to compute (A-B)2 functions. Signed or unsigned (defined by CORCON.US) subtract then square of data concurrently read from Wx and Wy or fetched from X and Y address space (see note 3). The result is sign-extended or zero-extended to 72-bits then written to the specified accumulator. Fractional results are also scaled prior to the accumulator update to align the operand and accumulator (msw) fractional points.

When indirect addressing is selected for either or both X and Y address space, the Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address.

The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the ED operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 5). AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. Operands are always regarded as signed or unsigned based on the state of CORCON.US.
  3. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  4. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:2
EDACSubtract, Square and Accumulate (Euclidean Distance)
Syntax: {label}EDAC{.w} Wx, Wy,A{,AWB}
EDAC.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]4}

Operation:ACC(A or B) + ((Wx) - (Wy))2 → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modification Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110110ALwwwwssssIIIiiJJJjjaaa111
Description:Instruction to compute (A-B)2 functions. Signed or unsigned (defined by CORCON.US) subtract then square of data read from Wx and Wy or concurrently fetched from the X and Y address space. The result is sign-extended or zero-extended to 72-bits and then added to the specified accumulator. Fractional or integer operation (defined by CORCON.IF) will determine if the result is scaled or not prior to the accumulator update. Fractional operation will scale the result to align the operand and accumulator (msw) fractional points (see note 3). Integer operation will align the LSb of the result with the LSb of the accumulator.

When indirect addressing is selected for either or both X and Y address space, the Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data words by which to modify the Effective Address.

The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the EDAC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 5). AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register.

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. Operands are always regarded as signed or unsigned based on the state of CORCON.US.
  3. The LS portion of ACCx is unaffected when operating in Fractional mode with word sized data. Lower significance data that may be present from prior (32-bit data) operations is therefore preserved. Users not requiring this should clear ACCx during initialization.
  4. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  5. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:2
EXCHExchange Ws and Wd
Syntax:{label:}EXCHWns,Wnd
Operands:Wns ∈ [W0 ... W15]; Wnd ∈ [W0 ... W15]
Operation:(Wns) ↔ (Wnd)
Status Affected:None
Encoding:1000001UddddssssUUUUUUUUUUUU0100
Description:This instruction exchanges the contents of two Working registers and is a two cycle operation. In cycle one, Wnd is read and moved to Wns. In cycle two, Wns is read and moved to Wnd.

The ‘s’ bits select the Wns register.

The ‘d’ bits select the Wnd register.

Note:
  1. Opcode shared with MOV (32-bit variant) using sub-opcode.
  2. Long word operation is assumed.
  3. Although operand order has no effect on final outcome, it could influence the detection of hazards because operands are read in different cycles.
I-Words:1
Cycles:2
FBCLFind First Bit Change from Left
Syntax:{label:}FBCL{.w}Ws,Wnd
FBCL.l[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation:See description
Status Affected:C
Encoding:1110011LddddsssspppUUUUUUUUU1011
Description:Finds the first occurrence of a one (for a positive signed value) or zero (for a negative signed value) starting from the next MSb after the Sign bit working towards the LSb of the word operand. The bit number is sign-extended to 32-bits and is written to the destination register.

The next MSb after the Sign bit is assigned number zero. For a word operation, the LSb number is assigned -14 and a result of -15 (C=1) indicates that the bit was not found. For a long word operation, the LSb number is assigned -30 and a result of -31 (C=1) indicates that the bit was not found.

C is cleared for all non-zero results.


The ‘L’ bit selects word or long word operation.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

See and for modifier addressing information.

Note: This instruction only operates in Word and Long Word mode.
I-Words:1
Cycles:1

Example 1:

FBCL  W1, W9; Find 1st bit change from left in W1; and store result to W9

Before Instruction

After Instruction

W1

55FF

W1

55FF

W9

FFFF

W9

0000

SR

0000

SR

0000

Example 2:

FBCL  W1, W9; Find 1st bit change from left in W1; and store result to W9

Before Instruction

After Instruction

W1

FFFF

W1

FFFF

W9

BBBB

W9

FFF1

SR

0000

SR

0001

(C = 1)

Example 3:

FBCL  [W1++], W9; Find 1st bit change from left in [W1] ; and store result to W9; Post-increment W1

Before

Instruction

After

Instruction

W1

2000

W1

2002

W9

BBBB

W9

FFF9

Data 2000

FF0A

Data 2000

FF0A

SR

0000

SR

0000

FF1LFind First One from Left
Syntax:{label:}FF1L{.w}Ws,Wnd
FF1L.l[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation: See description
Status Affected:C
Encoding:1110011LddddsssspppUUUUUUUUU0011
Description:Finds the first occurrence of a one starting from the MSb working towards the LSb of the word operand. The bit number result is zero-extended to 32-bits and is written to the destination register.

The MSb is assigned number one. For a word operation, the LSb number is assigned 16, and a result of zero (C=1) indicates that the bit was not found. For a long word operation, the LSb number is assigned 32 and a result of zero (C=1) indicates that the bit was not found.

C is cleared for all non-zero results.

The ‘L’ bit selects word or long word operation.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note: This instruction only operates in word and long word mode.
I-Words:1
Cycles:1

Example 1:

FF1L  W2, W5   ; Find the 1st one from the left in W2   ; and store result to W5

Before Instruction

After Instruction

W2

000A

W2

000A

W5

BBBB

W5

000D

SR

0000

SR

0000

Example 2:

FF1L  [W2++], W5 ; Find the 1st one from the left in [W2] ; and store the result to W5 ; Post-increment W2

Before Instruction

After Instruction

W2

2000

W2

2002

W5

BBBB

W5

0000

Data 2000

0000

Data 2000

0000

SR

0000

SR

0001

(C = 1)

FF1RFind First One from Right
Syntax:{label:}FF1R{.w}Ws,Wnd
FF1R.l[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation: See description
Status Affected:C
Encoding:1110011LddddsssspppUUUUUUUUU0111
Description:Finds the first occurrence of a one starting from the LSb working towards the MSb of the word operand. The bit number result is zero-extended to 32-bits and is written to the destination register.

The LSb is assigned number one. For a word operation, the MSb number is assigned 16, and a result of zero (C=1) indicates that the bit was not found. For a long word operation, the MSb number is assigned 32 and a result of zero (C=1) indicates that the bit was not found.

C is cleared for all non-zero results.

The ‘L’ bit selects word or long word operation.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note: This instruction only operates in word and long word mode.
I-Words:1
Cycles:1

Example 1:

FF1R  W1, W9 ; Find the 1st one from the right in W1 ; and store the result to W9

Before Instruction

After Instruction

W1

000A

W1

000A

W9

BBBB

W9

0002

SR

0000

SR

0000

Example 2:

FF1R  [W1++], W9 ; Find the 1st one from the right in [W1] ; and store the result to W9 ; Post-increment W1

Before Instruction

After Instruction

W1

2000

W1

2002

W9

BBBB

W9

0010

Data 2000

8000

Data 2000

8000

SR

0000

SR

0000

FLIMForce (Signed) Data Range Limit
Syntax:{label:}FLIM{.w}Wb,Ws,
FLIM.l[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W14]; Wb ∈ [W0 ... W13];
Operation:IF (Ws) > (Wb) THEN {
 (Wb) → (Ws);

0→ Z; 0→ N; 0→ OV

}

ELSE IF (Ws) < (Wb+1) THEN {
 (Wb+1) → Ws;

0→ Z; 1→ N; 0→ OV
}
ELSE {
 (Ws) → Ws4;

1→ Z; 0→ N; 0→ OV

}

Status Affected:N, Z, OV
Encoding:1110010LUUUUsssspppUUUwwwwUU0011
Description:Simultaneously compare any size of signed data value in Ws to a maximum signed limit value held in Wb and a minimum signed limit value held in Wb+1.

For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are updated such that a subsequent BGT instruction will take a branch.

For long word data size, if Ws[31:0] is less than Wb+1[31:0], set Ws[31:0] to the limit value held in Wb+1[31:0]. For word data sizes, if Ws[15:0] is less than Wb+1[15:0], set Ws[15:0] to the limit value held in Wb+1[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are updated such that a subsequent BLT instruction will take a branch.

If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0], and greater than or equal to the minimum limit value in Wb+1[31:0] (for long word sized data), or Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] and greater than or equal to the minimum limit value in Wb+1[15:0] (for word sized data), neither data limit is applied such that the contents of Ws will not change (for the given data size). The Z status bit is set such that a subsequent BZ instruction will take a branch (OV and N status are both cleared).

For word sized register direct operations, Ws is always 0 extended to 32-bits (even if neither of the data limits are applied)4.

Note that the instruction always executes the maximum compare first. Should Ws be less than the maximum, it will then execute the minumum compare, and if Ws is found to be not less than the minimum, Ws will remain unchanged.

Furthermore, should the (maximum) limit value Wb be inadvertently set to less than or equal to the (minimum) limit value Wb+1, the same compare sequence will still be executed. This condition is not detected.

The OV status bit is always cleared by this instruction.

The ‘s’ bits select the source (data value) register.

The ‘w’ bits select the base (data limit) register.

The ‘p’ bits select the source addressing mode.

Note:
  1. Although the instruction assumes signed values for all operands, both upper and lower limit values may be of the same sign.
  2. The status bits are set based upon the data compare result.
  3. Word data FLIM{.w} writes to Ws are zero extended to 32-bits.
  4. Zero extension to 32-bits is consistent with any register direct word write. However, the potential for a RAW hazard from the Ws write therefore always exists, even if the limit is not exceeded.
I-Words:1
Cycles:1
FLIMForce (Signed) Data Range Limit with Limit Excess Result
Syntax:{label:}FLIM{.w}{v} Wb,Ws,Wd
FLIM.l{v}[Ws],[Wd]
[Ws++],[Wd++]
[Ws--],[Wd--]
[++Ws],[++Wd]
[--Ws],[--Wd]
Operands:Ws ∈ [W0 ... W14]; Wb ∈ [W0 ... W13]; Wnd ∈ [W0 ... W14]
Operation:IF (Ws) > (Wb) THEN (
 IF FLIM.v THEN (Ws) - (Wb) → Wnd
 ELSE +1 → Wnd;
 (Wb) → (Ws);

0→ Z; 0→ N; 0→ OV;

)

ELSE IF (Ws) < (Wb+1) THEN (
 IF FLIM.v THEN (Ws) - (Wb+1) → Wnd
 ELSE -1 → Wnd;
 (Wb+1) → Ws;

0→ Z; 1→ N; 0→ OV;
)
ELSE (

0 → Wnd;

(Ws) → Ws4;

1→ Z; 0→ N; 0→ OV;

)

Status Affected:N, Z, OV
Encoding:1110010LddddsssspppqqqwwwwUV0111
Description:Simultaneously compare any size of signed data value in Ws to a maximum signed limit value held in Wb and a minimum signed limit value held in Wb+1. Write a limit excess value into Wnd.

For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored).

In all cases, write the (signed) value by which the limit is exceeded to Wnd[31:0] (FLIM.v, where opcode bit field V = 1) or set Wnd to +1 (FLIM, where opcode bit field V = 0). Whenever Ws is greater than Wb, Wnd will always be a positive value. The Z, N and OV status bits are updated such that a subsequent BGT instruction will take a branch.

For long word data size, if Ws[31:0] is less than Wb+1[31:0], set Ws[31:0] to the limit value held in Wb+1[31:0]. For word data sizes, if Ws[15:0] is less than Wb+1[15:0], set Ws[15:0] to the limit value held in Wb+1[15:0] (Ws[31:16] is ignored). In all cases, write the (signed) value by which the limit is exceeded to Wnd[31:0] (FLIM.v, where opcode bit field V = 1) or set Wnd to +1 (FLIM, where opcode bit field V = 0). Whenever Ws is less than Wb+1, Wnd will always be a negative value. The Z, N and OV status bits are updated such that a subsequent BLT instruction will take a branch.

If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0] and greater than or equal to the minimum limit value in Wb+1[31:0] (for long word sized data), or Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] and greater than or equal to the minimum limit value in Wb+1[15:0] (for word sized data), neither data limit is applied such that contents of Ws will not change (for the given data size). The Z status bit is set such that a subsequent BZ instruction will take a branch (OV and N status are both cleared).

For word sized register direct operations, Ws is always zero extended to 32-bits (even if neither of the data limits are applied)4.

Note that the instruction always executes the maximum compare first. Should Ws be less than the maximum, it will then execute the minimum compare, and if Ws is found to be not less than the minimum, Ws will remain unchanged.
Furthermore, should the (maximum) limit value Wb be inadvertently set to less than or equal to the (minimum) limit value Wb+1, the same compare sequence will still be executed. This condition is not detected.

The OV status bit is always cleared by this instruction.

The ‘s’ bits select the source (data value) register.

The ‘w’ bits select the base (data limit) register.

The ‘d’ bits select the destination (limit test result) register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

The ‘V’ bit selects the result format for Wnd.

See for modifier addressing information.

Note:
  1. Although the instruction assumes signed values for all operands, both upper and lower limit values may be of the same sign.
  2. The status bits are set based upon the value loaded into Wnd.
  3. Word data FLIM{.w} writes to Ws (and FLIM{.w}v writes to Wnd) are zero extended to 32-bits.
  4. Zero extension to 32-bits is consistent with any register direct word write. However, the potential for a RAW hazard from the Ws write therefore always exists, even if the limit is not exceeded.
  5. Ws and Wd cannot be the same register.
I-Words:1
Cycles:2
GOTO Unconditional Jump
Syntax:{label:}GOTOlit24
Operands:lit24 ∈ [0 ... 16MB]
Operation:lit24 → PC[23:0], NOP → Instruction Register.
Status Affected:None
Encoding:1101101nnnnnnnnnnnnnnnnnnnnnnn10
Description:Unconditional jump to any address within (for latency) one cycle’s memory space. The 24-bit value ‘lit24’ is loaded into the PC. A jump to either a 32-bit or 16-bit instruction is permitted.

The ‘n’ bits form the target address.

Note: The (byte) PC address is always either word or long word aligned. The opcode does not store the LSb because it is always 1’b0.
I-Words:1
Cycles:1
Example:1AddressLabelInstructionComment
0x804000 - GOTO _CHECK_FAIL; Jumps to address 0x805000(_CHECK_FAIL)
. . .
0x805000_CHECK_FAIL:MOV.l SR, W6; Random code
CP w6, w7
GOTOUnconditional Indirect Jump
Syntax:{label:}GOTOWns
Operands:Wns ∈ [W0 ... W14]
Operation:(Wns) → PC[23:0];

NOP → Instruction Register.

Status Affected:None
Encoding:1101011UUUUUssssUUUUUUUUUUUU1010
Description:Unconditional indirect jump to any address within executable memory address space.

The Wns[23:0] is loaded into PC[23:0]. Wns must therefore contain a PS byte address.

The value of Wns[0] is ignored and PC[0] is always set to 1’b0.


GOTO is a two-cycle instruction.

The ‘s’ bits select the source register.

If Wns[31:24] !=8’h00, an address error trap will be initiated.

I-Words:1
Cycles:2
Note: The goto target instruction fetch is not executed if an exception is pending, making effective instruction execution time one cycle.
Example:1AddressLabelInstruction Comment
0x804000 - GOTO _CHECK_FAIL; Jumps to address 0x805000(_CHECK_FAIL)
. . .
0x805000_CHECK_FAIL:MOV.l SR, W6; Random code
CP w6, w7
INCIncrement f
Syntax:{label:}INC.bf{,Wnd}{,WREG}
INC.bz
INC{.w}
INC.l
Operands:f ∈ [0 ... 64KB]; Wnd ∈ [W0 ... W14]
Operation:(f) + 1 → destination designated by D
Status Affected:C, N, OV, Z
Encoding:1101010LddddffffffffffffffffBD01
Description:Add one to the contents of the file register and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register.

The ‘L’ and ‘B’ bits select operation data width.

The ‘D’ bit selects the destination.

The ‘f’ bits select the address of the file register.

The ‘d bits select the Working register.

I-Words:1
Cycles:1

Example 1:

INC.B  0x1000 ; Increment 0x1000 (Byte mode)

Before Instruction

After Instruction

Data 1000

8FFF

Data 1000

8F00

SR

0000

SR

0101

(DC, C = 1)

Example 2:

INC    0x1000, WREG  ; Increment 0x1000 and store to WREG ; (Word mode)

Before Instruction

After Instruction

WREG

ABCD

WREG

9000

Data 1000

8FFF

Data 1000

8FFF

SR

0000

SR

0108

(DC, N = 1)

INC2Increment f by 2
Syntax:{label:}INC2.bf{,Wnd}{,WREG}
INC2.bz
INC2{.w}
INC2.l
Operands:f ∈ [0 ... 64KB]; Wnd ∈ [W0 ... W14]
Operation:(f) + 2 → destination designated by D
Status Affected:C, N, OV, Z
Encoding:1101110LddddffffffffffffffffBD01
Description:Add two to the contents of the file register and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register.

The ‘L’ and ‘B’ bits select operation data width.

The ‘D’ bit selects the destination.

The ‘f’ bits select the address of the file register.

The ‘d’ bits select the Working register.

I-Words:1
Cycles:1

Example 1:

INC2.B  0x1000   ; Increment 0x1000 by 2   ; (Byte mode)

Before Instruction

After Instruction

Data 1000

8FFF

Data 1000

8F01

SR

0000

SR

0101

(DC, C = 1)

Example 2:

INC2    0x1000, WREG  ; Increment 0x1000 by 2 and store to WREG   ; (Word mode)

Before Instruction

After Instruction

WREG

ABCD

WREG

9001

Data 1000

8FFF

Data 1000

8FFF

SR

0000

SR

0108

(DC, N = 1)

IORInclusive OR Wb and Ws
Syntax:{label:}IOR.bWb,Ws,Wd
IOR.bz[Ws],[Wd]
IOR{.w}[Ws++],[Wd++]
IOR.l[Ws--],[Wd--]
[++Ws],[++Wd]
[--Ws],[--Wd]
SRSR
Operands:Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15]
Operation:(Wb).IOR.(Ws) → Wd
Status Affected:N, Z
Encoding:S110101LddddsssspppqqqwwwwUUBU00
Description:Compute the Inclusive OR of the contents of the source register Ws and the contents of the base register Wb and place the result in the destination register Wd.

The ‘S’ bit selects instruction size.

The ‘L’ and ‘B’ bits select operation data width.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

Note:
  1. When the SR is selected, SR data write will take priority over any SR update resulting from the IOR operation.
  2. .bz data size/mode is disallowed when writing to the SR.
I-Words:1 or 0.5
Cycles:1

Example 1:

IOR.B  W1, [W5++], [W9++]  ; IOR W1 and [W5] (Byte mode) ; Store result to [W9] ; Post-increment W5 and W9

Before Instruction

After Instruction

W1

AAAA

W1

AAAA

W5

2000

W5

2001

W9

2400

W9

2401

Data 2000

1155

Data 2000

1155

Data 2400

0000

Data 2400

00FF

SR

0000

SR

0008

(N = 1)

Example 2:IOR     W1, W5, W9   ; IOR W1 and W5 (Word mode)      ; Store the result to W9

Before Instruction

After Instruction

W1

AAAA

W1

AAAA

W5

5555

W5

5555

W9

A34D

W9

FFFF

SR

0000

SR

0008

(N = 1)

IORInclusive OR Wb and Short Literal
Syntax:{label:}IOR.bWs,lit7,Wd
IOR.bz[Ws],[Wd]
IOR{.w}[Ws++],[Wd++]
IOR.l[Ws--],[Wd--]
[++Ws],[++Wd]
[--Ws],[--Wd]
SRSR
Operands:Ws ∈ [W0 ... W15]; lit7 ∈ [0 ... 127]; Wd ∈ [W0 ... W15]
Operation:(Ws).IOR.lit7 → Wd

Note: The literal is zero-extended to the selected data size of the operation

Status Affected:N, Z
Encoding:1110101LddddsssspppqqqkkkkkkBk10
Description:Compute the Inclusive OR of the contents of the source register Ws and the zero-extended literal operand and place the result in the destination register Wd.

The ‘L’ and ‘B’ bits select operation data width.

The ‘k’ bits provide the literal operand (MSb in op[2]).

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

See and for modifier addressing information.

Note:
  1. When the SR is selected, SR data write will take priority over any SR update resulting from the AND operation.
  2. .bz data size/mode is disallowed when writing to the SR.
I-Words:1
Cycles:1

Example 1:

IOR.B  W1, #0x5, [W9++]    ; IOR W1 and 0x5 (Byte mode)   ; Store to [W9]   ; Post-increment W9

Before Instruction

After Instruction

W1

AAAA

W1

AAAA

W9

2000

W9

2001

Data 2000

0000

Data 2000

00AF

SR

0000

SR

0008

(N = 1)

Example 2:

IOR  W1,   #0x0, W9     ; IOR W1 with 0x0 (Word mode)       ; Store to W9

Before Instruction

After Instruction

W1

0000

W1

0000

W9

A34D

W9

0000

SR

0000

SR

0002

(Z = 1)

IOR Inclusive OR Literal and Wn
Syntax:{label:}IOR.blit16,Wn
IOR.bzSR
IOR{.w}
IOR.l
Operands:lit16 ∈ [0 ... 65535]; Wn ∈ [W0 ... W14]; Status Register (SR)
Operation:(Wn) .IOR. lit163 → Wn or (SR) .IOR. lit16 → SR
Status Affected:N, Z
Encoding:1100101LsssskkkkkkkkkkkkkkkkBT10
Description:Compute the Inclusive OR of the literal operand and the contents of the Working register Wn or SR and place the result in the Working register Wn or SR.

The ‘L’ and ‘B’ bits select operation data width.

The ‘s’ bits select the Working register.

The ‘k’ bits specify the literal operand.

The ‘T’ bit selects between Ws (T = 0) and SR (T = 1) target registers.

Note:
  1. When the SR is selected, SR data write will take priority over any SR update resulting from the AND operation.
  2. .bz data size/mode is disallowed when writing to the SR.
  3. The literal is zero-extended to 32-bits for long word operations.
I-Words:1
Cycles:1

Example 1:

IOR.B  #0xAA, W9       ; IOR 0xAA to W9   ; (Byte mode)

Before Instruction

After Instruction

W9

1234

W9

12BE

SR

0000

SR

0008

(N = 1)

Example 2:

IOR    #0x2AA, W4 ; IOR 0x2AA to W4   ; (Word mode)

Before Instruction

After Instruction

W4

A34D

W4

A3EF

SR

0000

SR

0008

(N = 1)

IORInclusive OR f and Wn
Syntax:{label:}IOR.bf,Wn{,WREG}
IOR.bz
IOR{.w}
IOR.l
Operands:f ∈ [0 ... 64KB]; Wn ∈ [W0 ... W14]
Operation:(f).IOR.(Wn) → destination designated by D
Status Affected:N, Z
Encoding:1110101LssssffffffffffffffffBD01
Description:Compute the Inclusive OR of the contents of the Working register and the contents of the file register and place the result in the destination designated by D. If the optional Wn is specified, D=0 and store result in Wn; otherwise, D=1 and store result in the file register.

The ‘L’ and ‘B’ bits select operation data width.

The ‘D’ bit selects the destination.

The ‘f’ bits select the address of the file register.

The ‘s’ bits select the Working register.

I-Words:1
Cycles:1
LACLoad Accumulator
Syntax:{label:}LAC{.w}Ws,{ Slit6, }A
LAC.l[Ws], B
[Ws++]
[Ws--]
[--Ws],
[++Ws],
[Ws+Wb],
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31]
Operation:For Word operation:

8{Ws[15]}, Ws[15:0], 48’h000000000000 → ACC[71:0]

ShiftSlit6(ACC) → ACC

For Long Word operation:

8{Ws[31]}, Ws[31:0], 32’h00000000 → ACC[71:0]

ShiftSlit6(ACC) → ACC

Status Affected:OA, SA or OB, SB
Encoding:110000ALwwwwsssspppUUUkkkkkk0011
Description:Read the contents of the Effective Address. Place the data read into the target accumulator, then optionally shift the entire accumulator.

For a word operation (LAC{.w}), the value contained at the Effective Address is assumed to be Q1.15 signed fractional data and is written into ACCx[63:48]. ACCx[47:0] is set to all 0’s, and ACCx[63:0] is automatically sign-extended (through bit 71). The accumulator is then arithmetically shifted by the value held in slit6.

For a long word operation (LAC.l), the value contained at the Effective Address is assumed to be Q1.31 signed fractional data and is written into ACCx[63:32]. ACCx[31:0] is set to all 0’s, and ACCx[63:0] is automatically sign-extended (through bit 71). The accumulator is then arithmetically shifted by the value held in slit6.


The ‘L’ bit selects word or long word operation.

The ‘A’ bits specify the destination accumulator.

The ‘s’ bits specify the source register Wns.

The ‘p’ bits select the source addressing mode.

The ‘w’ bits specify the offset register Wb.

The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s.

Note: Positive values of operand Slit6 represent arithmetic shift right. Negative values of operand Slit6 represent shift left.
I-Words:1
Cycles:1

Example 1:

LAC  [W4++], #-3, B ; Load ACCB with [W4] << 3 ; Contents of [W4] do not change ; Post increment W4 ; Assume saturation disabled ; (SATB = 0)

Before Instruction

After Instruction

W4

2000

W4

2002

ACCB

00 1525 ABCD 2512 1922

ACCB

FF 9108 0000 0000 0000

Data 2000

1221

Data 2000

1221

SR

0000

SR

4800

(OB, OAB = 1)

Example 2:

LAC  [--W2], #7, A ; Pre-decrement W2 ; Load ACCA with [W2] >> 7 ; Contents of [W2] do not change ; Assume saturation disabled ; (SATA = 0)

Before Instruction

After Instruction

W2

4002

W2

4000

ACCA

00 1525 ABCD 2512 1922

ACCA

FF FF22 1000 0000 0000

Data 4000

9108

Data 4000

9108

Data 4002

1221

Data 4002

1221

SR

0000

SR

0000

LLACLoad Lower Accumulator
Syntax:{label:}LLAC.lWs,{ Slit6, }A
[Ws], B
[Ws++]
[Ws--]
[--Ws],
[++Ws],
[Ws+Wb],
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31]
Operation:Ws[31:0] → ACC[31:0]

ShiftSlit6(ACC) → ACC

Status Affected:OA, SA or OB, SB
Encoding:110000A1wwwwsssspppUUUkkkkkk0111
Description:Read the contents of the Effective Address. Place the data read into the lower 32-bits of the target accumulator (ACCx[31:0]), then optionally arithmetically shift the entire accumulator.

The ‘A’ bits specify the destination accumulator.

The ‘s’ bits specify the source register Wns.

The ‘p’ bits select the source addressing mode.

The ‘w’ bits specify the offset register Wb.

The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s.

Note: Positive values of operand Slit6 represent arithmetic shift right. Negative values of operand Slit6 represent shift left.
I-Words:1
Cycles:1
Example:1LLAC A, #4, w8; Load ACCAL from w8 ;Right shift value of ACCA by 4
Before executionAfter execution
ACCA0x00_1022_2EE1_5633_9078ACCA0xFF_F102_22EE_1123_4567
w80x12345678w80x12345678
LNKAllocate Stack Frame
Syntax:{label:}LNKlit16
Operands:lit16 ∈ [0 ... 65535]
Operation:(W14) → (TOS)

(W15) + 4 → W15

(W15) → W14;

(W15) + lit16 → W15

Status Affected:None
Encoding:1101010UUUUUkkkkkkkkkkkkkkkk1010
Description:This instruction allocates a stack frame of size lit16 bytes (though always long word aligned) and adjusts the Stack Pointer and Frame Pointer.

The ‘k’ bits specify the size of the stack frame in bytes.

Note:
  1. This instruction operates with long word aligned operands only. The LS 2-bits of the literal encoding are therefore always set to 2’b00.
I-Words:1
Cycles:1
Example:1LNK #8;Allocate stack frame
Before executionAfter execution
W140x1234W140x5004
W150x5000W150x500C
Data @0x50000x0000Data @0x50000x1234
LNKAllocate Stack Frame (short)
Syntax:{label:}LNKlit7
Operands:lit7∈ [0 ... 127]
Operation:(W14) → (TOS)

(W15) + 4 → W15

(W15) → W14;

(W15) + lit5, 2’b00 → W15

Status Affected:None
Encoding:0111001kkkkk1110
Description:This instruction allocates a stack frame of size lit7 bytes and adjusts the Stack Pointer and Frame Pointer.

The ‘k’ bits specify the size of the stack frame (in long words).

Note:
  1. This instruction operates with long word aligned operands only. The LS 2-bits of the frame size are therefore assumed to be always set to 2’b00 (i.e., such that only 5-bits of the literal need be encoded within the opcode).
I-Words:0.5
Cycles:1
LSRLogical Shift Right by 1
Syntax:{label:}LSR.b Ws,Wd
LSR.bz[Ws],[Wd]
LSR{.w}[Ws++],[Wd++]
LSR.l[Ws--],[Wd--]
[++Ws],[++Wd]
[--Ws],[--Wd]
Operands:Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15]
Operation:For long word operation:

0 → Wd[31], (Ws[31:1]) → Wd[30:0], (Ws[0]) → C

For word operation:

0 → Wd[15], (Ws[15:1]) → Wd[14:0], (Ws[0]) → C

For byte operation:

0 → Wd[7], (Ws[7:1]) → Wd[6:0], (Ws[0]) → C

Status Affected:C,N,Z
Encoding:S010101LddddsssspppqqqUUUUUUB000
Description:Logical shift right the contents of the source register Ws by one bit, placing the result in the destination register Wd.

Destination register direct Extended Byte or Word mode will zero-extend the result to 32-bits, then write to Wd.

The ‘S’ bit selects instruction size.

The ‘L’ and ‘B’ bits select operation data width.


The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

Note:
  1. The N flag can only be set if the MSb of Ws = 1 with a shift value of zero.
I-Words:1 or 0.5
Cycles:1
LSRLogical Shift Right f
Syntax:{label:}LSR.bf{,Wnd}{,WREG}
LSR.bz
LSR{.w}
LSR.l
Operands:f ∈ [0 ....64KB]; Wnd ∈ [W0 ... W14]
Operation:
For byte operation:

0 → Dest[7:1], (f[7:1]) → Dest[6:0], (f[0]) → C


For word operation:

0 → Dest[15], (f[15:1]) → Dest[14:0], (f[0]) → C

For long word operation:
 0 → Dest[31], (f[31:1]) → Dest[30:0], (f[0]) → C


Status Affected:C, N, Z
Encoding:1010001LddddffffffffffffffffBD01
Description:Shift the contents of the file register f one bit to the right and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register. The carry flag bit is set if the LSB of the file register is ‘1’. The N flag is always cleared.

The ‘L’ and ‘B’ bits select operation data width.

The ‘D’ bit selects the destination.

The ‘f’ bits select the address of the file register.

The ‘d’ bits select the Working register.

I-Words:1
Cycles:1

Example 1:

LSR.B  0x600      ; Logically shift right (0x600) by one      ; (Byte mode)

Before Instruction

After Instruction

Data 600

55FF

Data 600

557F

SR

0000

SR

0001

(C = 1)

Example 2:

LSR    0x600, WREG  ; Logically shift right (0x600) by one   ; Store to WREG   ; (Word mode)

Before Instruction

After Instruction

Data 600

55FF

Data 600

55FF

WREG

0000

WREG

2AFF

SR

0000

SR

0001

(C = 1)

LSRLogical Shift Right by Short Literal
Syntax:{label:}LSR{.w} Ws,lit5,Wd
LSR.l[Ws],[Wd]
[Ws++],[Wd++]
[Ws--],[Wd--]
[++Ws],[--Wd]
[--Ws],[++Wd]
Operands:Ws ∈ [W0 ... W15]; lit5 ∈ [0...32]; Wd ∈ [W0 ... W14]
Operation:lit5[4:0]→ Shift_Val

1’b0 → Right shift input (logical shift)

For long word operation:

Ws[31:0], 32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[63:32] → Wd

For word operation:

16’b0,Ws[15:0],32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[47:32] → Wd[15:0]

Status Affected:N,Z
Encoding:S010001kkkkkddddpppqqqssssUUL000
Description:Logical shift right the contents of the source register Ws by lit5 bits (up to 31 positions), placing the result in the destination Wd.

The N flag is always cleared unless the shift value is zero (see note 1).

This instruction will generate the correct result for any shift value in lit5 (a word operation shift value > 15, Wd[15:0]=0x0000).

Register Direct Word mode will zero-extend the result to 32-bits, then write to Wd.

The ‘S’ bit selects instruction size.

The ‘L’ bit selects word or long word operation.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

The ‘k’ bits provide the literal operand.

Note:
  1. The N flag can only be set if the MSb of Ws = 1 with a shift value of zero.
  2. This instruction only operates in Word or Long Word mode.
I-Words:1 or 0.5
Cycles:1

Example 1:

LSR W4, #14, W5 ; LSR W4 by 14 ; Store result to W5

Before Instruction

After Instruction

W4

C800

W4

C800

W5

1200

W5

0003

SR

0000

SR

0000

Example 2:

LSR  W4, #1, W5   ; LSR W4 by 1                     ; Store result to W5

Before Instruction

After Instruction

W4

0505

W4

0505

W5

F000

W5

0282

SR

0000

SR

0000

LSRLogical Shift Right by Wb
Syntax:{label:}LSR.b Ws,Wb,Wd
LSR.bz[Ws],[Wd]
LSR{.w}[Ws++],[Wd++]
LSR.l[Ws--],[Wd--]
[++Ws],[++Wd]
[--Ws],[--Wd]
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ...W15]; Wd ∈ [W0 ... W15]
Operation:Wb[15:0]→ Shift_Val

For long word operation:

Ws[31:0], 32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[63:32] → Wd

For word operation:

16’b0,Ws[15:0],32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[47:32] → Wd[15:0]

For byte operation:

24’b0,Ws[7:0],32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[39:32] → Wd[7:0]

Status Affected:N,Z
Encoding:1010101LwwwwddddpppqqqssssUUB100
Description:Logical shift right the contents of the source register Ws by Wb bits, placing the result in the destination register Wd.

When used in isolation, this instruction will generate the correct result for any shift value in Wb[15:0]:

  • For a byte operation shift value > 7, Wd[7:0]=0x00
  • For a word operation shift value > 15, Wd[15:0]=0x0000
  • For a long word operation shift value > 31, Wd=0x00000000

    When used in conjunction with ASRMW and/or LSRMW instructions for multi-precision multi-bit shift operations, this instruction will not generate a correct result for any shift value greater than 32.

    Any data held in Wb[31:16] will have no effect.

    The N flag is always cleared unless the shift value is 0 (see note 1).

    Destination register direct Extended Byte or Word mode will zero-extend the result to 32-bits, then write to Wd.

    The ‘L’ and ‘B’ bits select operation data width.


    The ‘s’ bits select the source register.

    The ‘w’ bits select the base (shift count) register.

    The ‘d’ bits select the destination register.

    The ‘p’ bits select the source addressing mode.

    The ‘q’ bits select the destination addressing mode.

    Note:
    1. The N flag can only be set if the MSb of Ws = 1 with a shift value of zero.
I-Words:1
Cycles:1
LSRMLogical Shift Right Multi-Precision by Short Literal
Syntax:{label:}LSRM{.l} Ws,lit5,Wnd
[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; lit5 ∈ [0...31]; Wnd ∈ [W1 ... W14]
Operation:lit5[4:0]→ Shift_Val

0 → Right shift input (logical shift)

Ws[31:0], 32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[63:32] → Wnd

Shift_Out[31:0] | Wnd-1 → Wnd-1

Status Affected:N,Z
Encoding:1110000kkkkkddddpppUUUssssUU0111
Description:Logical shift right the contents of the source register Ws by lit5 bits (up to 31 positions), placing the result in the destination register Wnd. The register containing the next least significant data word will already contain an intermediate shift result. Bitwise OR this value with the data shifted out of Ws in order to create the final shift result, then update the corresponding destination register.

The Z bit is “sticky” (can only be cleared).

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘k’ bits provide the literal operand.

Note:
  1. The N flag can only be set if the MSb of Ws = 1 with a shift value of zero.
  2. This instruction operates in Long Word mode only.

I-Words:1
Cycles:2
LSRMLogical Shift Right Multi-Precision by Wb
Syntax:{label:}LSRM{.l} Ws,Wb,Wnd
[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ...W15]; Wnd ∈ [W1 ... W14]
Operation:Wb[15:0]→ Shift_Val

0 → Right shift input (logical shift)

Ws[31:0], 32’b0 → Shift_In[63:0]

Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0]

Shift_Out[63:32] → Wnd

Shift_Out[31:0] | Wnd-1 → Wnd-1

Status Affected:N,Z
Encoding:1110001UssssddddpppUUUwwwwUU0111
Description:Logical shift right the contents of the source register Ws by Wb bits, placing the result in the destination register Wnd. The register containing the next least significant data word will already contain an intermediate shift result. Bitwise OR this value with the data shifted out of Ws in order to create the final shift result, then update the corresponding destination register.

The right shift may be by any amount between zero and 32 bits. Should the shift value held in Wb[15:0] exceed 2’d32, the shift value will saturate to 2’d32 for consistency. Any data held in Wb[31:16] will have no effect.

The Z bit is “sticky” (can only be cleared).

The ‘w’ bits select the base (shift count) register.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note: This instruction operates in Long Word mode only.
I-Words:1
Cycles:2
LUAC Load Upper Accumulator
Syntax:{label:}LUAC.lWs,{ Slit6, }A
[Ws], B
[Ws++]
[Ws--]
[--Ws],
[++Ws],
[Ws+Wb],
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31]
Operation:Ws[7:0] → ACC[71:64]

ShiftSlit6(ACC) → ACC

Status Affected:OA, SA or OB, SB
Encoding:110011A1wwwwsssspppUUUkkkkkk1011
Description:Read the contents of the Effective Address. Place the LSb of the data read into the upper 8-bits of the target accumulator (ACCx[71:64]), then optionally arithmetically shift the entire accumulator.

The ‘A’ bits specify the destination accumulator.

The ‘s’ bits specify the source register Wns.

The ‘p’ bits select the source addressing mode.

The ‘w’ bits specify the offset register Wb.

The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s.

Note: Positive values of operand Slit6 represent arithmetic shift right. Negative values of operand Slit6 represent shift left.
I-Words:1
Cycles:1
Example:1LUAC A, #4, w8; Load ACCAU from w8[7:0] ;Right shift value of ACCA by 4
Before executionAfter execution
ACCA0x00_1022_2EE1_5633_9078ACCA0xFF_F102_22EE_1563_3907
w80x000000FFw80x000000FF
MACMultiply and Accumulate
Syntax: {label:}MAC{.w} Wx, Wy,A{,AWB}
MAC.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3}

Operation:(ACC(A or B)) + ((Wx) * (Wy)) → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modified Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110100ALwwwwssssIIIiiJJJjjaaa011
Description:Signed/unsigned (defined by CORCON.US) multiply of data read from Wx and Wy or concurrently fetched from the X and Y address space. The result is sign-extended (when at least one operand is considered signed) or zero-extended (when both operands are unsigned) to 72-bits and added to the specified accumulator. Fractional or integer operation (defined by CORCON.IF) will determine if the result is scaled or not prior to the accumulator update. Fractional operation will scale the result to align the operand and accumulator (msw) fractional points (see note 3). Integer operation will align the LSb of the result with the LSb of the accumulator.

When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address.

The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MAC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size. AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. MAC register direct where Wx = Wy is equivalent to SQRAC Wx, ACCx
  3. The LS portion of ACCx is unaffected when operating in Fractional mode with word sized data. Lower significance data that may be present from prior (32-bit data) operations is therefore preserved. Users not requiring this should clear ACCx during initialization.
  4. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  5. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:1
Example:1MAC.l [W2] += 4, [W5] -= 4, A, W13;Multiply the contents of W2 and W5 and accumulate the results to ACCA ;Increment W2 by 4; Decrement W5 by 4; ;Write back ACCB to W13
Before executionAfter execution
W20x5000W20x5004
W50x7010W50x700C
W130x00000000W130x40210242
CORCON[7:0]8'b10110000(Super saturation enabled.)CORCON[7:0]8'b10110000(Super saturation enabled.)
ACCA0x00_40000000_00000000ACCA0x00_60000000_00000000
ACCB0x00_40210242_29220124ACCB0x00_40210242_29220124
Data @0x50000x40000000Data @0x50000x40000000
Data @0x70100x20000000Data @0x70100x20000000
Example:2MAC.l [W2+=4], [W5+=4], B;Increment W2 and W5 by 4; ;Multiply the contents of W2 and W5 and accumulate the results to ACCB
Before executionAfter execution
W20x5000W20x5004
W50x7010W50x7014
W130x00000000W130x40210242
CORCON[7:0]8'b11110000(Super saturation enabled.)CORCON[7:0]8'b11110000(Super saturation enabled.)
ACCA0x00_40000000_00000000ACCA0x00_40000000_00000000
ACCB0xFF_E0000000_00000000ACCB0x00_1FFFFFFF_00000000
Data @0x50000x40000000Data @0x50000x40000000
Data @0x70100x20000000Data @0x70100x20000000
Data @0x50040x7FFFFFFFData @0x50040x7FFFFFFF
Data @0x70140x40000000Data @0x70140x40000000
MAXForce (Signed) Maximum Data Range Limit
Syntax:{label:}MAX{.w}Wb,Ws
MAX.l[Ws]
[Ws++]
[Ws--]
[++Ws]
[--Ws]
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W14]
Operation:IF (Ws) > (Wb) THEN {
 (Wb) → (Ws);

0→ Z; 0→ N; 0→ OV

}

ELSE {

1→ Z; 0→ N; 0→ OV

}

Status Affected:N, Z, OV
Encoding:1110010LUUUUsssspppUUUwwwwUU1111
Description:Compare any size of signed data value in Ws to a maximum signed limit value held in Wb.

For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are set such that a subsequent BGT instruction will take a branch.

If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0] (for long word data size), or if Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] (word data size), the data limit is not applied such that contents of Ws will not change (for the given data size). The Z, N and OV status bits are set such that a subsequent BZ or BLE instruction will take a branch.

The OV status bit is always cleared by this instruction.

The ‘s’ bits select the source (data value) register.

The ‘w’ bits select the base (data limit) register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The status bits are set based upon the data compare result.
I-Words:1
Cycles:1
MAX Accumulator Force Maximum Data Range Limit
Syntax:{label:}MAXA
B
Operands:None
Operation:IF (MAX A) THEN (

IF ACCA - ACCB > 0 THEN (

ACCB → ACCA;
 0→ Z; 0→ N; 0→ OV;

)

ELSE (

1→ Z; 0→ N; 0→ OV;
 )

)

IF (MAX B) THEN (

IF ACCB - ACCA > 0 THEN (
 ACCA → ACCB;

0→ Z; 0→ N; 0→ OV;

)

ELSE (

1→ Z; 0→ N; 0→ OV;
 )

)

Status Affected:N, OV, Z
Encoding:0111001AUUUU1101
Description:Clamp the target accumulator (defined in the instruction) to the maximum limit value previously loaded into the other accumulator.

The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation).

If the target accumulator is greater than the limit accumulator, load the target accumulator with the contents of the limit accumulator. The Z and N status bits are set such that a subsequent BGT instruction will take a branch.

If the target accumulator is not greater than the limit accumulator, the target accumulator is unaffected. The Z status bit is set such that a subsequent BZ instruction will take a branch.

The OV status bit is always cleared by this instruction.

The ‘A’ bit specifies the destination accumulator.

Note:
  1. OA and SA or OB and SB status bits are not modified by this instruction.
 Execute SFTAC <ACCx>, 0 after MAXAB operation to update DSP status to reflect contents of ACCx.
I-Words:0.5
Cycles:1
MAX Accumulator Force Maximum Data Range Limit
 with Limit Excess Result
Syntax:{label:}MAX{.w}{.v} A,Wd
MAX.l{v}B,[Wd]
[Wd++]
[Wd--]
[++Wd]
[--Wd]
[Wd+Wb]
Operands:Wd ∈ [W0 ... W15] (see note 4); Wb ∈ [W0 ... W15]
Operation:IF (MAX A) THEN (

IF ACCA - ACCB > 0 THEN (

+1 → Wd OR ACCA - ACCB → Wd (see text);
 ACCB → ACCA;
 0→ Z; 0→ N; 0→ OV;

)

ELSE (

0 → Wd;

1→ Z; 0→ N; 0→ OV;
 )

)

IF (MAX B) THEN (

IF ACCB - ACCA > 0 THEN (
 +1 → Wd OR ACCB - ACCA → Wd (see text);

ACCA → ACCB;

0→ Z; 0→ N; 0→ OV;

)

ELSE (

0→ Wd;

1→ Z; 0→ N; 0→ OV;
 )

)

Status Affected:N, OV, Z
Encoding:110010ALwwwwddddUUUqqqUUUUUV1011
Description:Clamp the target accumulator (defined in the instruction) to the maximum limit value previously loaded into the other accumulator.

The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation).

If the target accumulator is greater than the limit accumulator, load the target accumulator with the contents of the limit accumulator. For MAX (instruction bit field V = 0, default when not declared), set Wd to +1. For MAX.v (instruction bit field V = 1), write the (signed) value by which the limit is exceeded to Wd:

- Word operation: Consider only bits [47:32] of the compare result and write to Wd (destination is also word-sized, see note 3). If the limit is exceeded by a value greater than that which can be represented by a signed 16-bit number, saturate the Wd write to the maximum 16-bit positive value (i.e., set Wd[15:0] to 0x7FFF).
- Long word operation: Consider only bits [31:0] of the compare result and write to Wd. If the limit is exceeded by a value greater than that which can be represented by a signed 32-bit number, saturate the Wd write to the maximum positive value (i.e., set Wd to 0x7FFFFFFF).

The Z and N status bits are set such that a subsequent BGT instruction will take a branch if the limit is exceeded.

If the target accumulator is not greater than the limit accumulator, the target accumulator is unaffected, and Wd is cleared. The Z status bit is set such that a subsequent BZ instruction will take a branch.

The OV status bit is always cleared by this instruction.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit specifies the destination accumulator.

The ‘d’ bits select the destination register.

The ‘q’ bits select the destination addressing mode.

The ‘w’ bits define the offset Wb.

The ‘V’ bit defines the presence and result format for Wd.

Note:
  1. OA and SA or OB and SB status bits are not modified by this instruction.
 Execute SFTAC <ACCx>, 0 after MAXAB operation to update DSP status to reflect contents of ACCx.
  2. In keeping with all word sized register direct writes, Wd[15:0] will always be zero extended to 32-bits.
  3. Register direct destination W15 not permitted.
I-Words:1
Cycles:2
MINForce (Signed) Minimum Data Range Limit
Syntax:{label:}MIN{.w}Wb,Ws
MIN.l[Ws]
[Ws++]
[Ws--]
[++Ws]
[--Ws]
Operands:Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W14]
Operation:IF (Ws) < (Wb) THEN {
 (Wb) → (Ws);

0→ Z; 1→ N; 0→ OV

}

ELSE {

1→ Z; 0→ N; 0→ OV

}

Status Affected:N, Z, OV
Encoding:1110010LUUUUsssspppUUUwwwwUU1011
Description:Compare a word or long word signed data value in Ws to a minimum signed limit value held in Wb.

For long word data size, if Ws[31:0] is less than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is less than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are set such that a subsequent BLT instruction will take a branch.

If Ws[31:0] is greater than or equal to the minimum limit value in Wb[31:0] (for long word data size), or if Ws[15:0] is greater than or equal to the minimum limit value in Wb[15:0] (word data size), the data limit is not applied such that contents of Ws will not change (for the given data size). The Z, N and OV status bits are set such that a subsequent BZ or BGE instruction will take a branch.

For word sized register direct operations, Ws is always zero extended to 32-bits (even if greater than or equal to the limit value in Wb)2.

The OV status bit is always cleared by this instruction.

The ‘s’ bits select the source (data value) register.

The ‘w’ bits select the base (data limit) register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The status bits are set based upon the data compare result.
I-Words:1
Cycles:1
MINAccumulator Force Minimum Data Range Limit (unconditional execution)
Syntax:{label:}MINA
B
Operands:None
Operation: IF (MIN A) THEN (

IF ACCA - ACCB < 0 THEN (

ACCB → ACCA;
 0→ Z; 1→ N; 0→ OV;

)

ELSE (

1→ Z; 0→ N; 0→ OV;
 )
)

IF (MIN B) THEN (

IF ACCB - ACCA < 0 THEN (

ACCA→ ACCB;

0→ Z; 1→ N; 0→ OV;

)

ELSE (

1→ Z; 0→ N; 0→ OV;

)

)

Status Affected:N, OV, Z
Encoding:0111001AUUUU1011
Description:Clamp the target accumulator (defined in the instruction) to the minimum limit value previously loaded into the other accumulator.

The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation).

If the target accumulator is less than the limit accumulator, load the target accumulator with the contents of the limit accumulator. The Z and N status bits are set such that a subsequent BLT instruction will take a branch.

If the target accumulator is not less than the limit accumulator, the target accumulator is unaffected. The Z status bit is set (Z = 1) such that a subsequent BLT instruction will take a branch.

The OV status bit is always cleared by this instruction.

The ‘A’ bit specifies the destination accumulator.

Note:
  1. OA and SA or OB and SB status bits are not modified by this instruction. Execute SFTAC <ACCx>, 0 after MAXAB execution to update DSP status to reflect contents of ACCx.
I-Words:0.5
Cycles:1
MIN Accumulator Force Minimum Data Range Limit
 with Limit Excess Result (unconditional execution)
Syntax:{label:}MIN{.w}{.v} A,Wd
MIN.l{v}B,[Wd]
[Wd++]
[Wd--]
[++Wd]
[--Wd]
[Wd+Wb]
Operands:Wd ∈ [W0 ... W15] (see note 4); Wb ∈ [W0 ... W15]
Operation: IF (MIN A) THEN (

IF ACCA - ACCB < 0 THEN (

-1 → Wd OR ACCA - ACCB → Wd (see text);
 ACCB→ ACCA;
 0→ Z; 1→ N; 0→ OV;

)

ELSE (

0→ Wd;

1→ Z; 0→ N; 0→ OV;
 )


IF (MIN B) THEN (

IF ACCB - ACCA < 0 THEN (

-1 → Wd OR ACCB - ACCA → Wd (see text);
 ACCA→ ACCB;

0→ Z; 1→ N; 0→ OV;

)

ELSE (

0→ Wd;

1→ Z; 0→ N; 0→ OV;

)

)

Status Affected:N, OV, Z
Encoding:110010ALwwwwddddUUUqqqUUUUUV0011
Description:Clamp the target accumulator (defined in the instruction) to the minimum limit value previously loaded into the other accumulator.

The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation).

If the target accumulator is less than the limit accumulator, load the target accumulator with the contents of the limit accumulator. For MIN (instruction bit field V = 0, default when not declared), set Wd to -1. For MIN.v (instruction bit field V = 1), write the (signed) value by which the limit is exceeded to Wd:

- Word operation: consider only bits [47:32] of the compare result and write to Wd (destination is also word sized, see note 3). If the limit is exceeded by a value greater than that which can be represented by a signed 16-bit number, saturate the Wd write to the maximum 16-bit negative value (i.e., set Wd[15:0] to 0x8000).
- Long word operation: consider only bits [31:0] of the compare result and write to Wd. If the limit is exceeded by a value greater than that which can be represented by a signed 32-bit number, saturate the Wd write to the maximum negative value (i.e., set Wd to 0x80000000).

The Z and N status bits are set such that a subsequent BLT instruction will take a branch if the limit is exceeded.

If the target accumulator is not less than the limit accumulator, the target accumulator is unaffected, and Wd is cleared. The Z status bit is set such that a subsequent BZ instruction will take a branch.

The OV status bit is always cleared by this instruction.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit specifies the destination accumulator.

The ‘d’ bits select the destination register.

The ‘q’ bits select the destination addressing mode.

The ‘w’ bits define the offset Wb.

The ‘V’ bit defines the result format for Wd.

Note:
  1. OA and SA or OB and SB status bits are not modified by this instruction. Execute SFTAC <ACCx>, 0 after MINABW execution to update DSP status to reflect contents of ACCx.
  2. In keeping with all word-sized register direct writes, Wd[15:0] will always be zero extended to 32-bits (irrespective of the sign of the result).
  3. Register direct destination W15 not permitted.
I-Words:1
Cycles:2
MOVMove f to Wnd (Word or Long)
Syntax:{label:}MOV{.w}f,Wnd
MOV.l
Operands:f ∈ [0 ... 1MB]; Wnd ∈ [W0 ... W15]
Operation:(f) → Wnd
Status Affected:None
Encoding:100100ddfffffffffffffffffffLdd01
Description:Moves the contents of any file register to the specified W register. The file address is a word address. Word data will be zero-extended to 32-bits prior to destination write.

The ‘L’ bit selects word or long word operation.

The ‘f’ bits select the address of the file register.

The ‘d’ bits select the destination register.

Note:
  1. Accessible file address space is 1MB.
  2. The file address is always either word or long word aligned. The opcode does not store the LSb because it is always 1’b0.
I-Words:1
Cycles:1
MOVMove f to Wnd (Byte)
Syntax:{label:}MOV.bzf,Wnd
Operands:f ∈ [0 ... 1MB]; Wnd ∈ [W0 ... W14]
Operation:(f) → Wnd
Status Affected:None
Encoding:100110ddffffffffffffffffffffdd01
Description:Moves contents of any file register to the specified W register. The file address is a byte address. The byte data will be zero-extended to 32-bits prior to destination write.

The ‘f’ bits select the address of the file register.

The ‘d’ bits select the destination register.

I-Words:1
Cycles:1
MOVMove Wns to f (Byte)
Syntax:{label:}MOV.bWnsf
Operands:f ∈ [0 ... 1MB]; Wns ∈ [W0 ... W15]
Operation:Wns → (f)
Status Affected:None
Encoding:100111ssffffffffffffffffffffss01
Description:Moves contents of the specified W register to any file register. The file address is a byte address.

The ‘f’ bits select the address of the file register.

The ‘s bits select the source register.

I-Words:1
Cycles:1
MOVMove Wns to f (Word/Long)
Syntax:{label:}MOV{.w}Wnsf
MOV.l
Operands:f ∈ [0 ... 1MB]; Wns ∈ [W0 ... W15]
Operation:Wns → (f)
Status Affected:None
Encoding:100101ssfffffffffffffffffffLss01
Description:Moves contents of the specified W register to any file register. The file address is a word address.

The ‘L’ bit selects word or long word operation.

The ‘f’ bits select the address of the file register.

The ‘s bits select the source register.

Note: The file address is always either word or long word aligned. The opcode does not store the LSb because it is always 1’b0.
I-Words:1
Cycles:1
MOVMove Wns with Signed Literal Offset to Wnd
Syntax:{label:}MOV.b [Wns+Slit12], Wnd
MOV.bz [Wns+Slit12], Wnd
MOV{.w} [Wns+Slit13], Wnd
MOV.l [Wns+Slit14], Wnd
Operands:Wns ∈ [W0 ... W15]

Wnd ∈ [W0 ... W15]

Operation:[Wns+Slit12/13/14] → Wnd
Status Affected:None
Encoding:1111110LddddsssskkkkkkkkkkkkB011
Description:Moves contents of the source Effective Address to a specified W register. The contents of Wns are not modified by this operation.

The instruction encoding includes space for a 12-bit literal which is scaled accordingly for byte, word and long word data moves in order to generate the corresponding byte offset value.

The ‘L’ and ‘B’ bits select operation data width.

The ‘d’ bits select the destination register.

The ‘s’ bits select the source register.

The ‘k’ bits specify the literal operand.

I-Words:1
Cycles:1
MOVMove Ws to f (extended)
Syntax:{label:}MOV.lWs,f
MOV{.w}[Ws],
MOV{.b}[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:f ∈ [1MB1 ... 4GB]; Ws ∈ [W0 ... W15]
Operation:Ws → (f)
Status Affected:None
Encoding:
1st word1111001UffffffffffffffffffffU011
2nd word1111001LssssUfffpppfffffffffB111
Description:Moves contents of Ws to any file register. The file address is a byte address.

The ‘s’ bits select the Working register.

The ‘p’ bits select the source addressing mode.

The ‘f’ bits select the address of the file register:

file[31:0] = Word1[18:13], Word2[9:4], Word1[23:4]

I-Words:2
Cycles:2
MOVMove Wns to Wnd with Signed Literal Offset
Syntax:{label:}MOV.b Wns, [Wnd+Slit12]
MOV{.w} Wns, [Wnd+Slit13]
MOV.l Wns, [Wnd+Slit14]
Operands:Wnd ∈ [W0 ... W15]

Wns ∈ [W0 ... W15]

Operation:Wns → [Wnd+Slit12/13/14]
Status Affected:None
Encoding:1111110LddddsssskkkkkkkkkkkkB111
Description:Moves contents of a specified W register to the destination Effective Address. The contents of Wnd are not modified by this operation.

The instruction encoding includes space for a 12-bit literal which is scaled accordingly for byte, word and long word data moves in order to generate the corresponding byte offset value.

The ‘L’ and ‘B’ bits select operation data width.

The ‘d’ bits select the destination register.

The ‘s’ bits select the source register.

The ‘k’ bits specify the literal operand.

I-Words:1
Cycles:1
MOVMove Ws to Wd
Syntax:{label:}MOV.bWs,Wd
MOV.bz[Ws],[Wd]
MOV{.w}[Ws++][Wd++]
MOV.l[Ws--][Wd--]
[--Ws],[--Wd]
[++Ws],[++Wd]
[Ws+Wb], [Wd+Wb]
SRSR
Operands:Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] (see Note 6)
Operation:(EAs) → (EAd)
Status Affected:None (see note 3)
Encoding:S000001LddddsssspppqqqwwwwUUB000
Description:Move the contents of the source register into the destination register.

The ‘S’ bit selects instruction size.

The ‘L’ and ‘B’ bits select operation data width.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

The ‘w’ bits define the offset Wb.

Note:
  1. When targeting the SR, the SR will be modified as a result of the instruction operation.
  2. .bz data size/mode is disallowed when writing to the SR.
  3. If register offset addressing is used for both source and destinations addressing modes, Wb cannot be set to W15.
I-Words:1 or 0.5
Cycles:1
Example 1:MOV.B [W0--], W4 ; Move [W0] to W4 (Byte mode) ; Post-decrement W0

Before Instruction

After Instruction

W0

0A01

W0

0A00

W4

2976

W4

2989

Data 0A00

8988

Data 0A00

8988

SR

0000

SR

0000

MOV Move Literal to Wnd
Syntax:{label:}MOV.bzlit8Wnd
MOV{.w}lit16
MOV.sllit24
Operands:lit8∈ [0 ... 255]; lit16 ∈ [0 ... 65535]; lit24 ∈ [0 ... 16MB]; Wnd ∈ [W0 ... W15]
Operation:8’h00, lit24 → Wnd
Status Affected:None
Encoding:10ddddkkkkkkkkkkkkkkkkkkkkkkkk11
Description:The literal ‘k’ is zero-extended to 32-bits then loaded into the Wnd register.

The ‘d’ bits select the Working register.

The ‘k’ bits specify the value of the 8-bit, 16-bit or 24-bit literal. The 8-bit and 16-bit literals are zero extended by the assembler to generate the 24-bit value for the opcode.

I-Words:1
Cycles:1
MOVMove Long Literal to Wd
Syntax:{label:}MOV.llit32,Wd
[Wd]
[Wd++]
[Wd--]
[++Wd]
[--Wd]
Operands:lit32 ∈ [0 ... 4GB]; Wd ∈ [W0 ... W15]
Operation:lit32 → Wd
Status Affected:None
Encoding:
1st word1000000UkkkkkkkkkkkkkkkkkkkkU001
2nd word1000000UddddUkkkkkkqqqkkkkkkU101
Description:The literal ‘k’ is loaded into the Wd register.

The ‘d’ bits select the Working register.

The ‘q’ bits select the destination addressing mode.

The ‘k’ bits specify the value of the 32-bit literal:

lit32[31:0] = Word2[18:13], Word2[9:4], Word1[23:4]

I-Words:2
Cycles:2
MOVMove Short Literal to Wnd
Syntax:{label:}MOV.llit5,Wnd
Operands:lit5 ∈ [0 ... 31]; Wnd ∈ [W0 ... W14]
Operation:27’h0000000, lit5 → Wnd
Status Affected:None
Encoding:0001000kkkkkdddd
Description:The literal ‘k’ is zero-extended to 32-bits then loaded into the Wnd register.

The ‘d’ bits select the Working register.

The ‘k’ bits specify the value of the 5-bit literal.

I-Words:0.5
Cycles:1
MOVMove Ws to Wd with Bit-Reversed Addressing
Syntax:{label:}MOVR{.w} Ws,[Wd++]
MOVR.l[Ws],[++Wd]
[Ws++],
[++Ws],
Operands:Ws ∈ [W0 ... W14]; Wd ∈ [W0 ... W14]
Operation:(EAs) → (EAd) with Bit-Reversed Addressing
Status Affected:None
Encoding:1000001LddddsssspppqqqUUUUUU1100
Description:Move the contents of the source address to the destination address using Bit-Reversed Addressing to generate the destination EA. The destination Bit-Reversed Addressing modifier is sourced from XBREV.XB[14:0].

The ‘L’ bit selects operation data width.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘q’ bits select the destination addressing mode.

Note:
  1. Ws = Wd only permitted when Source Addressing mode is register indirect without modification ([Ws]).
I-Words:1
Cycles:1
MOV Move from Stack with Literal Offset to Wnd
Syntax:{label:}MOV.l[W15-lit7], Wnd
[W14+slit7], Wnd
Operands:Wnd ∈ [W0 ... W14];
lit7 ∈ [4, 8 .... 124, 128] (see note 2)
slit7 ∈ [-64, -60 .... +56, +60]
Operation:([W15 - lit7]) → Wnd or ([W14 + slit7]) → Wnd
Status Affected:None
Encoding:000011Fkkkkkdddd
Description:Move the contents of the system stack to the destination register using the SP (W15) or FP (W14) as source address with a (byte) offset. The stack source Effective Address is defined as [W15 - lit7] or [W14 + slit7], but is aligned to a 32-bit boundary (i.e., long word data moves only).

The offset used by the CPU is a signed value generated from the 5-bit literal stored within the opcode. The Effective Address is long word aligned such that the LS 2-bits of the address are always 2’b00.

  • When W15 is the source address register, the offset is always negative so the sign bit is implied (i.e., not stored within the opcode) as 1’b1. The assembler will generate the 2’s complement of lit7, truncate it, and drop the sign bit to create the 5-bit opcode literal value. An offset of zero cannot be supported.
  • When W14 is the source address register, the offset may be positive or negative, so the sign bit is stored within the 5-bit literal. The assembler will truncate Slit7 to create the 5-bit opcode literal value.

    The ‘d’ bits select the destination register.

    The ‘F’ bit selects between W15 (F = 0) and W14 (F = 1).

    The ‘k’ bits define a 5-bit signed literal.

    Note:
    1. This instruction operates in Long Word mode only.
I-Words:0.5
Cycles:1
MOV Move Wns to Stack with Literal Offset
Syntax:{label:}MOV.lWns,[W15 - lit7]
[W14 + slit7]
Operands:Wns ∈ [W0 ... W14];
lit8 ∈ [4, 8 .... 124, 128] (see note 2)
slit7 ∈ [-64, -60 .... +56, +60]
Operation:Wns → ([W15 - lit7]) or Wns → ([W14 + slit7])
Status Affected:None
Encoding:000010Fkkkkkssss
Description:Move the contents of the system stack to the destination register using the SP (W15) or FP (W14) as destination address with a (byte) offset. The stack destination Effective Address is defined as [W15 - lit7] or [W14 + slit7], but is aligned to a 32-bit boundary (i.e., long word data moves only).

The offset used by the CPU is a signed value generated from the 5-bit literal stored within the opcode. The Effective Address is long word aligned such that the LS 2-bits of the address are always 2’b00.

  • When W15 is the destination address register, the offset is always negative so the sign bit is implied (i.e., not stored within the opcode) as 1’b1. The assembler will generate the 2’s complement of lit7, truncate it, and drop the sign bit to create the 5-bit opcode literal value. An offset of zero cannot be supported.
  • When W14 is the destination address register, the offset may be positive or negative, so the sign bit is stored within the 5-bit literal. The assembler will truncate Slit7 to create the 5-bit opcode literal value.

    The ‘s’ bits select the source register.

    The ‘F’ bit selects between W15 (F = 0) and W14 (F = 1).

    The ‘k’ bits specify the literal operand.

    Note:
    1. This instruction operates in Long Word mode only.
I-Words:0.5
Cycles:1
MOVIFConditionally Move Wb or Wns to Wd
Syntax:{label:}MOVIF.bCC,Wb,Wns,Wd
MOVIF.bz[Wd]
MOVIF{.w}[Wd++]
MOVIF.l[Wd--]
[--Wd]
[++Wd]
Operands:Wb ∈ [W0 ... W15]; Wns ∈ [W0 ... W15]; Wd ∈ [W0 ... W15]
CC ∈ Z, N, C, OV, GT, LT, GTU
Operation:If CC = true then

Wb → (EAd)

Else

Wns → (EAd)

Status Affected:None
Encoding:1111011LddddssssrrrqqqwwwwUUB011
Description:Test the specified condition. If true, move the contents of the Wb source register into the destination, else move the contents of the Wns source register into the destination.

The ‘L’ and ‘B’ bits select operation data width.

The ‘w’ bits select the (condition true) Wb source register.

The ‘s’ bits select the (condition false) Ws source register.

The ‘d’ bits select the destination register.

The ‘q’ bits select the destination addressing mode.

The ‘r’ bits select the move condition.

I-Words:1
Cycles:1
Example:1MOVIF Z, W5, W6, W1;Move W5 to W1 if Z == 1; else move W6 to W1
Before executionAfter execution
W50x11111111W50x11111111
W60x22222222W60x22222222
W10x00000000W10x11111111
SR[7:0]8'bxxxxxxx1x(Z = 1)SR[7:0]8'bxxxxxxx1x(Z = 1)
Example:2MOVIF C, W5, W6, W1;Move W5 to W1 if C == 1; else move W6 to W1
Before executionAfter execution
W50x11111111W50x11111111
W60x22222222W60x22222222
W10x00000000W10x22222222
SR[7:0]8'bxxxxxxxx0(C = 0)SR[7:0]8'bxxxxxxxx0(C = 0)
MOVS Move Signed Literal to Wd
Syntax:{label:}MOVS.bslit16,Wd
MOVS{.w}[Wd]
MOVS.l[Wd++]
[Wd--]
[++Wd]
[--Wd]
SR
Operands:slit16 ∈ [-32768 ... 32767]; Wd ∈ [W0 ... W15]
Operation:Byte: slit16[7:0] → (EAd[7:0])

Word: slit16[15:0] → (EAd[15:0])

Long or Word Register Direct: {16{slit16[15]}}, slit16[15:0] → (EAd[31:0])

Status Affected:None (see note 4)
Encoding:10001kkkddddkkkkkkkqqqkkkkkkLB01
Description:Write a signed literal value to the destination.

MOVS.b will move the LS 8-bits of the literal to the destination. For Register Direct Addressing, the remaining bits of the register will be unaffected.

MOVS.w will move the 16-bit literal to the destination (see Note 1). For Register Direct Addressing, the value will be sign-extended to 32-bits.

MOVS.l will sign extend the literal to 32-bits prior to moving the value to the destination.

The ‘L’ and ‘B’ bits select operation data width.

The ‘d’ bits select the Working register.

The ‘q’ bits select the destination addressing mode.

The ‘k’ bits specify the value of the literal. For .b mode, the 8-bit literal value is zero extended by the assembler to generate the 16-bit value for the opcode.

Note:
  1. For byte sized data, the literal can be considered to be a signed or unsigned value because only an 8-bit value is written. The declared slit16 literal value must be between 0x0000 and 0x00FF.
  2. For word size data using any Indirect Addressing mode, the literal can be considered to be a signed or unsigned value because only a 16-bit value is written.
  3. Long Word and Word Register Direct Addressing modes are equivalent operations because both sign-extend the literal to 32-bits.
  4. When targeting the SR, the SR will be modified as a result of the instruction operation.
I-Words:1
Cycles:1
MPYMultiply to Accumulator
Syntax: {label:}MPY{.w} Wx, Wy,A{,AWB}
MPY.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3}

Operation:((Wx) * (Wy)) → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modification Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110101ALwwwwssssIIIiiJJJjjaaa011
Description:Signed/unsigned (defined by CORCON.US) multiply of data read from Wx and Wy or concurrently fetched from the X and Y address space. The result is sign-extended (when at least one operand is considered signed) or zero-extended (when both operands are unsigned) to 72-bits then written to the specified accumulator. Fractional results are also scaled prior to the accumulator update to align the operand and accumulator (msw) fractional points.

When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address.

The optional AWB specifies the direct or indirect (see note 2) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MPY operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 3). AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  3. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:1
Example:1MPY.L [w4]+=4, [w5]+=4, A; Multiply W4*W5 and store to ACCA; Post-increment W4 by 4; Post-increment W5 by 4; CORCON = 0x0000 (fractional multiply, no saturation)
Before InstructionAfter Instruction
W44014W44018
W5402CW54030
ACCAFF F780 2087 0000 0000ACCA00 3800 0000 0000 0000
Data4014 C0000000Data4014 C0000000
Data402C 90000000Data402C 90000000
CORCON0000 CORCON0000
SR0000SR0000
Example:2MPY.L [w4]+=4, [w5+=4], B; increment W5 by 4; Multiply W4*W5 and store to ACCB; Post-increment W4 by 4; CORCON = 0x0000 (fractional multiply, no saturation)
Before InstructionAfter Instruction
W44014W44018
W54028W5402C
ACCB00 9834 4500 0000 0055ACCBFF E954 3748 0000 0000
Data4014 671F0000Data4014 671F0000
Data402C E3DC0000Data402C E3DC0000
CORCON0000 CORCON0000
SR0000SR0000
MPYNNegated Multiply to Accumulator
Syntax: {label:}MPYN{.w} Wx, Wy,A{,AWB}
MPYN.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]2}

Operation:- ((Wx) * (Wy)) → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modification Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110101ALwwwwssssIIIiiJJJjjaaa111
Description:Signed/unsigned (defined by CORCON.US) multiply of data read from Wx and Wy or concurrently fetched from the X and Y address space. The result is sign-extended (when at least one operand is considered signed) or zero-extended (when both operands are unsigned) to 72-bits, negated and then written to the specified accumulator. Fractional results are also scaled prior to the accumulator update to align the operand and accumulator (msw) fractional points.

When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address.

The optional AWB specifies the direct or indirect store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MPYN operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 3). AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  3. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:1
MSCMultiply and Subtract from Accumulator
Syntax: {label:}MSC{.w} Wx, Wy,A{,AWB}
MSC.l [Wx], [Wy],B
[Wx]+=kx, [Wy]+=ky,
[Wx]-=kx, [Wy]-=ky,
[Wx+=kx], [Wy+=ky],
[Wx-=kx], [Wy-=ky],
[Wx+W12], [Wy+W12],
Operands:Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14}

Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8};
 ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8};

Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16};
 ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16};

AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3}

Operation:(ACC(A or B)) − ((Wx) * (Wy)) → ACC(A or B);

(ACC(B or A)) rounded → AWB

When Indirect Pre/Post Modified Addressing:

(Wx)+kx→Wx or (Wx)-kx→Wx;

(Wy)+ky→Wy or (Wy)-ky→Wy;

Status Affected:OA,SA or OB,SB
Encoding:110100ALwwwwssssIIIiiJJJjjaaa111
Description:Signed/unsigned (defined by CORCON.US) multiply of data read from Wx and Wy or concurrently fetched from the X and Y address space. The result is sign-extended (when at least one operand is considered signed) or zero-extended (when both operands are unsigned) to 72-bits, and then subtracted from the specified accumulator. Fractional or integer operation (defined by CORCON.IF) will determine if the result is scaled or not prior to the accumulator update. Fractional operation will scale the result to align the operand and accumulator (msw) fractional points. Integer operation will align the LSb of the result with the LSb of the accumulator.

For word sized operand operations, ACCx[31:0] (Integer mode) or ACCx[32:0] (Fractional mode) is preserved (see note 2).

When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address.

The optional AWB specifies the direct or indirect store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MSC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 4). AWB is not intended for use when the DSP engine is operating in Integer mode.

Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly.

The ‘L’ bit selects word or long word operation.

The ‘A’ bit selects the accumulator for the result.

The ‘I’ bits select the Operation.X-Space Addressing mode.

The ‘i’ bits select the kx modification value.

The ‘J’ bits select the Operation.Y-Space Addressing mode.

The ‘j’ bits select the ky modification value.

The ‘s’ bits select the Wx register

The ‘w’ bits select the Wy register.

The ‘a’ bits select the accumulator write-back destination and addressing mode.

Note:
  1. Operates in Fractional or Integer Data mode as defined by CORCON.IF.
  2. The LS portion of ACCx is unaffected when operating in Fractional mode with word sized data. Lower significance data that may be present from prior (32-bit data) operations is therefore preserved. Users not requiring this should clear ACCx during initialization.
  3. Use of the same W-reg for both indirect source (X or Y) and AWB indirect destination is not permitted if the source is a pre- or post-modified Effective Address.
  4. Stack must remain long word aligned. Consequently, [W15++] AWB is only permitted for use with long word MAC-class instructions.
I-Words:1
Cycles:1
Example:1MSC.L [W6]-=4, [W7]-=4, A, W7; Multiply [W6]*[W7] and subtract theresult from ACCA ; W6 Post-decrement by 4 ;Post-decrement W7 by 4 ; CORCON = 0x0001 (integer multiply, no saturation)
Before InstructionAfter Instruction
W64C00 0000W6 4BFC 0000
W74800 0000W748FC 0000
W80C00 0000W80BFC 0000
ACCA00 0567 8000 0000 0000ACCA00 3738 5ED0 0000 0000
Data4C00 9051 0000Data4BFC D309 0000
Data4800 7230 0000Data48FC 100B 0000
CORCON0001CORCON0001
SR0000SR0000
Example:2MSC.L [W4+=12], [W5+w12], B, [W13] ; Multiply W4*W5 and subtract the resultfrom ACCB ; Fetch [W11+W12] to W5 ; Write Back ACCA to W13 ; CORCON = 0x0000 (fractional multiply, no saturation)
Before InstructionAfter Instruction
W44000W4 4000
W55000W55000
W120800W120800
W136233 1356W133738 5ED0
ACCA00 3738 5ED0 0000 0000ACCA00 3738 5ED0 0000 0000
ACCB00 1000 0000 0000 0000ACCB00 0EC0 0000 0000 0000
Data4800 0500 0000Data4800 0500 0000
Data5800 2000 0000Data5800 2000 0000
CORCON0000CORCON0000
SR0000SR0000
MULMultiply f by Wn
Syntax:{label:}MUL.bf,Wns
MUL{.w}
MUL.l
Operands:f ∈ [0 ... 64KB]; Wn ∈ [W0 ... W14]
Operation:If Byte mode:
(Wn)[7:0] * (f)[7:0] → 16’b0, W2[15:0].

If Word mode:

(Wn)[15:0] * (f)[15:0] → W2

If Long Word mode:

(Wn) * (f) → W2

Status Affected:None
Encoding:1011101LssssffffffffffffffffBU01
Description:Unsigned integer multiply of Wn and the file register, then write the result to the default destination register W2.

For long word operations, the LS 32-bits of the 64-bit result is written to W2.

The ‘L’ and ‘B’ bits select operation data width.

The ‘f’ bits select the address of the file register.

I-Words:1
Cycles:1
MULISS/MULFSS Signed-Signed Multiply to Accumulator
Syntax:{label:}MULISS.w Wb,Ws,A
MULFSS.w[Ws],B
MULISS.l[Ws++],
MULFSS.l[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]
Operation:Signed (Wb) * signed (Ws) → ACC(A or B)[63:0]

8{ACC(A or B)[63]} → ACC(A or B)[71:64]

Status Affected:None
Encoding:1111100LwwwwsssspppAUUUUUUUU I010
Description:Performs word or long word integer (MULISS) or fractional (MULFSS) multiply of the signed contents of Wb and Ws. The source operands are interpreted as a two’s-complement signed values.

For MULISS.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULFSS.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared.

For MULISS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULFSS.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared.

The ‘L bit selects word or long word operation.

The ‘I’ bit selects between integer and fractional operation.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘p’ bits select the source addressing mode.

Note: The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
I-Words:1
Cycles:1
MULISU/MULFSU Signed-Unsigned Multiply to Accumulator
Syntax:{label:}MULISU.w Wb,Ws,A
MULFSU.w[Ws],B
MULISU.l[Ws++],
MULFSU.l[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]
Operation:signed (Wb) * unsigned (Ws) → ACC(A or B)[63:0]

8{ACC(A or B)[63]} → ACC(A or B)[71:64]

Status Affected:None
Encoding:1111101LwwwwsssspppAUUUUUUUU I110
Description:Performs a word or long word integer (MULISU) or fractional (MULFSU) multiply of the signed contents of Wb and unsigned contents of Ws. Wb is interpreted as a two’s-complement signed value.

For MULISU.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULFSU.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared.

For MULISU.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULFSU.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared.

The ‘L bit selects word or long word operation.

The ‘I’ bit selects between integer and fractional operation.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. An unsigned fractional operand includes one integer bit (i.e., can be up to 1.999...). Consequently, the mixed sign fractional result includes one integer bit (i.e., can be up to 1.999...). Results equal to, or in excess of, the range +/-1.0 may require normalization before subsequent use.
I-Words:1
Cycles:1
MULISU/MULIUU Signed/Unsigned - Unsigned Literal Multiply to Accumulator
Syntax:{label:}MULISU.w Ws,lit8,A
MULIUU.w [Ws],B
MULISU.l[Ws++],
MULIUU.l[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; lit8 ∈ [0 ... 255]
Operation:MULISU: signed (Ws) * unsigned lit8 → ACC(A or B)[63:0]
 8{ACC(A or B)[63]} → ACC(A or B)[71:64]

MULIUU: unsigned (Ws) * unsigned lit8 → ACC(A or B)[63:0]

8’b00 → ACC(A or B)[71:64]

Note: The literal is zero-extended to the selected data size of the operation

Status Affected:None
Encoding:1111111LUUUUsssspppAkkkkkkkk1V10
Description:Performs a word or long word integer multiply of the signed (MULISU) or unsigned (MULIUU) contents of Ws and unsigned lit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value.

For MULISU.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULIUU.l, the 64-bit result will be zero-extended and written to ACCx[71:0].

For MULISU.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULIUU.w, the 32-bit result will be zero-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

The ‘L bit selects word or long word operation.

The ‘V’ bit selects between a signed or unsigned Ws value.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘p’ bits select the source addressing mode.

The ‘k’ bits determine the 8-bit literal value.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. Fractional mode is not supported for these instructions.
I-Words:1
Cycles:1
MULIUU/MULFUU Unsigned-Unsigned Multiply to Accumulator
Syntax:{label:}MULIUU.w Wb,Ws,A
MULFUU.w[Ws],B
MULIUU.l[Ws++],
MULFUU.l[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]
Operation:unsigned (Wb) * unsigned (Ws) → ACC(A or B)[63:0]

8’h00 → ACC(A or B)[71:64]


Status Affected:None
Encoding:1111101LwwwwsssspppAUUUUUUUU I010
Description:Performs a word or long word integer (MULIUU) or fractional (MULFUU) multiply of the unsigned contents of Wb and unsigned contents of Ws (see Note 2).

For MULIUU.l, the 64-bit result will be zero-extended and written to ACCx[71:0].

For MULFUU.l, the 64-bit result will be zero-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared.

For MULIUU.w, the 32-bit result will be zero-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULFUU.w, the 32-bit result will be zero-extended, shifted left by 33 bits (to align the result and accumulator fractional points) and written to ACCx[71:33]. ACCx[32:0] will always be cleared.

The ‘L bit selects word or long word operation.

The ‘I’ bit selects between integer and fractional operation.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. An unsigned fractional operand includes one integer bit (i.e., can be up to 1.999...). Consequently, the unsigned fractional result includes two integer bits (i.e., can be up to 3.999...). Results greater than or equal to 1.0 may require normalization before subsequent use.
I-Words:1
Cycles:1
MULIUS/MULFUS Unsigned-Signed Multiply to Accumulator
Syntax:{label:}MULIUS.w Wb,Ws,A
MULFUS.w[Ws],B
MULIUS.l[Ws++],
MULFUS.l[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]
Operation:unsigned (Wb) * signed (Ws) → ACC(A or B)[63:0]

8{ACC(A or B)[63]} → ACC(A or B)[71:64]


Status Affected:None
Encoding:1111100LwwwwsssspppAUUUUUUUU I110
Description:Performs a word or long word integer (MULIUS) or fractional (MULFUS) multiply of the unsigned contents of Wb and signed contents of Ws (see Note 2).

For MULIUS.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULFUS.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared.

For MULIUS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULFUS.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared.

The ‘L bit selects word or long word operation.

The ‘I’ bit selects between integer and fractional operation.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. An unsigned fractional operand includes one integer bit (i.e., can be up to 1.999...). Consequently, the mixed sign fractional result includes one integer bit (i.e., can be up to 1.999...). Results equal to, or in excess of, the range +/-1.0 may require normalization before subsequent use.
I-Words:1
Cycles:1
MULISS/MULIUS Signed/Unsigned-Signed Literal Multiply to Accumulator
Syntax:{label:}MULISS.w Ws,slit8,A
MULIUS.w [Ws],B
MULISS.l[Ws++],
MULIUS.l[Ws--],
[++Ws],
[--Ws],
Operands:Ws ∈ [W0 ... W15]; slit8 ∈ [-128 ... 127]
Operation:MULxUS : unsigned (Ws) * signed slit8 → ACC(A or B)[63:0]

MULxSS : signed (Ws) * signed slit8 → ACC(A or B)[63:0]

8{ACC(A or B)[63]} → ACC(A or B)[71:64]


Note: The literal is sign-extended to the selected data size of the operation
Status Affected:None
Encoding:1111110LUUUUsssspppAkkkkkkkk1V10
Description:Performs a word or long word integer multiply of the signed (MULISS) or unsigned (MULIUS) contents of Ws and signed slit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value.

For MULISS.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULIUS.l, the 64-bit result will be sign-extended and written to ACCx[71:0].

For MULISS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

For MULIUS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result.

The ‘L bit selects word or long word operation.

The ‘V’ bit selects between a signed or unsigned Ws value.

The ‘A’ bit selects the destination accumulator.

The ‘s’ bits select the source register.

The ‘p’ bits select the source addressing mode.

The ‘k’ bits determine the 8-bit literal value.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. Fractional mode is not supported for these instructions.
I-Words:1
Cycles:1
MULSS/MULUS Signed/Unsigned-Signed Literal Integer Multiply
Syntax:{label:}MULSS.dWs,slit8,Wnd
MULSS.l [Ws],
MULSS.w [Ws++],
MULUS.d[Ws--],
MULUS.l [++Ws],
MULUS.w [--Ws],
Operands:Ws ∈ [W0 ... W15]; slit8 ∈ [-128 ... 127]; Wnd ∈ [W0 ... W14]
Operation:MULSS.d : signed (Ws) * signed slit8 → {Wnd+1[31:0], Wnd[31:0]}

MULSS.l : signed (Ws) * signed slit8 → {Wnd[31:0]}

MULSS.w : signed (Ws[15:0]) * signed slit8 → {Wnd[31:0]}

MULUS.d : unsigned (Ws) * signed slit8 → {Wnd+1[31:0], Wnd[31:0]}

MULUS.l : unsigned (Ws) * signed slit8 → {Wnd[31:0]}

MULUS.w : unsigned (Ws[15:0]) * signed slit8 → {Wnd[31:0]}

Note: The literal is sign-extended to the selected data size of the operation

Status Affected:None
Encoding:1111010LddddsssspppEkkkkkkkk0V10
Description:Performs a 32-bit x 32-bit or a 16-bit x 16-bit integer multiply of the signed or unsigned contents of Ws and sign-extended slit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value.

For MULSS.d and MULUS.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Ws and sign-extended slit8 is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULSS.l and MULUS.l (L = 1, E = 0), a 32-bit x 32-bit multiply of Ws and sign-extended slit8 is executed. The LS 32-bits of the 64-bit result will be written to Wnd.

For MULSS.w and MULUS.w (L = 0, E = 0), a 16-bit x 16-bit multiply of the lsw of Ws and sign-extended slit8 is executed. The result will be 32-bits and is written to Wnd.

The ‘L’ bit selects the operand date size.

The ‘V’ bit selects between a signed or unsigned Ws value.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘k’ bits determine the 8-bit literal value.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. For 32-bit result writes, user is responsible to ensure that the result does not overflow into the sign bit, Wnd[31].
I-Words:1
Cycles:1
MULSS Signed-Signed Integer Multiply
Syntax:{label:}MULSS.dWb,Ws,Wnd
MULSS.l[Ws],
MULSS.w[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation:MULSS.d : signed (Wb) * signed (Ws) → {Wnd+1[31:0], Wnd[31:0]}

MULSS.l : signed (Wb) * signed (Ws) → {Wnd[31:0]}

MULSS.w : signed (Wb[15:0]) * signed (Ws[15:0]) → {Wnd[31:0]}

Status Affected:None
Encoding:S001010LddddsssspppEUUwwwwUU0000
Description:Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed contents of Wb and Ws.

For MULSS.d (L=1, E=1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULSS.l (L=1, E=0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the 64-bit result will be written to Wnd.

For MULSS.w (L=0, E=0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd.

Both source operands are interpreted as two’s-complement integer signed values.

The ‘S’ bit selects instruction size.

The ‘L’ bit selects the operand data size.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. For 32-bit result writes, user is responsible to ensure that the result does not overflow into the sign bit, Wnd[31].
I-Words:1 or 0.5
Cycles:1
MULSU Signed-Unsigned Integer Multiply
Syntax:{label:}MULSU.dWb,Ws,Wnd
MULSU.l[Ws],
MULSU.w[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation:MULSU.d : signed (Wb) * unsigned (Ws) → {Wnd+1[31:0], Wnd[31:0]}

MULSU.l : signed (Wb) * unsigned (Ws) → {Wnd[31:0]}

MULSU.w : signed (Wb[15:0]) * unsigned (Ws[15:0]) → {Wnd[31:0]}

Status Affected:None
Encoding:1001011LddddsssspppEUUwwwwUU0100
Description:Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed contents of Wb and unsigned contents of Ws. Wb is interpreted as a two’s-complement signed value.

For MULSU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULSU.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd.

For MULSU.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd.

The ‘L’ bit selects the operand date size.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US in CORCON) has no effect upon the operation of this instruction.
  2. For 32-bit result writes, user is responsible to ensure that the result does not overflow into the sign bit, Wnd[31].
I-Words:1
Cycles:1

Example 1:

MUL.SU  W8, [W9], W0    ; Multiply W8*[W9]   ; Store the result to W0:W1

Before Instruction

After Instruction

W0

68DC

W0

0000

W1

AA40

W1

F100

W8

F000

W8

F000

W9

178C

W9

178C

Data 178C

F000

Data 178C

F000

SR

0000

SR

0000

Example 2:

MUL.SU  W2, [++W3], W4  ; Pre-Increment W3 ; Multiply W2*[W3] ; Store the result to W4:W5

Before Instruction

After Instruction

W2

0040

W2

0040

W3

0280

W3

0282

W4

1819

W4

1A00

W5

2021

W5

0000

Data 0282

0068

Data 0282

0068

SR

0000

SR

0000

MULSU/MULUU Signed/Unsigned-Unsigned Short Literal Integer Multiply
Syntax:{label:}MULSU.dWs,lit8,Wnd
MULSU.l [Ws],
MULSU.w [Ws++],
MULUU.d [Ws--],
MULUU.l [++Ws],
MULUU.w [--Ws],
Operands:Ws ∈ [W0 ... W15]; lit8 ∈ [0...255]; Wnd ∈ [W0 ... W14]
Operation:MULSU.d : signed (Ws) * unsigned lit8 → {Wnd+1[31:0], Wnd[31:0]}

MULSU.l : signed (Ws) * unsigned lit8 → {Wnd[31:0]}

MULSU.w : signed (Ws[15:0]) * unsigned lit8 → {Wnd[31:0]}

MULUU.d : unsigned (Ws) * unsigned lit8 → {Wnd+1[31:0], Wnd[31:0]}

MULUU.l : unsigned (Ws) * unsigned lit8 → {Wnd[31:0]}

MULUU.w : unsigned (Ws[15:0]) * unsigned lit8 → {Wnd[31:0]}

Note: The literal is zero-extended to the selected data size of the operation

Status Affected:None
Encoding:1111011LddddsssspppEkkkkkkkk0V10
Description:Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed or unsigned contents of Ws and unsigned lit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value.

For MULSU.d and MULUU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Ws and zero-extended lit8 is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULSU.l and MULUU.l (L = 1, E = 0), a 32-bit x 32-bit multiply of Ws and zero-extended lit8 is executed. The LS 32-bits of the 64-bit result will be written to Wnd.

For MULSU.w and MULUU.w (L = 0, E = 0), a 16-bit x 16-bit multiply of the lsw of Ws and zero-extended lit8 is executed. The result will be 32-bits and is written to Wnd.

The ‘L’ bit selects the operand date size.

The ‘V’ bit selects between a signed or unsigned Ws value.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

The ‘k’ bits determine the 8-bit literal value.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. For signed 32-bit result writes, user is responsible to ensure that the result does not overflow into the sign bit, Wnd[31].
I-Words:1
Cycles:1
MULUS Unsigned-Signed Integer Multiply
Syntax:{label:}MULUS.dWb,Ws,Wnd
MULUS.l[Ws],
MULUS.w[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation:MULUS.d : unsigned (Wb) * signed (Ws) → {Wnd+1[31:0], Wnd[31:0]}

MULUS.l : unsigned (Wb) * signed (Ws) → {Wnd[31:0]}

MULUS.w : unsigned (Wb[15:0]) * signed (Ws[15:0]) → {Wnd[31:0]}

Status Affected:None
Encoding:1001010LddddsssspppEUUwwwwUU0100
Description:Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the unsigned contents of Wb and signed contents of Ws. Ws is interpreted as a two’s-complement signed value.

For MULUS.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULUS.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd.

For MULUS.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd.

The ‘L’ bit selects the operand date size.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
  2. For 32-bit result writes, user is responsible to ensure that the result does not overflow into the sign bit, Wnd[31].
I-Words:1
Cycles:1
MULUU Unsigned-Unsigned Integer Multiply
Syntax:{label:}MULUU.dWb,Ws,Wnd
MULUU.l[Ws],
MULUU.w[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands:Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14]
Operation:MULUU.d : unsigned (Wb) * unsigned (Ws) → {Wnd+1[31:0], Wnd[31:0]}

MULUU.l : unsigned (Wb) * unsigned (Ws) → {Wnd[31:0]}

MULUU.w : unsigned (Wb[15:0]) * unsigned (Ws[15:0]) → {Wnd[31:0]}

Status Affected:None
Encoding:S001011LddddsssspppEUUwwwwUU0000
Description:Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the unsigned contents of Wb and Ws.

For MULUU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd.

For MULUU.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd.

For MULUU.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd.

The ‘S’ bit selects instruction size.

The ‘L’ bit selects the operand date size.

The ‘E’ bit selects between a 32-bit and 64-bit result write.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

The ‘p’ bits select the source addressing mode.

Note:
  1. The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction.
I-Words:1 or 0.5
Cycles:1