For this assignment write a MAL program that returns the largest of the positive integers entered by the user. The program should continue to prompt for input as long as the user enters a positive number. When the user enters 0 or a negative integer, the program should print the largest of the values. If the user does not enter any positive values, the program should report 0 as the largest value.
In this program you will get experience using branches for simple control
structures and using the syscall
instruction for access to
primitive operating system services.
You should read the web page shown in the references section before attempting this programming assignment. Try running the code for the sums.s example first. The sums.s program has examples of everything you need for this assignment:
.asciiz
directive
syscall
instruction
b
,
blt
, bge
, etc.)
syscall
instruction
Turn in both a copy of your program and a Mars session record showing a session assembling and running your program the following user inputs:
Your TA may also ask you to demonstrate your program in lab.