Example 2–7, Example 2–8, Demonstrat – Altera Nios II Custom User Manual

Page 21

Advertising
background image

Chapter 2: Software Interface

2–5

Custom Instruction Assembly Software Interface

January 2011

Altera Corporation

Nios II Custom Instruction User Guide

Example 2–6

shows a call to a custom instruction with index 0. The input to the

instruction is the current contents of the Nios II processor registers

r7

and

r8

, and the

results are stored in the Nios II processor register

r6

.

Example 2–7

shows a call to a custom instruction with index 3. The input to the

instruction is the current contents of the Nios II processor register

r2

and the custom

register

c4

, and the results are stored in custom register

c1

.

Example 2–8

shows a call to a custom instruction with index 4. The input to the

instruction is the current contents of the custom register

c9

and the Nios II processor

register

r2

, and the results are stored in Nios II processor register

r6

.

f

For more information about the binary format of custom instructions, refer to the

Instruction Set Reference

chapter of the Nios II Processor Reference Handbook.

Example 2–7. Assembly Language Call to Customer Instruction II

custom 3, c1, r2, c4

Example 2–8. Assembly Language Call to Customer Instruction III

custom 4, r6, c9, r2

Advertising