118
SAM4CP [DATASHEET]
43051E–ATPL–08/14
The UADD8 instruction:
1.
2.
Adds each byte of the first operand to the corresponding byte of the second operand.
Writes the unsigned result in the corresponding byte of the destination register.
Restrictions
Do not use SP and do not use PC
.
Condition Flags
These instructions do not change the flags.
Examples
UADD16 R1, R0 ; Adds halfwords in R0 to corresponding halfword of R1,
; writes to corresponding halfword of R1
UADD8 R4, R0, R5 ; Adds bytes of R0 to corresponding byte in R5 and
; writes to corresponding byte in R4.
12.6.5.17 UASX and USAX
Add and Subtract with Exchange and Subtract and Add with Exchange.
Syntax
op{cond
} {
Rd
},
Rn
,
Rm
where:
op
is one of:
UASX Add and Subtract with Exchange.
USAX Subtract and Add with Exchange.
cond
is an optional condition code, see
“Conditional Execution”
.
Rd
is the destination register.
Rn, Rm
are registers holding the first and second operands.
Operation
The UASX instruction:
1.
2.
3.
4.
Subtracts the top halfword of the second operand from the bottom halfword of the first operand.
Writes the unsigned result from the subtraction to the bottom halfword of the destination register.
Adds the top halfword of the first operand with the bottom halfword of the second operand.
Writes the unsigned result of the addition to the top halfword of the destination register.
The USAX instruction:
1.
2.
3.
4.
Adds the bottom halfword of the first operand with the top halfword of the second operand.
Writes the unsigned result of the addition to the bottom halfword of the destination register.
Subtracts the bottom halfword of the second operand from the top halfword of the first operand.
Writes the unsigned result from the subtraction to the top halfword of the destination register.
Restrictions
Do not use SP and do not use PC
.
Condition Flags
These instructions do not affect the condition code flags.