Question: a ) Write a MARIE assembly program that performs the following tasks: 1 . Input a number from the user and store it in a

a) Write a MARIE assembly program that performs the following tasks:
1. Input a number from the user and store it in a memory location (X).
2. Initialize a counter to 1.
3. Loop as long as the value of \( X \) is less than 10 :
- Display the value of \(\mathbf{X}\) to the user.
- Increment the value of X by 1.
- Increment the counter by 1.
4. When the value of \( X \) is no longer less than 10, exit the loop.
5. Display the final value of the counter, which represents how many times the loop was executed.
6. Terminate the program.
Expected behavior:
- Example: if the entered value is 5, the values \(5,6,7,8,9,10\)(one number per line) will be displayed followed by the number of iterations. Note that the number 10 should be displayed.
a) Include a screenshot of the simulation's result (A screenshot of the MARIE Simulator window after running the program).
Instructions:
- Use "ORG" instruction to start your program at an address equivalent to 20008.
- Use your last university ID number to input the new value of \( x \). For example, if your ID is 2413161678239, then you will use the number 9 as the value of \( x \).
- Do not forget to change the Input and Output boxes to decimal!
- Proper labels and directives should be included at the end of your program.
Activate Windows
a ) Write a MARIE assembly program that performs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!