Jump to content

MIPS Load Immediate


denniss

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.