Please find the code below:
.data
prompt: .asciiz "Enter the starting Number : " #prompt for
string
prompt1: .asciiz "Enter the Ending Number : " #prompt for
string
prompt2: .asciiz "Enter the increment Value : " #prompt for
string
prompt3: .asciiz "The generated numbers are : " #prompt for
string
prompt4: .asciiz "\nTotal generated numbers : " #prompt for
string
prompt5: .asciiz "\nAverage of the generated numbers : " #prompt
for string
prompt6: .asciiz " " #prompt for string
prompt7: .asciiz "Invalid entry!!! Starting number is greater than
ending number : " #prompt for string
.text
li $v0,4
la $a0,prompt #it will print prompt
syscall
li $v0,5
syscall #ask user input
move $t0,$v0 #get starting number
li $v0,4
la $a0,prompt1 #it will print prompt
syscall
li $v0,5
syscall #ask user input
move $t1,$v0 #get ending number
li $v0,4
la $a0,prompt2 #it will print prompt
syscall
li $v0,5
syscall #ask user input
move $t2,$v0 #get difference
blt $t1,$t0,totalExit
li $v0,4
la $a0,prompt3 #it will print prompt
syscall
li $s0,0 #load total number of elements
li $s1,0 #load total of the number
loop:
ble $t1,$t0,skip
add $s0,$s0,1 #increase number by one
add $s1,$s1,$t0 #add sum
li $v0,1
move $a0,$t0
syscall
li $v0,4
la $a0,prompt6 #it will print prompt
syscall
add $t0,$t0,$t2
j loop
skip:
li $v0,4
la $a0,prompt4 #it will print prompt
syscall
move $a0,$s0
li $v0,1
syscall
div $s1,$s1,$s0 #get average
li $v0,4
la $a0,prompt5 #it will print prompt
syscall
move $a0,$s1
li $v0,1
syscall
li $v0,10 #terminate
syscall
totalExit:
li $v0,4
la $a0,prompt7 #it will print prompt
syscall
output:

1. Write and debug a MIPS program that performs the following operations . Prompt for and...
Your
program write
a program to test whether a number is prime or not.
Your program should
ask user to input an integer and respond: "Prime" or "Not
prime".
Don't use any
library function that tests for prime numbers.
The program should
continue to ask for input, till it sees a 0, when it exits.
Please submit printed
pseudocodeshould ask user to input an
integer and respond: "Prime" or "Not prime".
Don't use any library function that tests for prime numbers....
Using MARS simulator, write MIPS programs according to the following scenarios: Receive a positive integer number from the user and print out “prime”/“not prime” result if the entered number is prime or not. Remarks: • Write your name and Id inside the program file.(my name is Nabil Mohsen Alzeqri)and (my ID: 61330237) • All programs must be commented. • A description of the method used in the program should be provided. • The program should have been already tested using...
Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a high level language of your choice and in Assembly to find a Fibonacci number and check your result. At the end of this assignment a possible solution to this problem is given both in Python and MIPS assembler. Note that it would have been possible to write the Python differently to achieve the same function. . [20 points] Write and debug a MIPS program...
MIPS 1(a): Using MARS (MIPS assembly simulator), write and debug a program with comments that will store words in a RAM array using the instruction sw and indirect addressing as specified in the data table below. Although the addresses and data are in given hexadecimal, your code will contain corresponding values in decimal. Use (268501056)_10 = (10010040)_16 as the base address of the array. Since the instruction sw and indirect addressing (using offsets) are needed to store the data in...
Complete the Python program below that performs the following operations. First prompt the user to input two integers, n and m. If n<m, then print the odd positive integers that are less than m (in order, on a single line, separated by spaces). If man, then print the even positive integers that are less than n (in order, on a single line, separated by spaces). If neem, then print nothing. For instance, if the user enters 5 followed by 10,...
Write a MIPS program to that will take two 4x4 matrices, and calculate their sum and product, using row major, and column major math (so this is actually 4 problems, but obviously they’re all pretty related). I generated two sample arrays to test 2 1 9 2 7 9 10 10 3 4 4 4 2 5 4 4 8 7 1 2 2 7 8 6 7 5 6 8 9 4 8 9 The output of your program...
For each problem, you must: Write a Python program Test, debug, and execute the Python program Save your program in a .py file and submit your commented code to your Student Page. Note regarding comments: For every class, method or function you create, you must provide a brief description of the what the code does as well as the specific details of the interface (input and output) of the function or method. (25 pts.) Write a program that reads in...
Introduction: In this lab, you will write a MIPS program to read in (up to) 50 integer values from the user, store them in an array, print out the amay, one number per line, reverse the elements in the array and finally print out the elements in the just-reversed) array. Feel free to do this lab and all assembly programming labs) in Windows. You must use MARS Getting started: l. In MARS, create a new assembly file with the name...
Write a MIPS code which involves three functions: a. main b. poly c. pow to compute the value of the polynomial given below for any value of x, as given by the user. f(x) = 3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6 Your program must pass arguments to functions such as poly and pow and get return values from these functions. The input to the program (which is x) is...
C++ (1) Write a program to prompt the user for an input and output file name. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs. For example, (user input shown in caps in first line, and in second case, trying to write to a folder which you may not have write authority in) Enter input filename: DOESNOTEXIST.T Error opening input file: DOESNOTEXIST.T...