Jump to content

Recommended Posts

Hey guys, I am struggling right now to get an unsigned integer given a signed integer. I want to convert let's say

 

-1 to 4294967295

-2 to 4294967294

and so on

 

One way to do this is to

multiply the number given say -1 -> 1

and subtract it from 4294967296

 

(note this is for negative case only)

but the maximum is 4294967295

so I want to subtract 4294967295 with -1*(the number given)

and add 1 to it.

 

However, for some reason I cannot store 4294967295 into a register

li $t0, 0xFFFFFFFF will give me -1

 

 

Link to comment
https://forums.phpfreaks.com/topic/178905-mips-load-immediate/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.