Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet

Product codes
ATSAM4E-XPRO
Page of 1506
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
132
12.6.5.22  USAD8
Unsigned Sum of Absolute Differences
Syntax
USAD8{cond}{Rd,} RnRm
where:
cond
is an optional condition code, see 
.
Rd
is the destination register.
Rn
is the first operand register.
Rm
is 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.