We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all.
Does it possible to use local C-vars in "#pragma asm" block? I mean something like this:
void Foo(void) { BYTE t; #pragma asm mov r0, t; // error A45: UNDEFINED SYMBOL ...
"sometimes external assembler subroutine is too expensive (parameters, call/ret)"
In that case, particularly given all the other issues already noted with C51 inline assembler, expand the assembler part to a suitable extent where the overhead is no longer significant!
"I use inline asm for more effective bit operations"
In what way do you find the C51 implementation of bit operations ineffective?
"Additional benefit is "all code in full view" (no additional files)."
That's not exactly true: there is an additional file - it's the .SRC file. And this is the one you have to use for debug
Not C51 but limitations of bitwise operations in C (for example, there is no circular shift).
Alex.
Actually, in C51 there is. Go look up _crol_ and friends in the manual.