Re: question on MIPS: addiu



"Keep Asking" <ask8y@xxxxxxxxx> wrote:
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.

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.

It takes some time at least

.



Relevant Pages

  • Re: question on MIPS: addiu
    ... I know what it means "addiu", I just do not understand what is purpose ... ADDIU rt, rs, immediate MIPS32 ... No Integer Overflow exception occurs under any circumstances. ... This instruction ...
    (alt.lang.asm)
  • Re: Another unusual device
    ... would see if anyone would care to guess its purpose. ... But how do you pour into the damn thing so that all the cups get filled but none overflow? ... Maybe the tray holds any spillage, but then you've got wet, sticky cups. ...
    (rec.antiques)
  • Re: integer multiplication
    ... Yevgen Muntyan wrote: ... I wonder if there is simple portable one-expression form of it. ... equal to INT_MAX so there is no overflow. ... No purpose, I was fooled by the initial wrong 'INT_MAX / x < y' ...
    (comp.lang.c)
  • Re: [patch 6/7] Immediate Values - Documentation
    ... Randy Dunlap wrote: ... +This document introduces Immediate Values and their use. ... +* Purpose of immediate values ... Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal ...
    (Linux-Kernel)
  • Re: Integer Overflow
    ... their sum overflows or not. ... purpose. ... you can't rely on int overflow doing ...
    (comp.lang.c)