Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hexadecimal unsigned integer

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a list of 32 bit instructions that are in hexadecimal. I've been storing them in integers. My problem is that the hexadecimal instructions are unsigned (they are only positive), and a java integer is signed, so a couple of the instructions are coming up negative. Is there a way to make them unsigned like in C ?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could store them as ints and process them as longs using a mask to make the longs unsigned. For example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic