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

Errors when assembling C51 enerated .src flle

I have just revisited some old code which was compiled with the C51 C compiler - the code compiles ok (flow is C51->BL51->OH51). I now need to add some inline assembler. To check that the new flow (C51->A51->BL51->OH51) is ok before I make the changes, I directed the compiler to write a .src file. The assembler detects errors in the .src file - "ERROR #10.... ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL". Any ideas?

Parents Reply Children
  • Extract from .src file :

    PUBLIC Fault_Flg

    Fault_Flg BIT 015H

    Fault_Flg EQU 022H.5

    Defined twice!! As are all other bit type variables.

    Extract from .lst file :

    ---- 795 RSEG ?DT?Ms_Delay?POPOV_PCA
    0000 796 a?71100: DS 1
    0001 797 b?71101: DS 1 798
    ---- 799 RSEG ?DT?WrHwControl?POPOV_PCA
    0000 800 temp?73102: DS 1 0015 801 Fault_Flg EQU 022H.5
    *** __________________________^
    *** ERROR #10 IN 801 (popov_pca.src, LINE 801): ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL 0037 802 ADC_Byte7 EQU 026H.7
    *** __________________________^
    *** ERROR #10 IN 802 (popov_pca.src, LINE 802): ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL 0014 803 Abort_Flg EQU 022H.4
    *** __________________________^
    *** ERROR #10 IN 803 (popov_pca.src, LINE 803): ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL 0036 804 ADC_Byte6 EQU 026H.6
    *** __________________________^
    *** ERROR #10 IN 804 (popov_pca.src, LINE 804): ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL 0035 805 ADC_Byte5 EQU 026H.5
    *** __________________________^

    Odd problem as everything is ok when I use C51 to generate an object file. Assembling the .src for the same C source file causes these errors.

  • you need to search in the editor on e.g. ADC_Byte6 to find the first occurence, cheaking both the .src and whatever other files it includes.

    My GUESS is that there is something in an include that .a51 does not like while the compiler eats it with gusto

    Erik