JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
SPARC Assembly Language Reference Manual     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  SPARC Assembler Syntax

2.  Executable and Linking Format

3.  Directives and Pseudo-Operations

4.  Creating Data in Assembler

5.  SPARC Code Models

6.  Writing Functions -- The SPARC ABI

7.  Assembler Inline Functions and __asm Code

7.1 Inline Function Templates in C and C++

7.1.1 Compiling C/C++ with Inline Templates

7.1.2 Layout of Code in Inline Templates

7.1.3 Guidelines for Coding Inline Templates

7.1.3.1 Parameter Passing

7.1.3.2 Stack Space

7.1.3.3 Branches and Calls

7.1.4 Late and Early Inlining

7.1.5 Compiler Calling Convention

7.1.6 Improving Efficiency of Inlined Functions

7.1.7 Inline Templates in C++

7.1.7.1 C++ Inline Templates and Exceptions

7.2 Using __asm Satements in C and C++

A.  Using the Assembler Command Line

B.  A Sample Assembler Program

C.  SPARC Instruction Sets and Mnemonics

Index

Chapter 7

Assembler Inline Functions and __asm Code

This chapter discusses how to use the C or C++ compiler to create inline functions and __asm assembler code. Inline templates and the C/C++ __asm statement provide a way to insert assembler code into a C or C++ program. The assembler code is processed by the compiler's code generator, and not the SPARC assembler. However, the syntax recognized by the compilers is similar to the SPARC Assembler syntax. This chapter describes how inline templates and __asm statements can be used effectively.