Re: question on MIPS: addiu



I eman
addiu v1, v1, 0
I know what it means "addiu", I just do not understand what is purpose
to do? it does not seems to do anything.

On Aug 29, 2:32 am, Herbert Kleebauer <k...@xxxxxxxxx> wrote:
Keep Asking wrote:

What is purpose of following assembly:

addiu v1, v1, 0

v1 or r1? Seems to be a nop.

Why don't you download the processor manuals:

Format: ADDIU rt, rs, immediate MIPS32 (MIPS I)

Purpose:
To add a constant to a 32-bit integer

Description: rt ¬ rs + immediate
The 16-bit signed immediate is added to the 32-bit value in GPR rs and
the 32-bit arithmetic result is placed into GPR rt.

No Integer Overflow exception occurs under any circumstances.

Restrictions:
None

Operation:
temp ¬ GPR[rs] + sign_extend(immediate)
GPR[rt]¬ temp

Exceptions:
None

Programming Notes:
The term “unsigned” in the instruction name is a misnomer; this operation
is 32-bit modulo arithmetic that does not trap on overflow. This instruction
is appropriate for unsigned arithmetic, such as address arithmetic, or
integer arith-metic environments that ignore overflow, such as C language
arithmetic.

.