MIPS Device Inline Assembly Language

Inline assembly language allows you to embed assembly-language instructions directly in your C and C++ source programs without extra assembly and link steps. The inline assembler is built into the compiler and does not require separate assembly. Because the inline assembler requires no extra steps, it is sometimes more convenient than using a separate assembler, especially in situations where you require access to processor resources.

Inline assembly code disables compiler optimization for the inline assembler function. If optimization is important for your project, you should consider using intrinsic functions.

To use inline assembly code, you must select the appropriate compiler switches for the specific Instruction Set Architecture (ISA). The MIPS ISA compiler switches are /QMmips1, /QMmips2, /QMmips3, /QMmips4, /QMmips5, /QMmips16, /QMmips32, and /QMmips64. The compiler switch /QMFPE- targets platforms with a Floating-Point Unit (FPU). /QMmips2 is the common compiler switch for MIPS ISA II running in 32-bit mode.

Note   Do not confuse the 32-bit mode with the newer MIPS32 ISA.

In addition, you may need to use microprocessor-specific switches to enable inline assembly code that targets a specific microprocessor. The microprocessor-specific switches are /QMR3900, /QMR4100, /QMR4200, /QMR4300, /QMR5400 and /QMVIPER.

See Also

MIPS Guide | MIPS Calling Sequence Specification | Stand-alone MIPS Assembler | Intrinsic Functions and MIPS Inline Assembly | MIPS Assembly Language Resources | The _asm Keyword in MIPS Inline Assembly | MIPS Inline Assembly Language Examples

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.