Hi all I write a sample code like a = 1 << b; when b = 0 , The result for a will get 2 If I uncheck "Enable ANSI integer promotion rules " ,It will get correct answer 1 can anyone tell me why ?? Thanks a lot
The section of your code that does the shifting is this bit:
0024 7401 MOV A,#01H 0026 A807 MOV R0,AR7 0028 08 INC R0 0029 8002 SJMP ?C0181 002B ?C0180: 002B C3 CLR C 002C 33 RLC A 002D ?C0181: 002D D8FC DJNZ R0,?C0180 002F FF MOV R7,A
Thank to Graham I also think the asm code is fine, but I realy got a wrong answer >< maybe I have setting something wrong。 For now,I just use switch-case to do this sample work.