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??

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

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span

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.

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.