Question

Write a MARIE program to allow the user to input eight integers (positive, negative, or zero)...

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

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

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

Add a comment
Know the answer?
Add Answer to:
Write a MARIE program to allow the user to input eight integers (positive, negative, or zero)...
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
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