From: Jan Waclawek <wek@ef...> - 2007-03-29 17:36:59
I am searching answers to the following questions both in the fora and the
sources (I gave up the documentation, as it gives more questions than
answers...), but maybe somebody can answer me right off:
- in assembler functions, either inline or externally linked, the assumption
is, that no register may be trashed. Correct?
- on the other hand, DPTR, ACC, B may be freely thrashed (provided the
return type is void). Correct?
- therefore, for a register intensive application, I'd like to swap register
banks as a least processing-expensive solution. My assumption is, that in
the declaration, I'd add the "using" attribute (with the appropriate bank
number), together with "naked". I assume, that I still need to provide the
switching code upon entry/exit on my own; but the compiler is aware that the
register bank is in usage and will not assign it to iram/dram/stack or
I am uncertain for the last item, as there are cryptic comments in the
documentation regarding the 'using' attribute. Chapter 3.10 says, "The using
attribute will have no effect on the generated code for a non-interrupt
function (but may occasionally be useful anyway3.3). (pending: Note,
nowadays the using attribute has an effect on the generated code for a
non-interrupt function.)". What is this supposed to mean?
On a similar note, chapter 3.12 says on labels in inline assembler, that "In
older versions of the compiler all labels defined within inline assembler
code had to be of the form nnnnn$ where nnnn is a number less than 100
(which implies a limit of utmost 100 inline assembler labels per function)."
OK, which is "older versions of compiler" and assuming I have the up-to-date
version, what are the rules now?