Nios® II Processor Reference Guide

ID 683836
Date 10/22/2020
Public
Document Table of Contents

8.5.32. cmplei

Instruction compare less than or equal signed immediate
Operation

if ((signed) rA < (signed) IMMED)

then rB ←  1

else rB ←  0

Assembler Syntax

cmplei rB, rA, IMMED

Example

cmplei r6, r7, 100

Description

Sign-extends the immediate value IMMED to 32 bits and compares it to the value of rA. If rA <= σ(IMMED), then cmplei stores 1 to rB; otherwise stores 0 to rB.

Usage

cmplei performs the signed <= operation of the C programming language. The maximum allowed value of IMMED is 32766. The minimum allowed value is –32769.

Pseudo-instruction

cmplei is implemented using a cmplti instruction with an IMM16 immediate value of IMMED + 1.

Did you find the information on this page useful?

Characters remaining:

Feedback Message