Home

ADDI

addi is a common mnemonic used in assembly language to denote an add-immediate instruction. In this class of instructions, a constant value encoded within the instruction (the immediate) is added to the value in a source register, and the result is written to a destination register. The addi form is a core building block for arithmetic, pointer arithmetic, and constant loading in many reduced-instruction-set computing architectures.

In the most well-known usage, for example in the MIPS architecture, the instruction has the form addi

Immediate range issues are a practical consideration: the immediate value is encoded within the instruction, so

Usage of addi streamlines code that would otherwise require moving a constant into a register before performing

See also: add immediate instruction, MIPS instruction set, RISC architectures, overflow behavior in arithmetic.

rt,
rs,
immediate.
It
adds
the
sign-extended
16-bit
immediate
to
the
contents
of
rs
and
places
the
result
in
rt.
The
immediate
is
sign-extended
to
the
machine’s
word
length
(typically
32
bits).
Depending
on
the
architecture,
addi
may
trigger
an
overflow
exception
if
the
addition
cannot
be
represented
in
the
destination
register;
some
related
variants,
such
as
addiu
in
MIPS,
perform
the
same
operation
but
do
not
trap
on
overflow.
only
a
limited
range
is
directly
representable.
For
a
16-bit
signed
immediate,
the
allowed
range
is
typically
-32768
to
32767,
though
exact
limits
can
vary
by
architecture
and
encoding.
arithmetic,
making
it
efficient
for
tasks
such
as
loop
indexing,
array
addressing,
and
constant
offset
calculations.