The Cortex-M4 Instruction Set
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
3-71
ID121610
Non-Confidential
3.5.22
USAD8
Unsigned Sum of Absolute Differences.
Syntax
USAD8{
cond
}{
Rd
,}
Rn
,
Rm
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.
Operation
The
USAD8
instruction:
1.
Subtracts each byte of the second operand register from the corresponding byte of the first
operand register.
2.
Adds the absolute values of the differences together.
3.
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
USAD8 R1, R4, R0 ; Subtracts each byte in R0 from corresponding byte of R4
; adds the differences and writes to R1
USAD8
R0, R5
; Subtracts bytes of R5 from corresponding byte in R0,
; adds the differences and writes to R0.