120
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.6.5.11
SHASX and SHSAX
Signed Halving Add and Subtract with Exchange and Signed Halving Subtract and Add with
Exchange.
Syntax
op{cond} {Rd}, Rn, Rm
where:
Operation
The
SHASX
instruction:
1.
Adds the top halfword of the first operand with the bottom halfword of the second
operand.
2.
Writes the halfword result of the addition to the top halfword of the destination register,
shifted by one bit to the right causing a divide by two, or halving.
3.
Subtracts the top halfword of the second operand from the bottom highword of the first
operand.
4.
Writes the halfword result of the division in the bottom halfword of the destination regis-
ter, shifted by one bit to the right causing a divide by two, or halving.
The
SHSAX
instruction:
1.
Subtracts the bottom halfword of the second operand from the top highword of the first
operand.
2.
Writes the halfword result of the addition to the bottom halfword of the destination regis-
ter, shifted by one bit to the right causing a divide by two, or halving.
3.
Adds the bottom halfword of the first operand with the top halfword of the second
operand.
4.
Writes the halfword result of the division in the top halfword of the destination register,
shifted by one bit to the right causing a divide by two, or halving.
Restrictions
Do not use SP and do not use PC
.
Condition Flags
These instructions do not affect the condition code flags.
Examples
SHASX
R7, R4, R2 ; Adds top halfword of R4 to bottom halfword of R2
; and writes halved result to top halfword of R7
; Subtracts top halfword of R2 from bottom halfword of
; R4 and writes halved result to bottom halfword of R7
SHSAX
R0, R3, R5
; Subtracts bottom halfword of R5 from top halfword
; of R3 and writes halved result to top halfword of R0
op
is any of:
SHASX
Add and Subtract with Exchange and Halving.
SHSAX
Subtract and Add with Exchange and Halving.
cond
is an optional condition code, see
Rd
is the destination register.
Rn, Rm
are registers holding the first and second operands.
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...