Question: PLEASE HELP WRITE THE PROGRAM. PLEASE ADD COMMENTS. THANK YOU Create a program that performs the following operations 1. Prompt for and accept a string
PLEASE HELP WRITE THE PROGRAM. PLEASE ADD COMMENTS. THANK YOU



Create a program that performs the following operations 1. Prompt for and accept a string of up to 80 characters from the user. The memory buffer for this string is created by: buffer: space 80 # create space for string input The syscall to place input into the buffer looks like . li SvO, 8 la $a0, buffer li $al, 80 svscall # code for syscall read-string # tell syscall where the buffer is # tell syscall how big the buffer is 2. Determine the length of the string which was entered. Every string that is entered will have a newline character (0x0a) appended to its end and then the null character (0x00). Do not count either of these characters when reporting the string length (stop scanning when you reach the newline character). You can use the la instruction to place the address of the buffer in a register. The lb (load byte is used just like lw) instruction can be used to read a byte from memory into a register (it will be placed on the right end of the register and the upper part of the register will be zeroed out. Use code similar to this to count the characters in the string la $t0, buffer # place address of buffer in $t0 # read byte located at address in $t0 # logic including code to leave loop addi $t0, $t0, 1 # increment address in $t0 j myloop # jump to myloop loop Done: 3. 4. 5. Determine how many uppercase letters are in the string Determine how many lowercase letters are in the string Determine how many digits are in the string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
