Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
980 views
in Technique[技术] by (71.8m points)

assembly - Saving integers as Strings in MIPS

I was just wondering, is there any way in MIPS to store a summation of numbers as a string and later read them byte by byte, for example:

the sum 657 -> sw into a .ascii directive -> later lb on the first index to get 6 (in ascii code) same with 5 and so on. Is this possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I believe there is a flaw in ShinTakezou's answer. The line neg $a0, $a0 will convert the positive number to negative, which results in a weird output for the code. If we remove this line. The codes work fine for positive integer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...