SLAA534A
June 2013 – June 2020
1
Introduction
1.1
ABIs for the MSP430
1.2
Scope
1.3
ABI Variants
1.4
Toolchains and Interoperability
1.5
Libraries
1.6
Types of Object Files
1.7
Segments
1.8
MSP430 Architecture Overview
1.9
MSP430 Memory Models
1.10
Reference Documents
1.11
Code Fragment Notation
2
Data Representation
2.1
Basic Types
2.2
Data in Registers
2.3
Data in Memory
2.4
Pointer Types
2.5
Complex Types
2.6
Structures and Unions
2.7
Arrays
2.8
Bit Fields
2.8.1
Volatile Bit Fields
2.9
Enumeration Types
3
Calling Conventions
3.1
Call and Return
3.1.1
Call Instructions
3.1.1.1
Indirect Calls
3.1.1.2
Direct Calls
3.1.2
Return Instruction
3.1.3
Pipeline Conventions
3.1.4
Weak Functions
3.2
Register Conventions
3.2.1
Argument Registers
3.2.2
Callee-Saved Registers
3.3
Argument Passing
3.3.1
Register Singles
3.3.2
Register Pairs
3.3.3
Split Pairs
3.3.4
Quads (Four-Register Arguments)
3.3.5
Special Convention for Compiler Helper Functions
3.3.6
C++ Argument Passing
3.3.7
Passing Structs and Unions
3.3.8
Stack Layout of Arguments Not Passed in Registers
3.3.9
Frame Pointer
3.4
Return Values
3.5
Structures and Unions Passed and Returned by Reference
3.6
Conventions for Compiler Helper Functions
3.7
Scratch Registers for Functions Already Seen
3.8
_ _mspabi_func_epilog Helper Functions
3.9
Interrupt Functions
4
Data Allocation and Addressing
4.1
Data Sections and Segments
4.2
Addressing Modes
4.3
Allocation and Addressing of Static Data
4.3.1
Addressing Methods for Static Data
4.3.1.1
Absolute Addressing
4.3.1.2
Symbolic Addressing
4.3.1.3
Immediate Addressing
4.3.2
Placement Conventions for Static Data
4.3.2.1
Abstract Conventions for Placement
4.3.2.2
Abstract Conventions for Addressing
4.3.3
Initialization of Static Data
4.4
Automatic Variables
4.5
Frame Layout
4.5.1
Stack Alignment
4.5.2
Register Save Order
4.6
Heap-Allocated Objects
5
Code Allocation and Addressing
5.1
Computing the Address of a Code Label
5.1.1
Absolute Addressing for Code
5.1.2
Symbolic Addressing
5.1.3
Immediate Addressing
5.2
Branching
5.3
Calls
5.3.1
Direct Call
5.3.2
Far Call Trampoline
5.3.3
Indirect Calls
6
Helper Function API
6.1
Floating-Point Behavior
6.2
C Helper Function API
6.3
Special Register Conventions for Helper Functions
6.4
Floating-Point Helper Functions for C99
7
Standard C Library API
7.1
Reserved Symbols
7.2
<assert.h> Implementation
7.3
<complex.h> Implementation
7.4
<ctype.h> Implementation
7.5
<errno.h> Implementation
7.6
<float.h> Implementation
7.7
<inttypes.h> Implementation
7.8
<iso646.h> Implementation
7.9
<limits.h> Implementation
7.10
<locale.h> Implementation
7.11
<math.h> Implementation
7.12
<setjmp.h> Implementation
7.13
<signal.h> Implementation
7.14
<stdarg.h> Implementation
7.15
<stdbool.h> Implementation
7.16
<stddef.h> Implementation
7.17
<stdint.h> Implementation
7.18
<stdio.h> Implementation
7.19
<stdlib.h> Implementation
7.20
<string.h> Implementation
7.21
<tgmath.h> Implementation
7.22
<time.h> Implementation
7.23
<wchar.h> Implementation
7.24
<wctype.h> Implementation
8
C++ ABI
8.1
Limits (GC++ABI 1.2)
8.2
Export Template (GC++ABI 1.4.2)
8.3
Data Layout (GC++ABI Chapter 2)
8.4
Initialization Guard Variables (GC++ABI 2.8)
8.5
Constructor Return Value (GC++ABI 3.1.5)
8.6
One-Time Construction API (GC++ABI 3.3.2)
8.7
Controlling Object Construction Order (GC++ ABI 3.3.4)
8.8
Demangler API (GC++ABI 3.4)
8.9
Static Data (GC++ ABI 5.2.2)
8.10
Virtual Tables and the Key function (GC++ABI 5.2.3)
8.11
Unwind Table Location (GC++ABI 5.3)
9
Exception Handling
9.1
Overview
9.2
PREL31 Encoding
9.3
The Exception Index Table (EXIDX)
9.3.1
Pointer to Out-of-Line EXTAB Entry
9.3.2
EXIDX_CANTUNWIND
9.3.3
Inlined EXTAB Entry
9.4
The Exception Handling Instruction Table (EXTAB)
9.4.1
EXTAB Generic Model
9.4.2
EXTAB Compact Model
9.4.3
Personality Routines
9.5
Unwinding Instructions
9.5.1
Common Sequence
9.5.2
Byte-Encoded Unwinding Instructions
9.6
Descriptors
9.6.1
Encoding of Type Identifiers
9.6.2
Scope
9.6.3
Cleanup Descriptor
9.6.4
Catch Descriptor
9.6.5
Function Exception Specification (FESPEC) Descriptor
9.7
Special Sections
9.8
Interaction With Non-C++ Code
9.8.1
Automatic EXIDX Entry Generation
9.8.2
Hand-Coded Assembly Functions
9.9
Interaction With System Features
9.9.1
Shared Libraries
9.9.2
Overlays
9.9.3
Interrupts
9.10
Assembly Language Operators in the TI Toolchain
10
DWARF
10.1
DWARF Register Names
10.2
Call Frame Information
10.3
Vendor Names
10.4
Vendor Extensions
11
ELF Object Files (Processor Supplement)
11.1
Registered Vendor Names
11.2
ELF Header
11.3
Sections
11.3.1
Section Indexes
11.3.2
Section Types
11.3.3
Extended Section Header Attributes
11.3.4
Subsections
11.3.5
Special Sections
11.3.6
Section Alignment
11.4
Symbol Table
11.4.1
Symbol Types
11.4.2
Common Block Symbols
11.4.3
Symbol Names
11.4.4
Reserved Symbol Names
11.4.5
Mapping Symbols
11.5
Relocation
11.5.1
Relocation Types
11.5.1.1
Absolute Relocations
11.5.1.2
PC-Relative Relocations
11.5.1.3
Relocations in Data Sections
11.5.1.4
Relocations for MSP430 Instructions
11.5.1.5
Relocations for MSP430X Instructions
11.5.1.6
Other Relocation Types
11.5.2
Relocation Operations
11.5.3
Relocation of Unresolved Weak References
12
ELF Program Loading and Linking (Processor Supplement)
12.1
Program Header
12.1.1
Base Address
12.1.2
Segment Contents
12.1.3
Thread-Local Storage
12.2
Program Loading
13
Build Attributes
13.1
MSP430 ABI Build Attribute Subsection
13.2
MSP430 Build Attribute Tags
14
Copy Tables and Variable Initialization
14.1
Copy Table Format
14.2
Compressed Data Formats
14.2.1
RLE
14.2.2
LZSS Format
14.3
Variable Initialization
15
Revision History
8.2
Export Template (GC++ABI 1.4.2)
Export templates are not currently specified by the ABI.