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.

Question about assembler directives

Other Parts Discussed in Thread: MSP430G2553

As I'm using the launchpad with a 430g2432, and i'm only busy with assembly so most programs are relative short,and from the 8kb "program flash" there is much unused

What i like to do is to store fixed constants and strings after the program in the .text segment (not in the 256byte  .data flash segment as that will be used for calibration data)

 but i have no idea how to get this arranged with the css5_1 assembler.

best regards

Jazz  Saigon 

  • There are multiple ways to go about this.  Here is the one I think is easiest ...

    Don't do it in the assembler.  Do in the linker command file.  What's that?  It tells the linker how to create output sections from the input sections you create in your assembly files, then how to place those output sections in target memory.  You probably have at least one linker command file in your launchpad package.  Look for a file with a name similar to lnk_msp430g2553.cmd.  It will have MEMORY and SECTIONS directives within it.  The contents of this file are explained in the MSP430 Assembly Language Tools book, in the Linker chapter.  

    Just place the sections which contain your fixed constants and strings in the same memory range as the .text section.  

    Thanks and regards,

    -George

  • Thanks for the tip George,as i didn't had a idea before because as usual we only think of clicking the run button and every thing will be done.... in fact the last time i've fiddle with a linker manually is maybe 25 years ago.....:)...I'm always enjoying learning every day, so i will go through the tools book. Possibly it will solve more Assembly issues.

    Best regards from Saigon

    Jazz