This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28335: variable definition in Assembly

Part Number: TMS320F28335

Tool/software: TI C/C++ Compiler

Dear team,

I am using C/C++ and Assembly mixing programming with CCS 6.1. I defined variables in .asm file. These variables were not shared with C code.

But the variables declared in the assembly header file failed to compile normally into the Map file.

_TEST_1					.SET	140H
_TEST_2					.SET	141H
_TEST_3					.SET	142H
_TEST_4					.SET	143H
_TEST_5					.SET	144H
_TEST_6					.SET	145H
_TEST_7					.SET	146H
_TEST_8					.SET	147H
_TEST_9					.SET	148H
_TEST_10				.SET	149H

ps: 

If i use the .global declaration and the global variable declared externally in the C language header file, the declared variable and the corresponding address can be found in the Map file.

EC-F28335-BasicAndCProgram.rar

  • Names such as _TEST_1 are absolute symbols.  Absolute symbols are not shown in the map file.  Though you do see them in the symbol table shown with the utility nm2000 ...

    % nm2000 BasicAndCProgramTest.out | findstr _TEST_
    00008800 T B_TEST_FUN
    00000140 A _TEST_1
    00000149 a _TEST_10
    00000149 a _TEST_10
    0000014a a _TEST_11
    ...

    If you want to see an absolute symbol in the map file, you have to make it global.  You already do this for a few symbols in the source file BasicVar.h ...

    	.global _TEST_1
    	.global _TEST_2
    	.global _TEST_3
    	.global _TEST_4
    

    Add the same entry for any other absolute symbol you want to see in the map file.

    Thanks and regards,

    -George