Storing a user’s input in MIPS

You are not using the read string system call correctly. I suspect you haven’t actually looked at the documentation on how to use it. You have to pass two arguments:

$a0 = address of input buffer
$a1 = maximum number of characters to read

So you should do something like:

la $a0, name
li $a1, 20

Nevertheless, this shouldn’t cause a crash since $a0 should still hold the address of firstPromptString that you set up for the printing, earlier, and that is valid writable memory.

Leave a Comment