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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The <strong>Cortex</strong>-<strong>M0+</strong> Instruction Set3.5.7 REV, REV16, and REVSHReverse bytes.SyntaxREV Rd, RnREV16 Rd, RnREVSH Rd, Rnwhere:RdRnIs the destination register.Is the source register.OperationUse these instructions to change endianness of data:REVREV16REVSHconverts 32-bit big-endian data into little-endian data or 32-bit little-endian datainto big-endian data.converts two packed 16-bit big-endian data into little-endian data or two packed16-bit little-endian data into big-endian data.converts 16-bit signed big-endian data into 32-bit signed little-endian data or16-bit signed little-endian data into 32-bit signed big-endian data.RestrictionsIn these instructions, Rd, and Rn must only specify R0-R7.Condition flagsThese instructions do not change the flags.ExamplesREV R3, R7 ; Reverse byte order of value in R7 and write it to R3REV16 R0, R0 ; Reverse byte order of each 16-bit halfword in R0REVSH R0, R5 ; Reverse signed halfwordARM DUI 0662A Copyright © 2012 ARM. All rights reserved. 3-30ID041812Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!