This line:
thresBits = _crol_(thresBits, 2);
generates this SRC:
MOV R7,thresBits?1282 MOV R0,#02H MOV A,R7 INC R0 SJMP ?C0198 ?C0197: RL A ?C0198: DJNZ R0,?C0197 MOV thresBits?1282,A
I have added a "#pragma asm" to manually change the assembly to this:
#pragma asm MOV A, thresBits RL A ;rotate once RL A ;rotate the 2nd time MOV thresBits, A #pragma endasm
but I get "error A45: UNDEFINED SYMBOL". How do I access the local C thresBits variable in my inline assembly code?
Regarding the function, my thought was the overhead added by a function call would negate the speed increase from using assembly since it's such a small routine.
I did consider rewriting the loop in assembly. I felt my time was better spent elsewhere in the program, as my task list is still fairly long. My assembly isn't that hot either.