Nios II Custom Instruction User Guide

ID 683242
Date 4/27/2020
Public
Document Table of Contents

3.3.1. Custom Instruction Assembly Language Syntax

Nios II custom instructions use a standard assembly language syntax:

custom <selection index>, <Destination>, <Source A>, <Source B>

  • <selection index>—The 8-bit number that selects the particular custom instruction
  • <Destination>—Identifies the register where the result from the result port (if any) will be placed
  • <Source A>—Identifies the register that provides the first input argument from the dataa port (if any)
  • <Source B>—Identifies the register that provides the first input argument from the datab port (if any)

You designate registers in one of two formats, depending on whether you want the custom instruction to use a Nios II register or an internal register:

  • r <i>—Nios II register <i>
  • c <i>—Custom register <i> (internal to the custom instruction component)

The use of r or c controls the readra, readrb, and writerc fields in the the custom instruction word.

Custom registers are only available with internal register file custom instructions.