Objective: compute z = x times y You Team is to design, build, and run a MARIE p
ID: 3769571 • Letter: O
Question
Objective: compute z = x times y You Team is to design, build, and run a MARIE program that multiplies two decimal integer numbers given as initial values (typed as data into the program assembly language statements before they are assembled). MARIE does not have a multiplication operation, so a repeated-addition strategy is likely for your program. (You are welcome to consider other approaches.) For this first MARIE team programming assignment, do not use the Input operation, which would obtain a number from the user at run time. Instead, "hard code" places in the data area of your program to hold AND KEEP AVAILABLE the (initial) values to be multiplied (x and y). "Keep available" means that you must not overwrite or destroy those values. At the end of the program, the memory locations for x and y should have the two starting values still. A memory location for z should have the calculated result. If your computation would change the value of x or y, you need to work on a copy of that variable, not the original. You do not have to use the Output operation (which sends something to the Output Register, imitating I/O). The calculated result can be left in a memory location z that is defined in your program. Try your program with at least these value pairs: and continue testing with other values of your choice. Your Team is to submit a latest version of your multiplication program ("1st try") by Tuesday 12/8 for feedback. You should have assembled the program that tested it. Call the program "teamNjnultiply.mas" to run and test it, treating the mas file as text for editing. (N is replaced by your Team/group number.) Since email and browsers on some machines object to the ".mas" suffix (believing it to be harmful macros), rename the copy that you are submitting to the same file name with the ending ".txt". While awaiting feedback, KEEP TESTING and fixing/improving your Team's program. The objective is to produce a program that will calculate a correct result for any x and y numbers that it is given. When your Team receives feedback, run any tests stated in the feedback and fix your program as necessary. Your Team's final version of the x times y multiplication program will be due Wednesday, December 16. (There will be a separate assignment/submission item for the final program. This item is for the 1st try submission and its points are for that first submission.) This assignment allows multiple submissions, so your team can receive additional feedback as its program changes. HOWEVER, you must have run and tested your program submissions. If obviously untested, a program will be returned to your Team for testing before feedback.Explanation / Answer
Check this is working well
INPUT
STORE x
INPUT
STORE y
loop, LOAD x
ADD multiply
STORE multiply
LOAD y
SUBT one
STORE y
SKIPCOND 400
JUMP loop
LOAD multiply
OUTPUT
HALT
x, Dec 0
y, Dec 0
one, Dec 1
multiply, Dec 0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.