ARM7 Programming
Data Processing Instructions MUL Instructions
ARM7 Programming - Instructions1
By
Mr.Vishal S. Gaikwad
Multiplication Instructions
ARM7 Programming - Instructions2
 ARM provides two multiplication instructions
 MUL - Multiply
 MLA - Multiply Accumulate
 UMULL - Unsigned Long Multiply
 UMLAL - Unsigned Long Multiply, with Accumulate
 SMULL - Signed Long Multiply
 SMLAL - Signed Long Multiply, with Accumulate
Multiplication Instructions
ARM7 Programming - Instructions3
 MUL - Multiply
 MUL (Multiply) is the simplest multiplication instruction.
 It multiplies two 32-bit numbers (held in registers) and stores a 32-bit result in a destination register.
 Multiplying two 32-bit numbers together gives rise to a 64-bit number.
 The MUL instruction only stores the lower 32 bits of the product.
 The ARM also has four instructions for multiplying 32-bit numbers together
and retaining all 64 bits of the product, these are,
UMULL, UMLAL, SMULL, SMLAL
MUL, MLA - Instruction Format
ARM7 Programming - Instructions4
Multiply and multiply-accumulate (32-bit by 32-bit, bottom 32-bit result).
MUL, MLA - Instruction Use
ARM7 Programming - Instructions5
MUL, MLA - Example
ARM7 Programming - Instructions6
 MUL R0, R1, R2 ; R0 = R1 * R2
 MLA r10,r2,r1,r5 ; r10= (r1*r2) + r5
 MULS r0,r2,r2
UMULL, UMLAL,SMULL,SMLAL - Instruction Format
ARM7 Programming - Instructions7
Unsigned and signed long multiply and multiply accumulate (32-bit by 32-bit, 64-bit accumulate or result).
UMULL, UMLAL,SMULL,SMLAL - Instruction Use
ARM7 Programming - Instructions8
UMULL, UMLAL,SMULL,SMLAL - Example
ARM7 Programming - Instructions9
 UMULL r0, r4, r5, r6 ; (r4:r0) = r5 * r6
 UMLAL r4, r5, r3, r8 ; (r4:r5) =(r3*r8) + (r5:r4)
 The UMLAL instruction performs a multiplication on unsigned operands Rm and Rs . The 64-bit
result of the multiplication is added to RdLo and RdHi. The sum is written to RdLo and RdHi.
 SMLAL R4, R5, R3, R8 ; (R5:R4) = (R5:R4) + (R3*R8)
 SMULL r0, r4, r5, r6 ; (r4:r0) = r5 * r6
ARM7 Programming - Instructions10
Thank You…..

ARM Instructions

  • 1.
    ARM7 Programming Data ProcessingInstructions MUL Instructions ARM7 Programming - Instructions1 By Mr.Vishal S. Gaikwad
  • 2.
    Multiplication Instructions ARM7 Programming- Instructions2  ARM provides two multiplication instructions  MUL - Multiply  MLA - Multiply Accumulate  UMULL - Unsigned Long Multiply  UMLAL - Unsigned Long Multiply, with Accumulate  SMULL - Signed Long Multiply  SMLAL - Signed Long Multiply, with Accumulate
  • 3.
    Multiplication Instructions ARM7 Programming- Instructions3  MUL - Multiply  MUL (Multiply) is the simplest multiplication instruction.  It multiplies two 32-bit numbers (held in registers) and stores a 32-bit result in a destination register.  Multiplying two 32-bit numbers together gives rise to a 64-bit number.  The MUL instruction only stores the lower 32 bits of the product.  The ARM also has four instructions for multiplying 32-bit numbers together and retaining all 64 bits of the product, these are, UMULL, UMLAL, SMULL, SMLAL
  • 4.
    MUL, MLA -Instruction Format ARM7 Programming - Instructions4 Multiply and multiply-accumulate (32-bit by 32-bit, bottom 32-bit result).
  • 5.
    MUL, MLA -Instruction Use ARM7 Programming - Instructions5
  • 6.
    MUL, MLA -Example ARM7 Programming - Instructions6  MUL R0, R1, R2 ; R0 = R1 * R2  MLA r10,r2,r1,r5 ; r10= (r1*r2) + r5  MULS r0,r2,r2
  • 7.
    UMULL, UMLAL,SMULL,SMLAL -Instruction Format ARM7 Programming - Instructions7 Unsigned and signed long multiply and multiply accumulate (32-bit by 32-bit, 64-bit accumulate or result).
  • 8.
    UMULL, UMLAL,SMULL,SMLAL -Instruction Use ARM7 Programming - Instructions8
  • 9.
    UMULL, UMLAL,SMULL,SMLAL -Example ARM7 Programming - Instructions9  UMULL r0, r4, r5, r6 ; (r4:r0) = r5 * r6  UMLAL r4, r5, r3, r8 ; (r4:r5) =(r3*r8) + (r5:r4)  The UMLAL instruction performs a multiplication on unsigned operands Rm and Rs . The 64-bit result of the multiplication is added to RdLo and RdHi. The sum is written to RdLo and RdHi.  SMLAL R4, R5, R3, R8 ; (R5:R4) = (R5:R4) + (R3*R8)  SMULL r0, r4, r5, r6 ; (r4:r0) = r5 * r6
  • 10.
    ARM7 Programming -Instructions10 Thank You…..