Jump to main content
MPLAB XC-DSC C Compiler User's Guide
MPLAB XC-DSC C Compiler User's Guide
  1. Home
  2. 4 How To's
  3. 4.4 Getting My Application to Do What I Want
  4. 4.4.8 How Can I Rotate a Variable?

  • Notice to Development Tools Customers
  • 1 Preface
  • 2 Compiler Overview
  • 3 Compiler and Other Development Tools
  • 4 How To's
    • 4.1 Installing and Activating the Compiler
    • 4.2 Invoking the Compiler
    • 4.3 Writing Source Code
    • 4.4 Getting My Application to Do What I Want
      • 4.4.1 How Do I Generate Debug Information?
      • 4.4.2 Why No Disassembly in the MPLAB X IDE Disassembly Window?
      • 4.4.3 How Do I Share Data Between Interrupt and Main-line Code?
      • 4.4.4 How to Protect My Code After It Is Programmed Into a Device?
      • 4.4.5 How Do I Redirect Standard I/O When Using Printf?
      • 4.4.6 How Do I Place Variables in Off-Chip Memory?
      • 4.4.7 How Can I Implement a Delay in My Code?
      • 4.4.8 How Can I Rotate a Variable?
    • 4.5 Understanding the Compilation Process
    • 4.6 Fixing Code That Does Not Work
  • 5 XC-DSC Toolchain and MPLAB® X IDE
  • 6 Compiler Command-Line Driver
  • 7 Device-Related Features
  • 8 Differences Between MPLAB® XC-DSC and C Standard
  • 9 Supported Data Types and Variables
  • 10 Fixed-Point Arithmetic Support - dsPIC33C/E/F and dsPIC30 Only
  • 11 Memory Allocation and Access
  • 12 Operators and Statements
  • 13 Register Usage
  • 14 Functions
  • 15 Interrupts
  • 16 Main, Runtime Startup and Reset
  • 17 Mixing C and Assembly Code
  • 18 Library Routines
  • 19 Optimizations
  • 20 Preprocessing
  • 21 Linking Programs
  • 22 Implementation-Defined Behavior
  • 23 Embedded Compiler Compatibility Mode
  • 24 Common C Interface
  • 25 Diagnostic Pragmas
  • 26 Diagnostic Messages
  • 27 GNU Free Documentation License
  • 28 Built-in Functions
  • 29 Document Revision History
  • The Microchip Website
  • Product Change Notification Service
  • Customer Support
  • Product Identification System
  • Microchip Devices Code Protection Feature
  • Legal Notice
  • Trademarks
  • Quality Management System
  • Worldwide Sales and Service

4.4.8 How Can I Rotate a Variable?

The C language does not have a rotate operator, but rotations can be performed using the shift and bitwise OR operators. For more information, refer to the following sections:

Bitwise Operations on Signed Values (CCI)

Right-Shifting Signed Values (CCI - Signed variables)

About

Company
Careers
Contact Us
Media Center
Investor Relations
Corporate Responsibility

Support

Microchip Forums
AVR Freaks
Design Help
Technical Support
Export Control Data
PCNs

Quick Links

microchipDIRECT.com
Microchip University
myMicrochip
Blogs
Reference Designs
Parametric Search
Microchip Logo

Microchip Technology Inc.

2355 West Chandler Blvd.

Chandler, Arizona, USA

Microchip Facebook
Microchip LinkedIn
Microchip Twitter
Microchip Instagram
Microchip Weibo

© Copyright 1998-2024 Microchip Technology Inc. All rights reserved. Shanghai ICP Recordal No.09049794

Terms Of Use
Privacy Notice
Legal
Your Privacy Choices California Consumer Privacy Act (CCPA) Opt-Out Icon