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.

C/assembler project has v.strange results in memory



Hi group,

I'm converting an assembler project piece by piece to 'C' using CCS V5.4. So there is an assembler file to allocate memory using .space directives. The C accesses them using .global and "extern". When I build and transfer to the target, the memory browser in CCS shows most variables to be the wrong size, or missing. It is on MSP430, and  using the FET debugger. A code fragment is:

                 .data
RAM_Memory_Bank1:
HBCount                 .space    16  
Sound_Change            .space    2   
Strobe_Point            .space    2     
Volume                  .space    2 
SHB                     .space    1  
Sound_Monitor           .space    1     
FHB                     .space    1      
Sound_Pair              .space    1      
Old_Sound_Pair          .space    1     
Half_Second_Count       .space    1

Which produces:

RAM_Memory_Bank1
0000    0000    0000    0000    0000    0000    0000    0000
Sound_Change
0000
Strobe_Point
0000    0000
SHB
0000
FHB
0000    0000
Period
0000    0000
Step_Time
0000    0000    0000    0000

So "Strobe_Point" has 4 bytes rather than 2, and it has decided to put in a variable from further down the code into the middle of the others!

Has anyone else seen this strage behaviour?

Thanks,

Rob.


  • The size of the variables in memory look ok to me, what appears to be missing is the symbol name for some of them.

    For example, under Strobe_Point, there are 4 bytes which are actually Strobe_Point and Volume. Similarly, under FHB all the remaining 1 byte variables are being allocated. If you try opening the memory browser specifically at one of those symbols, say, Volume or Sound_Pair do you see it at the correct location?