Question: Q4. Write a MIPS program that reads from the keyboard a string of no more than 20 characters and then outputs the string in

Q4. Write a MIPS program that reads from the keyboard a string

Q4. Write a MIPS program that reads from the keyboard a string of no more than 20 characters and then outputs the string in a single line even if the input is written on multiple lines. The input string will be terminated by an character '0', which doesn't count as part of the string. Hint: use a loop to read the input character-by-character and save all characters in a memory buffer. (10 marks) Sample runs (green text is the output) abc def ghio abcdefghi Example of terminating input with 0 abcdef ghijklm nopq abcdefghijklmnopq Example of reaching maximum number of acharacters (20)

Step by Step Solution

3.34 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program Data section data input asciiz Enter a stringeither max 20 charatcers or 0 termination chara... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!