MSP430 Optimizing C/C++ Compiler v17.9.0.STS User's Guide
SLAU132Q - REVISED SEPTEMBER 2017

Read This First

About This Manual

The MSP430 Optimizing C/C++ Compiler User's Guide explains how to use the following Texas Instruments Code Generation compiler tools:

  • Compiler
  • Library build utility
  • C++ name demangler

The TI compiler accepts C and C++ code conforming to the International Organization for Standardization (ISO) standards for these languages. The compiler supports both the 1989 and 1999 versions of the C language and the 2003 version of the C++ language.

This user's guide discusses the characteristics of the TI C/C++ compiler. It assumes that you already know how to write C/C++ programs. The C Programming Language (second edition), by Brian W. Kernighan and Dennis M. Ritchie, describes C based on the ISO C standard. You can use the Kernighan and Ritchie (hereafter referred to as K&R) book as a supplement to this manual. References to K&R C (as opposed to ISO C) in this manual refer to the C language as defined in the first edition of Kernighan and Ritchie's The C Programming Language.

Notational Conventions

This document uses the following conventions:

  • Program listings, program examples, and interactive displays are shown in a special typeface. Interactive displays use a bold version of the special typeface to distinguish commands that you enter from items that the system displays (such as prompts, command output, error messages, etc.).
  • Here is a sample of C code:

    #include <stdio.h> main() { printf("Hello World\n"); }
  • In syntax descriptions, instructions, commands, and directives are in a bold typeface and parameters are in an italic typeface. Portions of a syntax that are in bold should be entered as shown; portions of a syntax that are in italics describe the type of information that should be entered.
  • Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you specify the information within the brackets. Unless the square brackets are in the bold typeface, do not enter the brackets themselves. The following is an example of a command that has an optional parameter:
  • cl430 [options] [filenames] [--run_linker [link_options] [object files]]
  • Braces ( { and } ) indicate that you must choose one of the parameters within the braces; you do not enter the braces themselves. This is an example of a command with braces that are not included in the actual syntax but indicate that you must specify either the --rom_model or --ram_model option:
  • cl430 --run_linker  {--rom_model | --ram_model} filenames [--output_file=name.out]
    --library=libraryname
  • In assembler syntax statements, the leftmost column is reserved for the first character of a label or symbol. If the label or symbol is optional, it is usually not shown. If a label or symbol is a required parameter, it is shown starting against the left margin of the box, as in the example below. No instruction, command, directive, or parameter, other than a symbol or label, can begin in the leftmost column.
  • symbol .usect "section name", size in bytes[, alignment]
  • Some directives can have a varying number of parameters. For example, the .byte directive. This syntax is shown as [, ..., parameter].

Related Documentation

You can use the following books to supplement this user's guide:

ANSI X3.159-1989, Programming Language - C (Alternate version of the 1989 C Standard), American National Standards Institute

ISO/IEC 9899:1989, International Standard - Programming Languages - C (The 1989 C Standard), International Organization for Standardization

ISO/IEC 9899:1999, International Standard - Programming Languages - C (The 1999 C Standard), International Organization for Standardization

ISO/IEC 14882-2003, International Standard - Programming Languages - C++ (The 2003 C++ Standard), International Organization for Standardization

The C Programming Language (second edition), by Brian W. Kernighan and Dennis M. Ritchie, published by Prentice-Hall, Englewood Cliffs, New Jersey, 1988

The Annotated C++ Reference Manual, Margaret A. Ellis and Bjarne Stroustrup, published by Addison-Wesley Publishing Company, Reading, Massachusetts, 1990

C: A Reference Manual (fourth edition), by Samuel P. Harbison, and Guy L. Steele Jr., published by Prentice Hall, Englewood Cliffs, New Jersey

Programming Embedded Systems in C and C++, by Michael Barr, Andy Oram (Editor), published by O'Reilly & Associates; ISBN: 1565923545, February 1999

Programming in C, Steve G. Kochan, Hayden Book Company

The C++ Programming Language (second edition), Bjarne Stroustrup, published by Addison-Wesley Publishing Company, Reading, Massachusetts, 1990

Tool Interface Standards (TIS) DWARF Debugging Information Format Specification Version 2.0, TIS Committee, 1995

DWARF Debugging Information Format Version 3, DWARF Debugging Information Format Workgroup, Free Standards Group, 2005 (http://dwarfstd.org)

DWARF Debugging Information Format Version 4, DWARF Debugging Information Format Workgroup, Free Standards Group, 2010 (http://dwarfstd.org)

System V ABI specification (http://www.sco.com/developers/gabi/)

Related Documentation From Texas Instruments

See the following resources for further information about the TI Code Generation Tools:

You can use the following documents to supplement this user's guide:

    SLAU131 MSP430 Assembly Language Tools User's Guide. Describes the assembly language tools (the assembler, linker, and other tools used to develop assembly language code), assembler directives, macros, object file format, and symbolic debugging directives for the MSP430 devices.
    SLAA534 MSP430 Embedded Application Binary Interface Application Report. Specifies the ELF-based ABI for MSP430 processors. The ABI is a broad standard that specifies the low-level interface between tools, programs, and program components.
    SLAU049 MSP430x1xx Family User's Guide. Describes the MSP430x1xx™ CPU architecture, instruction set, pipeline, and interrupts for these ultra-low power microcontrollers.
    SLAU144 MSP430x2xx Family User's Guide. Describes the MSP430x2xx™ CPU architecture, instruction set, pipeline, and interrupts for these ultra-low power microcontrollers.
    SLAU012 MSP430x3xx Family User's Guide. Describes the MSP430x3xx™ CPU architecture, instruction set, pipeline, and interrupts for these ultra-low power microcontrollers.
    SLAU056 MSP430x4xx Family User's Guide. Describes the MSP430x4xx™ CPU architecture, instruction set, pipeline, and interrupts for these ultra-low power microcontrollers.
    SLAU208 MSP430x5xx Family User's Guide. Describes the MSP430x5xx™ CPU architecture, instruction set, pipeline, and interrupts for these ultra-low power microcontrollers.
    SLAU134 MSP430FE42x ESP30CE1 Peripheral Module User's Guide. Describes common peripherals available on the MSP430FE42x and ESP430CE1 ultra-low power microcontrollers. This book includes information on the setup, operation, and registers of the ESP430CE1.
    SPRAAB5 The Impact of DWARF on TI Object Files. Describes the Texas Instruments extensions to the DWARF specification.
    SPRUEX3 TI SYS/BIOS Real-time Operating System User's Guide. SYS/BIOS gives application developers the ability to develop embedded real-time software. SYS/BIOS is a scalable real-time kernel. It is designed to be used by applications that require real-time scheduling and synchronization or real-time instrumentation. SYS/BIOS provides preemptive multithreading, hardware abstraction, real-time analysis, and configuration tools.

Trademarks

MSP430x1xx, MSP430x2xx, MSP430x3xx, MSP430x4xx, MSP430x5xx, MSP430 are trademarks of Texas Instruments.

Back to Top

Submit Documentation Feedback

Copyright© 2017, Texas Instruments Incorporated. An IMPORTANT NOTICE for this document addresses availability, warranty, changes, use in safety-critical applications, intellectual property matters and other important disclaimers.