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.
what's the function of "AREGS"and "NOAREGS", can you provide me some sample, so that I could understand them clear. Are them still useful in current updated versions. In the manual it is said that with "NOAREGS" the function could be called by another functions using different register bank.
#pragma NOAREGS char add(char i) { return i+10; } void main(void) using 1 { ch = add(3); }
Having a look at this note in Manual: "The Cx51 compiler does not and cannot detect a register bank mismatch between functions. Therefore, make sure that functions using alternate register banks call only other functions that do not assume a default register bank." I think it is true, so for the above mentioned warning the adjective "missing" is at least disputable. Realize that compile time and run time are different things and the compiler (compile time) doesn't necessarily know the actual RB of a function at run time in general. Sometimes it is up to you to judge and decide. That's why I suggested: don't use using directive with common functions unless you have a really important reason for it (ISR, etc.)
Please look at discussion thread 1807 http://www.keil.com/forum/docs/thread1807.asp