Table of Contents

Advertisement

Exceptions
Instruction Type
Instruction Fields
31
30
29
A
15
14
13

8.5.3. and

Instruction
Operation
Assembler Syntax
Example
Description
Exceptions
Instruction Type
Instruction Fields
Nios II Processor Reference Guide
176
28
27
26
25
12
11
10
9
IMM16
# Branch if carry generated
Overflow Detection (signed operands):
An overflow is detected when two positives are added and
the sum is negative, or when two negatives are added and
the sum is positive. The overflow condition can control a
conditional branch, as shown in the following code:
addi rB, rA, IMM16
xor rC, rB, rA
xorhi rD, rB, IMM16
and rC, rC, rD
blt rC, r0,label
# The original add operation
# Compare signs of sum and rA
# Compare signs of sum and IMM16
# Combine comparisons
# Branch if overflow occurred
None
I
= Register index of operand rA
A
= Register index of operand rB
B
= 16-bit signed immediate value
IMM16
Bit Fields
24
23
22
21
B
8
7
6
5
bitwise logical and
rC
rA & rB
and rC, rA, rB
and r6, r7, r8
Calculates the bitwise logical AND of rA and rB and stores
the result in rC.
None
R
= Register index of operand rA
A
= Register index of operand rB
B
= Register index of operand rC
C
8. Instruction Set Reference
NII-PRG | 2018.04.18
20
19
18
17
IMM16
4
3
2
1
0x04
16
0

Advertisement

Table of Contents
loading

Table of Contents