1

I have read tons of similar questions about this stuff here but still can't solve my problem. I need to use this piece of assembly code in C file:

unsigned char * led = (char *) 0xC0;
for (int i = 0; i < 10; i++)
{
  __asm
    {
      ror [led[i]],1
    };    
}

I just need to rotate all values in led variable by 1 bit. While using this code I get an Factor expected error. When i remove [] brackets around led value, it is end of line expected error. Strange thing is the code bellow works perfectly:

  __asm
    {
      nop
    };

As you can see these samples look very similar but there is only one working properly. What am I doing wrong? If it is relevant i try to make an easy application in CodeWarrior, which is IDE for embedded software development.

user7303261
  • 128
  • 12

0 Answers0