General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 22nd, 2010, 06:13 PM
GoatMafioso GoatMafioso is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 1 GoatMafioso User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 37 sec
Reputation Power: 0
MIPS Assembly, Merging Registers

I have a fairly quick question about MIPS programming. Assume there are 4 integers stored in 4 seperate registers (for arguments sake 1, 2, 3 and 4). How would one go about getting, in a single register, those merged together so inside the register was a single integer 1234. I heard mention of shifting bits to accomplish it but I can't fathom how shifting could help (since shifting is basically just multipling whatever integer is in the register by 2^k where k is the number of bytes shifted)

Any help would be amazing,
Tony V.

Reply With Quote
  #2  
Old April 23rd, 2010, 04:09 AM
mecanicu mecanicu is offline
anonymous
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 244 mecanicu User rank is Private First Class (20 - 50 Reputation Level)mecanicu User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 12 h 21 m 10 sec
Reputation Power: 13
If your number is represented in Octal or Hexadecimal the shift and add can do the job otherwise, you are right, in a ten base you will have to
1234 = 1*10^3+2*10^2+3*10+4

all the best

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > MIPS Assembly, Merging Registers


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap