0

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:)

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by hammerhead02
0

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.

0

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.

I don't know about ziggyz, but your idea worked for me.

Thanx a lot for that technique. I spent almost 3 days trying to get a number (1987) to store as a variable so I could manipulate it (+, -, /, *)

Again,

Thanks a lot. (Can't say that enough)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.