This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global Register Coloring and Inline Assembly

Quite often I'll code some of my modules entirely in A51 assembly and, to be thorough, I always fill out the $REGUSE statement for all functions. A module written like this will then provide the necessary information to the compiler for global register optomization.

I've never used inline assembly that much, but recently I did a test where I coded one function with inline assembly. Upon inspection of the resulting SRC file, I can find no $REGUSE statements, and it appears all references to any other C functions in the module have been removed from the .OCR file.

Does this mean that including any inline assembly in a C module excludes all functions in the module from global register optomization ?

Parents Reply Children
  • Does this mean that including any inline assembly in a C module excludes all functions in the module from global register optomization ?

    with inline assembly the whole file is, at some point in the process, converted to assembler (you have no C source for debugging such a file). If that conversion takes plece before register optimization, the above would be true.

    AVOID INLINE ASSEMBLY IN C51 just make a .a51 module and call it

    Erik

  • >> AVOID INLINE ASSEMBLY IN C51 just make a .a51 module and call it

    Yeah, that's kinda the conclusion I've drawn. I've done plenty of .A51 files, so it's no problem other than the time involved. Understand, if I do one function from the module in A51 I prefer to do all function in the module. It's a generic timer resource so I should probably just go ahead and A51 the whole thing.