Question
Problem Statement: A quick look at the mnemonics available in the MARIE instruction set indicate that MARIE does not support a division operation. We know
Problem Statement: A quick look at the mnemonics available in the MARIE instruction set indicate that MARIE does not support a "division" operation. We know that division is really "iterative subtraction" (right...?), and a look at MARIE's mnemonics confirms that a subtraction operation is supported. You might want to code a solution in Java to get a sense of the mechanics for how iterative subrtraction can substitute for integer division. The divisor and dividend should be coded in as initialized values in the source program. The program should produce and display the quotient and the remainder (after all, your algorithm will produce both values). Be sure to use names (labels) that identify clearly the function of the data item. So that I may evaluate your work and give appropriate credit, please place the following in the drop:
- The source list -- this is the .mas (or .lst) file.
- Output from the test run -- this is a snapshot of the MARIE CPU/memory with the results in the output window after you have completed the division operation and displayed the result.
- The Test Plan -- this can be a text based file that shows the input data and anticipated output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started