13.07.2015 Views

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The <strong>Cortex</strong>-<strong>M0+</strong> Instruction Set3.5.8 SXT and UXTSign extend and Zero extend.SyntaxSXTB Rd, RmSXTH Rd, RmUXTB Rd, RmUXTH Rd, Rmwhere:RdRmIs the destination register.Is the register holding the value to be extended.OperationThese instructions extract bits from the resulting value:• SXTB extracts bits[7:0] and sign extends to 32 bits• UXTB extracts bits[7:0] and zero extends to 32 bits• SXTH extracts bits[15:0] and sign extends to 32 bits• UXTH extracts bits[15:0] and zero extends to 32 bits.RestrictionsIn these instructions, Rd and Rm must only specify R0-R7.Condition flagsThese instructions do not affect the flags.ExamplesSXTH R4, R6 ; Obtain the lower halfword of the; value in R6 and then sign extend to; 32 bits and write the result to R4.UXTB R3, R1 ; Extract lowest byte of the value in R1 and zero; extend it, and write the result to R3ARM DUI 0662A Copyright © 2012 ARM. All rights reserved. 3-31ID041812Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!