| |||

Home > The Cortex-M7 Instruction Set > Packing and unpacking instructions > SXTA and UXTA |

Signed and Unsigned Extend and Add.

{`op`

} {`cond`

,}`Rd`

,`Rn`

{, ROR #`Rm`

}`n`

Where:

`op`

Is one of:

`SXTAB`

Sign extends an 8‑bit value to a 32‑bit value and add.

`SXTAH`

Sign extends a 16‑bit value to a 32‑bit value and add.

`SXTAB16`

Sign extends two 8-bit values to two 16-bit values and add.

`UXTAB`

Zero extends an 8‑bit value to a 32‑bit value and add.

`UXTAH`

Zero extends a 16‑bit value to a 32‑bit value and add.

`UXTAB16`

Zero extends two 8-bit values to two 16-bit values and add.

`cond`

Is an optional condition code. See

*Conditional execution*.`Rd`

Is the destination register. If

is omitted, the destination register is`Rd`

.`Rn`

`Rn`

Is the first operand register.

`Rm`

Is the register holding the value to rotate and extend.

`ROR #`

`n`

Is one of:

`ROR #8`

Value from

is rotated right 8 bits.`Rm`

`ROR #16`

Value from

is rotated right 16 bits.`Rm`

`ROR #24`

Value from

is rotated right 24 bits.`Rm`

If

is omitted, no rotation is performed.`ROR #`

`n`

These instructions do the following:

Rotate the value from

right by 0, 8, 16 or 24 bits.`Rm`

Extract bits from the resulting value:

`SXTAB`

extracts bits[7:0] fromand sign extends to 32 bits.`Rm`

`UXTAB`

extracts bits[7:0] fromand zero extends to 32 bits.`Rm`

`SXTAH`

extracts bits[15:0] fromand sign extends to 32 bits.`Rm`

`UXTAH`

extracts bits[15:0] fromand zero extends to 32 bits.`Rm`

`SXTAB16`

extracts bits[7:0] fromand sign extends to 16 bits, and extracts bits [23:16] from`Rm`

and sign extends to 16 bits.`Rm`

`UXTAB16`

extracts bits[7:0] fromand zero extends to 16 bits, and extracts bits [23:16] from`Rm`

and zero extends to 16 bits.`Rm`

Adds the signed or zero extended value to the word or corresponding halfword of

and writes the result in`Rn`

.`Rd`