![ARM Cortex-M4 Generic User Manual Download Page 119](http://html.mh-extra.com/html/arm/cortex-m4/cortex-m4_generic-user-manual_2973228119.webp)
The Cortex-M4 Instruction Set
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
3-72
ID121610
Non-Confidential
3.5.23
USADA8
Unsigned Sum of Absolute Differences and Accumulate.
Syntax
USADA8{
cond
}{
Rd
,}
Rn
,
Rm
,
Ra
where:
cond
Is an optional condition code, see
.
Rd
Specifies the destination register.
Rn
Specifies the first operand register.
Rm
Specifies the second operand register.
Ra
Specifies the register that contains the accumulation value.
Operation
The
USADA8
instruction:
1.
Subtracts each byte of the second operand register from the corresponding byte of the first
operand register.
2.
Adds the unsigned absolute differences together.
3.
Adds the accumulation value to the sum of the absolute differences.
4.
Writes the result to the destination register.
Restrictions
Do not use SP and do not use PC
.
Condition flags
These instructions do not change the flags.
Examples
USADA8 R1, R0, R6 ; Subtracts bytes in R0 from corresponding halfword of R1
; adds differences, adds value of R6, writes to R1
USADA8
R4, R0, R5, R2 ; Subtracts bytes of R5 from corresponding byte in R0
; adds differences, adds value of R2 writes to R4.