Question: 1. Write a program in MIPS assembly language to convert ASCll number string containing an integer decimal string to an integer. Your program should expect
1. Write a program in MIPS assembly language to convert ASCll number string containing an integer decimal string to an integer. Your program should expect register $a0 to hold the address of a null-terminated string containing some combination of the digits 0 through 9. Your program should compute the integer value equivalent to this string of digits, then place the number in register vO. If a non-digit character appears anywhere in the string, your program should stop with the value -1 in register $vO. For example, if register $a0 points to a sequence of three bytes 50ten, 52ten, Oten (the null terminated string "24"), then when the program stops, register $vO should contain the value 24ten- 2. Write and test a MIPS assembly language program to compute and print the first 100 prime numbers. A number n is prime if no numbers except 1 and n divide it evenly. You should implement two routines: a. test_prime (n), return 1 if n is prime and 0 if n is not prime. b. main), iterate over the integers, testing if each is prime. Print the first 100 numbers that are prime
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
