This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RL Inquery

Hello Guys .. I am fresh new to using C for 8051 programming. I used to program using Assembly. Since I have been forced to use C for one of my subjects, I started learning ..

However while learning, I tried to use the shift bit wise operation ( << or >> ) and after debugging I found out that it actually uses the RLC instruction of the C51 instruction set and shift the most significant bit to the carry flag. What I want is how to use the instruction RL of the 8051 instruction set in C language without involving the carry flag. Thanks guys.

  • Sorry, it isn't your task to decide what processor instructions the C compiler uses.

    The goal of the compiler is to produce a sequence of processor instructions that fulfills the requirements of the language standard. Have you seen C51-generated code produce results that violates the standard, when using << or >>?

    If you want to decide what instructions to use, then there is the assembler.