SLAU131V October 2004 – February 2020
An environment variable is a system symbol that you define and assign a string to. The assembler uses the MSP430_A_DIR environment variable to name alternate directories that contain copy/include files or macro libraries.
The assembler looks for the MSP430_A_DIR environment variable and then reads and processes it. If the assembler does not find the MSP430_A_DIR variable, it then searches for MSP430_C_DIR. The processor-specific variables are useful when you are using Texas Instruments tools for different processors at the same time.
See the MSP430 Optimizing C/C++ Compiler User's Guide for details on MSP430_C_DIR.
The command syntax for assigning the environment variable is as follows:
Operating System | Enter |
---|---|
UNIX (Bourne Shell) | MSP430_A_DIR="pathname1;pathname2; . . . "; export MSP430_A_DIR |
Windows | set MSP430_A_DIR=pathname1;pathname2; . . . |
The pathnames are directories that contain copy/include files or macro libraries. The pathnames must follow these constraints:
set MSP_A_DIR= c:\path\one\to\tools ; c:\path\two\to\tools
set MSP_A_DIR=c:\first path\to\tools;d:\second path\to\tools
In assembly source, you can use the .copy, .include, or .mlib directive without specifying path information. If the assembler does not find the file in the directory that contains the current source file or in directories named by the --include_path option, it searches the paths named by the environment variable.
For example, assume that a file called source.asm contains these statements:
.copy "copy1.asm"
.copy "copy2.asm"
Assume the following paths for the files:
UNIX: | /tools/files/copy1.asm and /dsys/copy2.asm |
Windows: | c:\tools\files\copy1.asm and c:\dsys\copy2.asm |
You could set up the search path with the commands shown below:
Operating System | Enter |
---|---|
UNIX (Bourne shell) |
MSP430_A_DIR="/dsys"; export MSP430_A_DIR
|
Windows |
MSP430_A_DIR=c:\dsys
|
The assembler first searches for copy1.asm and copy2.asm in the current directory because source.asm is in the current directory. Then the assembler searches in the directory named with the --include_path option and finds copy1.asm. Finally, the assembler searches the directory named with MSP430_A_DIR and finds copy2.asm.
The environment variable remains set until you reboot the system or reset the variable by entering one of these commands:
Operating System | Enter |
---|---|
UNIX (Bourne shell) |
unset MSP430_A_DIR
|
Windows |
set MSP430_A_DIR=
|