AN 977: Nios® V Processor Custom Instruction

ID 773194
Date 4/14/2023
Public
Document Table of Contents

3.2.1. Custom Instruction Assembly Language Syntax

Nios® V processor custom instructions use a standard assembly language syntax as shown in the following table:

Table 5.  Standard Assembly Language
Syntax Description
<mnemonic>
  • Identifies the particular custom instruction.
  • Assigned during system development in the Platform Designer.
<destination> Identifies the register that stores the result of the result port (if any).
<source 0> Identifies the register that provides the first input argument from the data0 port (if any).
<source 1> Identifies the register that provides the second input argument from the data1 port (if any).

The custom instruction designates the registers based on the application binary interface (ABI) name of each registers.

Custom Instruction Assembly Language Syntax

CUSTOM_OPERATION1, a5, a5, a4

The example above shows a call to a custom instruction, called CUSTOM_OPERATION1. The input to the instruction is the current contents of the Nios® V processor registers a5 and a4. Nios® V processor register a5 stores the results .