Question

2. Searching a String: Write a MIPS assembly language program to do the following: Read a string and store it in memory. Limit the string length to 100 characters. Then, ask the user to enter a character. Search and count the number of occurrences of the character in the string. The search is not case sensitive. Lowercase and uppercase letters should be equal. Then ask the user to enter a string of two characters. Search and count the number of occurrences of the two-character string Enter a string of at most 100 characters: MIPS programming is nice Enter a character: i Number of occurrences Enter a string of two characters: mi Number of occurrences of mi = 2 Repeat (Y/N)? n of i = 4 1-42. Searching a String: Write a MIPS assembly language program to do the following: Read a string and store it in memory. Limit the string length to 100 characters. Then, ask the user to enter a character. Search and count the number of occurrences of the character in the string. The search is not case sensitive. Lowercase and uppercase letters should be equal. Then ask the user to enter a string of two characters. Search and count the number of occurrences of the two-character string.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SU Sn. S6 ,S6 , 2 Sil6: ho nojp mele sS20 tf Su ไผ่In $25, 4( Ssp) nop vo rol 1. Jalr Sas luo 28, Sup STo Sp rloc 14, P.MMPS JACRkypeelowerlo4, S2 Si S2,2SsP) o 2 adldyS S, S22 move rove , So no SL o( S2

Add a comment
Know the answer?
Add Answer to:
2. Searching a String: Write a MIPS assembly language program to do the following: Read a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Your assignment is to write an assembly language program which read a string and print it in...

    Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for the...

  • MIPS Assembly Language * Write a simple program to count the number of non overlapping repetitions...

    MIPS Assembly Language * Write a simple program to count the number of non overlapping repetitions of a character pattern in a character string. For example " the pattern "aa" appears twice in the in the string "aabbaaa". Provide a user interface to read the character pattern and the string.

  • Write a program(Python language for the following three questions), with comments, to do the following:   ...

    Write a program(Python language for the following three questions), with comments, to do the following:    Ask the user to enter an alphabetic string and assign the input to a variable str1. Print str1. Check if str1 is valid, i.e. consists of only alphabetic characters. If str1 is valid Print “<str1> is a valid string.” If the first character of str1 is uppercase, print the entire string in uppercase, with a suitable message. If the first character of str1 is...

  • Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is...

    Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for...

  • MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and...

    MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and print a simple checksum for each string. Make your string long enough to hold 50 characters. Don't forget to leave space for the null byte. Our checksum algorithm will produce a value which you can print with the syscall for printing a character. Stop reading strings when the user enters ".". The syscall to read a string (sycall code 8) adds a newline to...

  • In this problem, you will write an assembly program (LC-3 assembly language) to process a string ...

    In this problem, you will write an assembly program (LC-3 assembly language) to process a string starting at memory location x5000, and is terminated by a ‘\0’ character (ASCII value = 0). For a given string beginning atmemory location x5000, convert all the upper-case English letters (A-Z) to lower-case, and all the lower case (a-z) to upper case. For example, if the string is “iLOVEComputerScience252”, the string after the processing should be: “IlovecOMPUTERsCIENCE252”. Store the string after the processing to...

  • Write an LC-3 program (starting at memory location 0x3000) to take a string as input and...

    Write an LC-3 program (starting at memory location 0x3000) to take a string as input and then output information about this string. The end of the string will be denoted with the "#" character. Once the "#" has been found, output the following in order: 1) The letter “u” followed by the number of uppercase letters in the string (A-Z) 2) The letter “l” followed by the number of lowercase letters in the string (a-z) 3) The letter “n” followed...

  • Question 2 Write a program that will read in a line of text up to 100...

    Question 2 Write a program that will read in a line of text up to 100 characters as string, and output the number of words in the line and the number of occurrences of each letter. Define a word to be any string of letters that is delimited at each end by whitespace, a period, a comma, or the beginning or end of the line. You can assume that the input consists entirely of letters, whitespace, commas, an<d periods. When...

  • Write a ALP that inputs a string and let's the user choose from uppercase or lowercase...

    Write a ALP that inputs a string and let's the user choose from uppercase or lowercase and vowel and consonant the characters/string to be saved in file. ASSEMBLY LANGUAGE MASM Sample output: Enter a string: RoSE A uppercase vowel B. Lowercase vowel C. Uppercase consonant D.Lowercase consonant Enter choice: c Saving... Program used is emu8086

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python code that gets a string from the user and counts the number of uppercase letters, the number of lowercase letters, the number of digits, and the sum of the digits. Please see the outcome below: Outcome: Enter the string: okOKE9o7 Uppercase letters: 3 Lowercase letters: 3 Digits: 2 Sum of digits: 8 Must look exactly like outcome for full credit.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT