Multiplication Instructions
Instruction | Description |
---|---|
MUL.B | Integer unsigned byte multiply F and WREG0 |
MUL{.W} | Integer unsigned word multiply F and WREG0 |
MULL.SS | Integer 16x16 Signed multiply |
MULL.US | Integer 16x16 Unsigned-Signed Multiply |
MULL.UU | Integer 16x16 Unsigned Multiply |
MULL.UU | Integer 16x16 Unsigned-Unsigned Short Literal Multiply |
MULL.SU | Integer 16x16 Signed-Unsigned Short Literal Multiply |
- WREG Multiply ( MUL.B or MUL.W)
- Always uses WREG0 and any file register
- Supports 8x8 multiply, generates 16-bit product
- Results stored in W2 ( MUL.B ) or W3:W2 (MUL.W)
- Provides PIC® MCU backward compatibility
- 16-bit Integer Multiplication
- Unsigned, Signed modes support W * W multiplies
- MUL.UU, MUL.SS,
- Mixed mode – supports W * short (5-bit) literal multiplies
- MUL.US and MUL.SU
- 32-bit Product is stored in adjacent working registers
- W1:W0, W3:W2, … , W13:W12
- Unsigned, Signed modes support W * W multiplies
MUL Example
MUL = file * WREG0 so therefore a file location must be used.
MUL.SS Example
MUL.SS can multiply two WREGs, and the second operand can be used as a pointer if desired. That is, you can have an instruction of the form mul.ss w0, [w1], w2