0

I want to read space separated integers in mips assembler. I currently do:

li $v0, 5
syscall
move $t4, $v0

In a loop but it requires to make input with endline. I want to just put many space separated integers and make it read them. How can I do it?

Giorgi Cercvadze
  • 403
  • 1
  • 7
  • 23
  • Possible duplicate of [Convert String of ASCII digits to int in MIPS/Assembler](https://stackoverflow.com/questions/15940331/convert-string-of-ascii-digits-to-int-in-mips-assembler) – Ped7g May 12 '18 at 08:29
  • The MARS and SPIM have only this single "read integer" service, so you have to "read string" instead, and write your own parser to convert characters of string into numerical value. I added as "duplicate" question where Michael's answer looks to be reasonably well fleshed to give you most of the solution code (you will need to write the parsing part identifying the separate "words" containing single value). – Ped7g May 12 '18 at 08:30

0 Answers0