User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 391,684 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,247 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser:
Views: 496 | Replies: 1
Reply
Join Date: Jun 2008
Posts: 1
Reputation: ziggyz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ziggyz ziggyz is offline Offline
Newbie Poster

Reading and converting a string to a 64-bit integer

  #1  
Jun 19th, 2008
Hello!
I'm a newbie in assembly and i'm facing some difficulties with handling 64 bit integers in pcSpim.
What i am trying to do is read a string, convert it to a 64-bit number and then store it in two 32-bit registers.
Should i create a 'for' loop which reads the characters of the string one-by-one and somehow stores the first 32 bits in the first register and the 32 bits left in the other one??
And what about the convertion?

I guess i should also check for errors, like dealing with numbers of length greater than 64 bits etc...


Thanks in advance for any help you could provide me and sorry for the messy writing
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,809
Reputation: Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold 
Rep Power: 11
Solved Threads: 184
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Reading and converting a string to a 64-bit integer

  #2  
Jun 20th, 2008
Yes, use them in a loop. You should be looking at the mult and add opcodes.

Remember how a number is constructed: by powers of ten.

5 * 10^2 = 500
4 * 10^1 = 40
3 * 10^0 = 3

add them all up to get 543.

Hope this helps.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Assembly Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Assembly Forum

All times are GMT -4. The time now is 2:23 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC