Write a MARIE program to allow the user to input eight integers (positive, negative, or zero) and then find the smallest and the largest and print each of these out.
Please I need this program in MIPS language. ASSEMBLY language. Thank you
The program for the same is as follows:
INPUT
STORE A
INPUT
STORE B
INPUT
STORE C
INPUT
STORE D
INPUT
STORE E
INPUT
STORE F
INPUT
STORE G
INPUT
STORE H
LOAD A //STEPS FOR MAX
SUBT B
SKIPCOND 000
LOAD A
SKIPCOND 800
LOAD B
STORE M
SUBT C
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD C
STORE M
SUBT D
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD D
STORE M
SUBT E
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD E
STORE M
SUBT F
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD F
STORE M
SUBT G
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD G
STORE M
SUBT H
SKIPCOND 000
LOAD M
SKIPCOND 800
LOAD H
STORE M
OUTPUT
LOAD A //STEPS FOR MIN
SUBT B
SKIPCOND 000
LOAD B
SKIPCOND 800
LOAD A
STORE M
SUBT C
SKIPCOND 000
LOAD C
SKIPCOND 800
LOAD M
STORE M
SUBT D
SKIPCOND 000
LOAD D
SKIPCOND 800
LOAD M
STORE M
SUBT E
SKIPCOND 000
LOAD E
SKIPCOND 800
LOAD M
STORE M
SUBT F
SKIPCOND 000
LOAD F
SKIPCOND 800
LOAD M
STORE M
SUBT G
SKIPCOND 000
LOAD G
SKIPCOND 800
LOAD M
STORE M
SUBT H
SKIPCOND 000
LOAD H
SKIPCOND 800
LOAD M
STORE M
OUTPUT
HALT
A, DEC 0
B, DEC 0
C, DEC 0
D, DEC 0
E, DEC 0
F, DEC 0
G, DEC 0
H, DEC 0
M, DEC 0
Description :
First we input all the numbers and store them from A to H. Then we start comparing and store the highest in M.
SKIPCOND 800 if AC > 0, SKIPCOND 000 if AC < 0
The same is done for the Min number, only the conditions are reversed.
Here is the run in Marie sim
Write a MARIE program to allow the user to input eight integers (positive, negative, or zero)...
2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum of both of the integers and all the numbers in between Write a Marie program that determines the largest of a series of positive integers provided by a user. The user will enter a -1 when she is finished. Up to 10 numbers will be provided by the user. Write a Marie program that accepts two positive integers, multiples them by repeated addition, and...
Write a program that prompts the user for positive integers, only stopping when a negative integer or zero is given. The program should then print out how many of the positive integers were odd. Example: Enter a positive integer (0 or negative to stop): 9 Enter a positive integer (0 or negative to stop): 4 Enter a positive integer (0 or negative to stop): 7 Enter a positive integer (0 or negative to stop): -3 You entered 2 odd integers....
Please write a MIPS program to prompt the user to input three positive integers and then print out their greatest common prime factor.What to submit:1. Your MIPS program file.2. The log file of simulation in SPIM. The log file should contain the Registers, Text Segments, Data Segments, and Console.
Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...
Write a C++ program that repeatedly collects positive integers from the user, stopping when the user enters a negative number or zero. After that, output the largest positive number entered. A sample run should appear on the screen like the text below. Enter a number: 3 Enter a number: 10 Enter a number: 2 Enter a number: -213 Output: The largest positive number you entered was 10.
Write a complete C++ program to ask the user to enter 4
integers. The program must use a function
to find the smallest integer among them and print it on the screen.
Typical output screen should be as following:
Write a complete C++ program to ask the user to enter 4 integers. The program must use a functionto find the smallest integer among them and print it on the screen. Typical output screen should be as following: Note: the code...
In Java
Write a program that will ask the user for integers and print if the integer is positive, negative or zero. The program should continue asking for integer until the user enters a negative value.
Write a C program, allow user to input elements. Given a finite set of integers, find all the subsets with the sum of the elements greater than k.
Write a program in MIPS assembly language that implements the DESCENDING bubble sort algorithm to sort a variable-sized array of signed 32-bit integers (words)that are read from the console. Be reminded that in a descending sort, the integers are sorted from the largest to the smallest. A “special value” 99999 will beused to signify the end of the input sequence. This value is not to be considered part of the input data set. However, any value greater than 99999 that...
C++ Write a program that asks user to input three positive integers one at a time, then compute and output the largest entered number. Use if-else statements for three integer comparison and use for loops for a user validation. Example output: Enter an integer: -7 Invalid! Number must be positive. Enter an integer: -2 Invalid! Number must be positive. Enter an integer: 5 Enter an integer: 7 Enter an integer: 1 Largest number: 7