Texas Instruments TMS470R1x User Manual

TMS470R1x Code Generation Tools
Release 1.20
Getting Started Guide
1997 Microcontroller Products
Printed in U.S.A., March 1997 M414003-9741 revision B
TMS470R1x Code Generation Tools
Getting Started Guide
Release 1.20
Manufacturing Part Number: M414003-9741 revision B
Literature Number: SPNU1 17B
March 1997
Printed on Recycled Paper
IMPORTANT NOTICE
T exas Instruments (TI) reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice, and advises its customers to obtain the latest version of relevant information to verify, before placing orders, that the information being relied on is current.
TI warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements.
Certain applications using semiconductor products may involve potential risks of death, personal injury, or severe property or environmental damage (“Critical Applications”).
TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS.
Inclusion of TI products in such applications is understood to be fully at the risk of the customer. Use of TI products in such applications requires the written approval of an appropriate TI officer . Questions concerning potential risk applications should be directed to TI through a local SC sales office.
In order to minimize risks associated with the customer’s applications, adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards.
TI assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Nor does TI warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of TI covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used.
Copyright 1997, Texas Instruments Incorporated
About This Manual
Preface
Read This First
The
TMS470R1x Code Generation T ools Getting Started Guide
to install release 1.20 of the TMS470R1x code generation tools on your sys­tem. It also provides the following information:
-
Tells you how to set environment variables for parameters that you use often
-
Gets you started using the compiler, linker, and assembler
-
Provides a list of the media contents for your tools set, so you will know what information is associated with each file you have installed
-
Details enhancements in this release and tells you where to find further information
tells you how
-
Notational Conventions
In this document, the following notational conventions are used:
-
Describes how you can resolve problems that you may encounter on a PC running DOS (MS-DOSor PC-DOS)
Program listings, program examples, and interactive displays are shown in a special typeface. Examples use a bold version of the spe- cial typeface for emphasis. Interactive displays use bold to distinguish commands that you enter from items that the system displays (such as prompts, command output, error messages, etc.). Some interactive displays use entered.
Here is a sample program listing:
0011 0005 0001 .field 1, 2 0012 0005 0003 .field 3, 4 0013 0005 0006 .field 6, 3 0014 0006 .even
italics
to describe the type of information that should be
iii
Notational Conventions / Related Documentation From Texas Instruments
Here is an example of a command that you might enter:
set PATH=c:\
tool_dir
;%PATH%
T o change your path statement to use the tools, enter the command text as shown in bold and replace
tool_dir
tory.
-
In syntax descriptions, the instruction, command, or directive is in a bold typeface font and parameters are in an
that are in bold should be entered as shown; portions of a syntax that are
italics
in
describe the type of information that should be entered.
Here is an example of a command that you might use:
mkdir
tool_dir
with the name of your tools direc-
italic typeface
. Portions of a syntax
In this example, you would type mkdir, as shown, and replace the name of your directory.
-
Square brackets ( [ and ] ) identify an optional parameter. If you use an op­tional parameter, you specify the information within the brackets; you don’t enter the brackets themselves. Here’s an example of a command that has optional parameters:
SET C_DIR=
Setting the C_DIR environment variable allows you to specify one or more pathnames for the C compiler to search.
Related Documentation From Texas Instruments
The following books describe the TMS470R1x and related support tools. To obtain a copy of any of these TI documents, call the T exas Instruments Litera­ture Response Center at (800) 477–8924. When ordering, please identify the book by its title and literature number.
TMS470R1x Assembly Language Tools User’s Guide
SPNU118) describes the assembly language tools (assembler, linker, and other tools used to develop assembly language code), assembler directives, macros, common object file format, and symbolic debugging directives for the TMS470R1x devices.
pathname
[;
pathname
1
tool_dir
. . .]
2
(literature number
with
TMS470R1x Optimizing C Compiler User’s Guide
(literature number SPNU119) describes the TMS470R1x C compiler. This C compiler accepts ANSI standard C source code and produces assembly language source code for the TMS470R1x devices.
iv
Related Documentation From Texas Instruments / Trademarks
Trademarks
TMS470R1x C Source Debugger User’s Guide
(literature number
SPNU124) describes the TMS470R1x emulator and simulator versions of the C source debugger interface. This book discusses various aspects of the debugger interface, including window management, command entry, code execution, data management, and breakpoints. It also includes a tutorial that introduces basic debugger functionality.
TMS470R1x User’s Guide
(literature number SPNU134) describes the TMS470R1x RISC microcontroller, its architecture (including registers), ICEBreaker module, interfaces (memory, coprocessor, and debugger), 16-bit and 32-bit instruction sets, and electrical specifications.
DOS/4G is a trademark of Tenberry Software, Inc. HP-UX, HP 9000 Series 700, and PA-RISC are trademarks of Hewlett-
Packard Company. IBM, PC, and PC-DOS are trademarks of International Business Machines
Corp. MS-DOS, Windows, and Windows NT are registered trademarks of Microsoft
Corp. OpenWindows, SunOS, and Solaris are trademarks of Sun Microsystems, Inc. Pentium is a trademark of Intel Corporation. SP ARCstation is trademark of SPARC International, Inc., but licensed exclu-
sively to Sun Microsystems, Inc. UNIX is a registered trademark in the United States and other countries,
licensed exclusively through X/Open Company Limited. X Window System is a trademark of the Massachusetts Institute of Tech-
nology.
Read This First
v
If You Need Assistance
If You Need Assistance . . .
-
World-Wide Web Sites
TI Online http://www.ti.com Semiconductor Product Information Center (PIC) http://www.ti.com/sc/docs/pic/home.htm Microcontroller Home Page http://www.ti.com/sc/micro
-
North America, South America, Central America
Product Information Center (PIC) (972) 644-5580 TI Literature Response Center U.S.A. (800) 477-8924 Software Registration/Upgrades (214) 638-0333 Fax: (214) 638-7742 U.S.A. Factory Repair/Hardware Upgrades (281) 274-2285 U.S. T echnical T raining Organization (972) 644-5580 Microcontroller Hotline (281) 274-2370 Fax: (281) 274-4203 Email: micr o@t i.com Microcontroller Modem BBS (281) 274-3700 8-N-1
-
Europe, Middle East, Africa
European Product Information Center (EPIC) Hotlines:
Multi-Language Support +33 1 30 70 11 69 Fax: +33 1 30 70 10 32 Email: epic@ti.com Deutsch +49 8161 80 33 11 or +33 1 30 70 11 68 English +33 1 30 70 11 65 Francais +33 1 30 70 11 64
Italiano +33 1 30 70 11 67 EPIC Modem BBS +33 1 30 70 11 99 European Factory Repair +33 4 93 22 25 40 Europe Customer Training Helpline Fax: +49 81 61 80 40 10
-
Asia-Pacific
Literature Response Center +852 2 956 7288 Fax: +852 2 956 2200
-
Japan
Product Information Center +0120-81-0026 (in Japan) Fax: +0120-81-0036 (in Japan)
+03-3457-0972 or (INTL) 813-3457-0972 Fax: +03-3457-1259 or (INTL) 813-3457-1259
-
Documentation
When making suggestions or reporting errors in documentation, please include the following information that is on the title page: the full title of the book, the publication date, and the literature number.
Mail: Texas Instruments Incorporated Email: comments@books.sc.ti.com
Technical Documentation Services, MS 702 P.O. Box 1443 Houston, Texas 77251-1443
Note: When calling a Literature Response Center to order documentation, please specify the literature number of the
book.
vi
Contents
Contents
1 Setting Up the Code Generation Tools With DOS or Windows 3.1x 1-1. . . . . . . . . . . . . . . . . .
Provides installation instructions for PCs running DOS or Windows 3.1x.
1.1 System Requirements 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware checklist 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software checklist 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Installing the Code Generation Tools 1-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing the tools on DOS systems 1-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing the tools on Windows 3.1x systems 1-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Setting Up the Code Generation Environment 1-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifying the directory that contains the executable files (PATH statement) 1-5. . . . . . . .
Identifying alternate directories for the assembler to search (A_DIR) 1-5. . . . . . . . . . . . . .
Identifying alternate directories for the compiler to search (C_DIR) 1-5. . . . . . . . . . . . . . . .
Setting default shell options (C_OPTION) 1-6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying a temporary file directory (TMP) 1-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resetting defined environment variables 1-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verifying that the environment variables are set 1-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4 Performance Considerations 1-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Where to Go From Here 1-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Setting Up the Code Generation Tools With Windows 95 and Windows NT 2-1. . . . . . . . . . .
Provides installation instructions for the code generation tools for PCs running Windows 95 or Windows NT.
2.1 System Requirements 2-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware checklist 2-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software checklist 2-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Installing the Code Generation Tools 2-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Setting Up the Code Generation Environment 2-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifying the directory that contains the executable files (PATH statement) 2-5. . . . . . . .
Identifying alternate directories for the assembler to search (A_DIR) 2-5. . . . . . . . . . . . . .
Identifying alternate directories for the compiler to search (C_DIR) 2-6. . . . . . . . . . . . . . . .
Setting default shell options (C_OPTION) 2-6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying a temporary file directory (TMP) 2-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resetting defined environment variables 2-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verifying that the environment variables are set 2-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4 Where to Go From Here 2-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vii
Contents
3 Setting Up the Code Generation Tools With SunOS 3-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Provides installation instructions for the code generation tools for SPARCstations running SunOS.
3.1 System Requirements 3-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware checklist 3-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software checklist 3-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Installing the Code Generation Tools 3-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting the CD-ROM 3-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying the files 3-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unmounting the CD-ROM 3-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Setting Up the Code Generation Environment 3-5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifying the directory that contains the executable files (path statement) 3-6. . . . . . . . .
Identifying alternate directories for the assembler to search (A_DIR) 3-6. . . . . . . . . . . . . .
Identifying alternate directories for the compiler to search (C_DIR) 3-7. . . . . . . . . . . . . . . .
Setting default shell options (C_OPTION) 3-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying a temporary file directory (TMP) 3-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reinitializing your shell 3-9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resetting defined environment variables 3-9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verifying that the environment variables are set 3-10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4 Where to Go From Here 3-10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Setting Up the Code Generation Tools on an HP Workstation 4-1. . . . . . . . . . . . . . . . . . . . . . .
Provides installation instructions for HP 9000 Series 700 P A-RISC computers running HP-UX.
4.1 System Requirements 4-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware checklist 4-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software checklist 4-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Installing the Code Generation Tools 4-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting the CD-ROM 4-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying the files 4-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting up the software tools using a C shell 4-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting up the software tools using a Korn shell 4-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unmounting the CD-ROM 4-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 Setting Up the Code Generation Environment 4-5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifying the directory that contains the executable files (path statement) 4-6. . . . . . . . .
Identifying alternate directories for the assembler (A_DIR) 4-6. . . . . . . . . . . . . . . . . . . . . . .
Identifying alternate directories for the compiler (C_DIR) 4-7. . . . . . . . . . . . . . . . . . . . . . . . .
Setting default shell options (C_OPTION) 4-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying a temporary file directory (TMP) 4-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reinitializing your shell 4-9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resetting defined environment variables 4-9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verifying that the environment variables are set 4-10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4 Where to Go From Here 4-10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viii
Contents
5 Getting Started With the Code Generation Tools 5-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Provides an overview of how to invoke and use the assembler, linker, and compiler.
5.1 Getting Started With the Assembler and Linker 5-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Getting Started With the C Compiler 5-7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 Release Notes 6-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Describes the media contents and the enhancements for this release.
6.1 Media Contents 6-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Release Enhancements 6-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General enhancements 6-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assembler enhancements 6-4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C compiler enhancements 6-5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Troubleshooting DOS Systems A-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Lists kernel and DOS/4G error messages and explains how you can resolve them.
A.1 Troubleshooting in the Protected-Mode Environment A-2. . . . . . . . . . . . . . . . . . . . . . . . . . . .
The PMINFO32.EXE program A-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2 Kernel Error Messages A-5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3 DOS/4G Error Messages A-9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B Glossary B-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defines terms and acronyms used in this book.
Contents
ix
x
Chapter 1
Setting Up the Code Generation
Tools With DOS or Windows 3.1x
This chapter helps you install release 1.20 of the TMS470R1x code generation tools and set up your code-development environment on a 32-bit x86-based or Pentium PC running MS-DOS, PC-DOS, or Windows 3.1x. These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object (executable) code.
The C compiler tools are composed of the following components:
-
Parser
-
Optimizer
-
Code generator
-
Interlist utility
-
Library-build utility
The assembly language tools are composed of the following components:
-
Assembler
-
Archiver
-
Linker
-
Absolute lister
-
Cross-reference lister
-
Hex conversion utility
Topic Page
1.1 System Requirements 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Installing the Code Generation Tools 1-3. . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Setting Up the Code Generation Environment 1-4. . . . . . . . . . . . . . . . . . .
1.4 Performance Considerations 1-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Where Do We Go From Here 1-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1
System Requirements
1.1 System Requirements
To install and use the code generation tools, you need the items listed in the following hardware and software checklists.
Hardware checklist
Host 32-bit x86-based or Pentium based PC with an ISA/EISA bus Memory 4M–16M bytes of RAM plus 32M bytes of hard-disk space for
Display Monochrome or color monitor (color recommended) Required hardware CD-ROM drive Optional hardware Microsoft compatible mouse
Software checklist
Operating system One of these operating systems:
temporary files and 4M bytes of hard-disk space for the code generation tools
CD-ROM
-
MS-DOS
-
PC-DOS
-
Windows 3.1x
TMS470R1x Code Generation Tools
Note: Memory Needed
The code generation tools, when installed on a PC, require at least 4M bytes of memory , but you can expect some performance problems when using only 4M bytes. (16M bytes is recommended.) You may want to free as much memory as possible before running the tools, especially if you have less than 16M bytes.
1-2
1.2 Installing the Code Generation Tools
This section helps you install the code generation tools on your hard-disk system. The code generation tools package is shipped on CD-ROM. The installation instructions vary according to your operating system.
Installing the tools on DOS systems
To install the tools on a DOS system, follow these steps:
Installing the Code Generation Tools
1) Insert the CD-ROM drive.
2) Change to the CD-ROM drive (where d: is the name of your CD-ROM drive):
d:
3) Enter the following command:
install
4) Follow the on-screen instructions.
If you choose not to have he environment variables set up automatically , you can set yp the environment variables in your autoexec.bat file. See Section 1.3,
TMS470R1x Code Generation Tools
Setting Up the Code Generation Environment
tion.
Installing the tools on Windows 3.1x systems
To install the tools on a Windows 3.1x system, follow these steps:
1) Insert the CD-ROM drive.
2) Start Windows 3.1x.
3) From the File menu, select Run.
TMS470R1x Code Generation Tools
CD-ROM into your
, on page 1-4, for more informa-
CD-ROM into your
4) In a dialog box, enter the following command (where d: is the name of your CD-ROM drive):
d:\setup.exe
5) Click on OK.
6) Follow the on-screen instructions.
If you choose not to have the environment variables set up automatically , you can set up the environment variables in your autoexec.bat file. See Section 1.3,
Setting Up the Code Generation Environment
tion.
Setting Up the Code Generation Tools With DOS or Windows 3.1x
, on page 1-4, for more informa-
1-3
Setting Up the Code Generation Environment
1.3 Setting Up the Code Generation Environment
Before or after you install the code generation tools, you can define environ­ment variables that set certain software tool parameters you normally use. An
environment variable
to a string. A program uses this symbol to find or obtain certain types of information.
When you use environment variables, default values are set, making each individual invocation of the tools simpler because these parameters are auto­matically specified. When you invoke a tool, you can use command-line options to override many of the defaults that are set with environment vari­ables.
The code generation tools use the following environment variables:
-
A_DIR
-
C_DIR
-
C_OPTION
-
TMP
By default, the installation program modifies your autoexec.bat file and sets up these environment variables:
is a special system symbol that you define and associate
set PATH=c:\ set A_DIR=c:\ set C_DIR=c:\
tool_dir
tool_dir tool_dir
;%PATH%
If you choose not to have the environment variables set up automatically , you can modify your autoexec.bat file to include the set commands above.
In addition to setting up environment variables, you must modify your path statement. The following subsections describe how to modify your path state­ment and how to define the environment variables that the code generation tools use.
1-4
Setting Up the Code Generation Environment
Identifying the directory that contains the executable files (PATH statement)
Y ou must include the
tool_dir
directory in your P ATH statement so that you can specify the assembler and compiler tools without specifying the name of the directory that contains the executable files.
-
If you modify your autoexec.bat file to change the path information, add the following to the end of the PATH statement:
;c:\
tool_dir
-
If you set the P A TH statement from the command line, enter the following:
set PATH=c:\
tool_dir
;%PATH%
The addition of ;%PATH% ensures that this PATH statement does not undo the PATH statements in any other batch files (including the autoexec.bat file).
Identifying alternate directories for the assembler to search (A_DIR)
The assembler uses the A_DIR environment variable to name alternative directories for the assembler to search. To set the A_DIR environment vari­able, use this syntax:
set A_DIR=
pathnames
The libraries. You can separate the pathnames with a semicolon or with a blank. Once you set A_DIR, you can use the .copy, .include, or.mlib directive in assembly source without specifying path information.
pathname
[;
pathname2
1
. . .]
are directories that contain copy/include files or macro
If the assembler does not find the file in the directory that contains the current source file or in directories named by the –ioption (which names alternate directories), it searches the paths named by the A_DIR enviroment variable. For more information on the –i option, see the
Language Tools User’s Guide
or the
TMS470R1x Optimizing C Compiler
TMS470R1x Assembly
User’s Guide.
Identifying alternate directories for the compiler to search (C_DIR)
The compiler uses the C_DIR environment variable to name alternative direc­tories for the compiler to search. To set the C_DIR environment variable, use this syntax:
set C_DIR=
The
pathnames
(such as stdio.h). You can separate the pathnames with a semicolon or with a blank. In C source, you can use the #include directive without specifying path information. Instead, you can specify the path information with C_DIR.
Setting Up the Code Generation Tools With DOS or Windows 3.1x
pathname
[;
pathname
1
2
. . .]
are directories that contain #include files or function libraries
1-5
Setting Up the Code Generation Environment
Setting default shell options (C_OPTION)
Y ou might find it useful to set the compiler, assembler, and linker shell default options using the C_OPTION environment variable. If you do this, the shell uses the default options and/or input filenames that you name with C_OPTION every time you run the shell.
Setting the default options with the C_OPTION environment variable is useful when you want to run the shell consecutive times with the same set of options and/or input files. After the shell reads the command line and the input file­names, it reads the C_OPTION environment variable and processes it.
To set the C_OPTION environment variable, use this syntax:
set C_OPTION=
option
[;
option2
1
. . .]
Environment variable options are specified in the same way and have the same meaning as they do on the command line. For example, if you want to always run quietly (the –q option), enable C source interlisting (the –s option), and link (the –z option), set up the C_OPTION environment variable as follows:
set C_OPTION=–qs –z
In the following examples, each time you run the compiler shell, it runs the linker. Any options following –z on the command line or in C_OPTION are passed to the linker. This enables you to use the C_OPTION environment vari­able to specify default compiler and linker options and then specify additional compiler and linker options on the shell command line. If you have set –z in the environment variable and want to compile only, use the –c option of the shell. These additional examples assume C_OPTION is set as shown above:
cl470 *c ; compiles and links cl470 –c *.c ; only compiles cl470 *.c –z lnk.cmd ; compiles and links using a
; command file
cl470 –c *.c –z lnk.cmd ; only compiles (–c overrides –z)
For more information about shell options, see the
Compiler User’s Guide
. For more information about linker options, see the
TMS470R1x Optimizing C
TMS470R1x Assembly Language Tools User’s Guide .
1-6
Specifying a temporary file directory (TMP)
The compiler shell program creates intermediate files as it processes your program. By default, the shell puts intermediate files in the current directory. However, you can name a specific directory for temporary files by using the TMP environment variable.
Using the TMP environment variable allows use of a RAM disk or other file systems. It also allows source files to be compiled from a remote directory without writing any files into the directory where the source resides. This is useful for protected directories.
To set the TMP environment variable, use this syntax:
Setting Up the Code Generation Environment
set TMP=
For example, to set up a directory named temp for intermediate files on your hard drive, enter:
set TMP=c:\temp
pathname
Resetting defined environment variables
The environment variables that you define remain set until you reboot the system. If you want to clear an environment variable, use this command:
variable name
set
For example, to reset the A_DIR environment variable, enter:
set A_DIR
=
Verifying that the environment variables are set
To verify that the environment variables are set, open a DOS box and enter:
set
This command lists the path and environment variables and their current values.
Setting Up the Code Generation Tools With DOS or Windows 3.1x
1-7
Performance Considerations
Performance Considerations / Where to Go From Here
1.4 Performance Considerations
Y ou may notice a speed degradation when you use the code generation tools with DOS or Windows 3.1x. This speed degradation may occur when you use DOS with the tools to get appropriate host memory support.
If you encounter error messages when you use the tools on a PC with DOS, run PMINFO to determine your system configuration before you contact tech­nical support. For more information about PMINFO, see Appendix A,
shooting DOS systems.
1.5 Where to Go From Here
Your code generation tools are now installed on your DOS or Windows 3.1x system. Now you should do each of the following tasks:
T rouble-
-
Go to Chapter 5,
Getting Started With the Code Generation Tools
chapter provides you with an overview of how to invoke and use the assembler, linker, and compiler.
-
Read Chapter 6,
Release Notes
. This chapter explains the new features
included in release 1.20 of the code generation tools.
-
Use Appendix A,
Troubleshooting DOS Systems
, as necessary. This appendix lists kernel and DOS/4G error messages and explains how you can resolve the messages.
. This
1-8
Chapter 2
Setting Up the Code Generation Tools
With Windows 95 and Windows NT
This chapter helps you install release 1.20 of the TMS470R1x code generation tools and set up your code-development environment on a 32-bit x86-based or Pentium PC running Windows 95 or Windows NT. These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object (executable) code.
The C compiler tools are composed of the following components:
-
Parser
-
Optimizer
-
Code generator
-
Interlist utility
-
Library-build utitlity
The assembly language tools are composed of the following components:
-
Assembler
-
Archiver
-
Linker
-
Absolute lister
-
Cross-reference lister
-
Hex conversion utility
Topic Page
2.1 System Requirements 2-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Installing the Code Generation Tools 2-3. . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Setting Up the Code Generation Environment 2-4. . . . . . . . . . . . . . . . . . .
2.4 Where to Go From Here 2-8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-1
System Requirements
2.1 System Requirements
To install and use the code generation tools, you need the items listed in the following hardware and software checklists.
Hardware checklist
Host 32-bit x86-based or Pentium based PC with an ISA/EISA bus Memory Minimum of 16M bytes of RAM plus 32M bytes of hard-disk space
Display Monochrome or color monitor (color recommended) Required hardware CD-ROM drive Optional hardware Microsoft compatible mouse
Software checklist
for temporary files and 4M bytes of hard-disk space for the code generation tools
Operating system One of these operating systems:
-
Windows 95 version 4.0 (or higher)
-
Windows NT Workstation version 3.5.1 or 4.0
CD-ROMs
TMS470R1x Code Generation Tools
2-2
2.2 Installing the Code Generation Tools
This section helps you install the code generation tools on your hard-disk sys­tem. The code generation tools package is shipped on CD-ROM. T o install the tools on a PC running Windows 95 or Windows NT, follow these steps:
Installing the Code Generation Tools
1) Insert the
TMS470R1x Code Generation Tools
CD-ROM into your CD-
ROM drive.
2) Start Windows.
3) If you are running Windows 95, select Run from the Start menu. If you are running Windows NT, select Run from the File menu.
4) In the dialog box, enter the following command (where d: is the name of your CD-ROM drive):
d:\setup.exe
5) Click on OK.
6) Follow the on-screen instructions.
If you choose not to have the environment variables set up automatically , you can set them up yourself in one of the following ways:
-
If you are running Windows 95, you can set up the environment variables in your autoexec.bat file.
-
If you are running Windows NT , you can set up the environment variables in the System applet of the Control Panel.
See Section 2.3,
Setting Up the Code Generation Environment,
on page 2-4,
for more information.
Setting Up the Code Generation Tools With Windows 95 and Windows NT
2-3
Setting Up the Code Generation Environment
2.3 Setting Up the Code Generation Environment
Before or after you install the code generation tools, you can define environ­ment variables that set certain software tool parameters you normally use. An
environment variable
to a string. A program uses this symbol to find or obtain certain types of in­formation.
When you use environment variables, default values are set, making each individual invocation of the tools simpler because these parameters are auto­matically specified. When you invoke a tool, you can use command-line options to override many of the defaults that are set with environment vari­ables.
The code generation tools use the following environment variables:
-
A_DIR
-
C_DIR
-
C_OPTION
-
TMP
By default, the installation program modifies your autoexec.bat file and sets up these environment variables:
is a special system symbol that you define and assign
set PATH=c:\ set A_DIR=c:\ set C_DIR=c:\
tool_dir
tool_dir tool_dir
;%PATH%
These variables are set up in the registry under:
HKEY_CURRENT_USER\Environment
If you choose not to have the environment variables set up automatically , you can set them up yourself in one of the following ways:
-
If you are running Windows 95, you can modify your autoexec.bat file to include the set commands above.
-
If you are running Windows NT , you can set up the environment variables in the System applet of the Control Panel. Enter the same commands that you would enter on the command line in the System applet.
In addition to setting up environment variables, you must modify your path statement. The following subsections describe how to modify your path state­ment and how to define the environment variables that the code generation tools use.
2-4
Setting Up the Code Generation Environment
Identifying the directory that contains the executable files (PATH statement)
Y ou must include the
tool_dir
directory in your P ATH statement so that you can specify the assembler and compiler tools without specifying the name of the directory that contains the executable files.
-
You can change the path information in one of the following ways:
J
If you are running Windows 95, modify your autoexec.bat file to change the path information by adding the following to the end of the PA TH statement:
;c:\
tool_dir
J
If you are running Windows NT , modify the System applet of the Con­trol Panel to change the path information by adding the following to the end of the PATH statement:
;c:\
tool_dir
-
If you set the P A TH statement from the command line, enter the following:
set PATH=c:\
tool_dir
;%PATH%
The addition of ;%PATH% ensures that this PATH statement does not undo the PATH statements in any other batch files (including the autoexec.bat file).
Identifying alternate directories for the assembler to search (A_DIR)
The assembler uses the A_DIR environment variable to name alternative directories for the assembler to search. To set the A_DIR environment vari­able, use this syntax:
set A_DIR=
The
pathnames
ies. You can separate the pathnames with a semicolon or with a blank. Once you set A_DIR, you can use the .copy , .include, or .mlib directive in assembly source 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 – i option (which names alternate directories), it searches the paths named by the A_DIR environment variable. For more information on the –i option, see the
Language Tools User’s Guide User’s Guide
Setting Up the Code Generation Tools With Windows 95 and Windows NT
pathname
[;
pathname
1
2
. . .]
are directories that contain copy/include files or macro librar-
TMS470R1x Assembly
or the
TMS470R1x Optimizing C Compiler
.
2-5
Loading...
+ 58 hidden pages