Keil Logo

Shift operators

7.23 Shift operators

Shift operators act on numeric expressions, by shifting or rotating the first operand by the amount specified by the second.

The following table shows the shift operators:

Table 7-5 Shift operators

Operator
Alias
Usage
Explanation
:ROL:
 
A:ROL:B
Rotate A left by B bits
:ROR:
 
A:ROR:B
Rotate A right by B bits
:SHL:
<<
A:SHL:B
Shift A left by B bits
:SHR:
>>
A:SHR:B
Shift A right by B bits

Note

SHR is a logical shift and does not propagate the sign bit.
Related concepts
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.