EasyManuals Logo
Home>ST>Computer Hardware>STM32H7 Series

ST STM32H7 Series User Manual

ST STM32H7 Series
262 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #129 background imageLoading...
Page #129 background image
PM0214 Rev 9 129/262
PM0214 The STM32 Cortex-M4 instruction set
261
; of R2, saturates to 16 bits, writes to corresponding
; halfword of R4
QSUB8 R4, R2, R5 ; Subtracts bytes of R5 from the corresponding byte in R2
; saturates to 8 bits, writes to corresponding byte ofR4.
3.7.4 QASX and QSAX
Saturating Add and Subtract with Exchange and Saturating Subtract and Add with
Exchange, signed.
Syntax
op{cond} {Rd}, Rm, Rn
Where:
• op’ is one of:
QASX Add and Subtract with Exchange and Saturate.
QSAX Subtract and Add with Exchange and Saturate.
• ‘cond’ is an optional condition code (see Conditional execution on page 65)
• ‘Rd’ is the destination register.
• ‘Rn, Rm’ are registers holding the first and second operands.
Operation
The QASX instruction:
1. Adds the top halfword of the source operand with bottom halfword of second operand.
2. Subtracts the top halfword of second operand from bottom highword of first operand.
3. Saturates the result of the subtraction and writes a 16-bit signed integer in the range –
2
15
≤ x ≤ 2
15
– 1, where x equals 16, to the bottom halfword of the destination register.
4. Saturates the results of the sum and writes a 16-bit signed integer in the range
5. –2
15
≤ x ≤ 2
15
– 1, where x equals 16, to the top halfword of the destination register.
The QSAX instruction:
1. Subtracts the bottom halfword of second operand from top highword of first operand.
2. Adds the bottom halfword of source operand with top halfword of second operand.
3. Saturates the results of the sum and writes a 16-bit signed integer in the range
4. –2
15
≤ x ≤ 2
15
– 1, where x equals 16, to the bottom halfword of the destination register.
5. Saturates the result of the subtraction and writes a 16-bit signed integer in the range –
2
15
≤ x ≤ 2
15
– 1, where x equals 16, 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.
Examples
QASX R7, R4, R2 ; Adds top halfword of R4 to bottom halfword of R2,
; saturates to 16 bits, writes to top halfword of R7

Table of Contents

Other manuals for ST STM32H7 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32H7 Series and is the answer not in the manual?

ST STM32H7 Series Specifications

General IconGeneral
BrandST
ModelSTM32H7 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals