Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 517033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:47:33+00:00 2026-05-13T07:47:33+00:00

When I try working on unsigned integers in MIPS, the result of every operation

  • 0

When I try working on unsigned integers in MIPS, the result of every operation I do remains signed (that is, the integers are all in 2’s complement), even though every operation I perform is an unsigned one: addu, multu and so fourth…

When I print numbers in the range [2^31, 2^32 - 1] I get their ‘overflowed’ negative value as if they were signed (I guess they are).

Though, when I try something like this:

li $v0, 1
li $a0, 2147483648                # or any bigger number
syscall

the printed number is always 2147483647 (2^31 - 1)

I’m confused… What am I missing?

PS : I haven’t included my code as it isn’t very readable (such is assembly code) and putting aside this problem,
seems to be working fine. If anyone feels it is necessary I shall include it right away!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:47:33+00:00Added an answer on May 13, 2026 at 7:47 am

    From Wikipedia:

    The MIPS32 Instruction Set states that the word unsigned as part of Add and Subtract instructions, is a misnomer. The difference between signed and unsigned versions of commands is not a sign extension (or lack thereof) of the operands, but controls whether a trap is executed on overflow (e.g. Add) or an overflow is ignored (Add unsigned). An immediate operand CONST to these instructions is always sign-extended.

    From the MIPS Instruction Reference:

    ALL arithmetic immediate values are sign-extended […] The only difference between signed and unsigned instructions is that signed instructions can generate an overflow exception and unsigned instructions can not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working on a small application to try out an idea that I have.
I try working with Android applications in Eclipse and Intellij Idea. All work ok,
I am working with this example to try and learn Sencha Touch. I have
I try to make Ext.Data.Store working... With a normal proxy it works great: var
I am working on a facebook app when i try to invoke js for
Working with Python in Emacs if I want to add a try/except to a
I'm working on a program where I try to pass parameters by reference. I'm
I try to make have an EventListener in ItemRenderer but its not working. How
I'm working with the Entity Framework and I'm having a problem: When I try
I've try to implement integration tests for a working application (spring, hibernate, soap, cxf).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.