MARIE Programming Problems
For all programs, put
comments with your name and a brief description of the problem at the top of
For all programs, get a
printout of the LST file and hand it in.
For all programs, put the MAS
(MARIE Assembly language) and MEX (MARIE EXecutable) files in the drop box.
Put them in the drop box separately; don't zip them up.
two numbers and output their sum. In
three numbers from the keyboard and output their sum.
(output) the odd numbers from 1 to 99. You must use a loop.
three numbers from the keyboard and output the largest of the three. To
verify that your program works, test all 6 possibilities: 1-2-3, 1-3-2,
2-1-3, 2-3-1, 3-1-2, 3-2-1. You do not need to
worry about the possibility of two numbers being equal.
a list of numbers from the keyboard and output their sum. The size of the
list is unknown, but the last number in the list is 0. The numbers may be
positive or negative.
a list of numbers from the keyboard and output the largest. The first
number input will be an integer telling how many numbers follow in the
list. You may assume that there will be at least 1 number input (the size
of the list will not be 0). The numbers that are in the list may be
positive, negative, or 0.
two positive numbers from the keyboard and output their product. Since
there is no multiply instruction on MARIE, use repeated addition.
three numbers from the keyboard and output them in ascending order. Again,
test all 6 possibilities (see above). The bubble-sort algorithm may be
helpful here. You do not have to implement the entire bubble-sort
algorithm, but I think you may want to model your solution on the