Answered>Order 7690

This is a MARIE Assignment to RUN and then to MODIFY a Program. This is an INDIVIDUAL ASSIGNMENT. You may discuss the task with others, but the modified program you test and submit must be YOUR OWN WORK and only YOUR work. (1) RUN The attached file “add_two_numbers.mas” is a MARIE program to do the simple addition of two number already stored in memory (Num1, Num2). The answer is stored at Result and also put in the Output window (the Output Register). RUN this program and verify that it works in your downloaded copy of the MARIE Simulator. (2) MODIFY (Make another program based on that one) Copy that file and rename the copy “Add_Four_if_result_positive.mas”. Change that program in two ways: (a) Make it add four numbers (Num1, Num2, Num3, Num4) instead of the two it originally handled. (b) Add a decision before storing and outputing the result. If the value of the result is not positive (so zero or negative), set the Result value to the value ZERO (0). So, the program will implement this kind of logic: Result = Num1 + Num2 + Num3 + Num4; If (Result < 1) Result = 0; Output Result; This will require figuring out how the SkipCond instruction works (and whether to give it a Hex operand of 000, 400, or 800. Additional Requirements Level of Detail: Show all work

 
"Not answered?"
Get the Answer