2a) (30pts) Write MARIE assembly to do this program, using iteration and if/then/else. You will use two data values, one called NUM, initialized to 5. And one called RESLT, that stores the result of...

1 answer below »


2a) (30pts) Write MARIE assembly to do this program,
using iteration and if/then/else. You will use two data values, one called NUM, initialized to 5. And one called RESLT, that stores the result of the calculation, initialized to zero. You will also need some other variables (your figure out).




CTRL = 0



FOR I = 0 to 5



If CTRL == 0



RESLT = RESLT + NUM



CTRL = CTRL + 1



ELSE



RESLT = RESLT + RESLT



CTRL = CTRL -1




2b) (20pts) “Play Computer”
to execute your program virtually (logically on paper) to show the functioning of your program and to see what the correct answer should be.



2c) (10pts) What is the final value for RESLT?




PAGE 2 (60 points) (you can use multiple pages in your answer) 2a) (30pts) Write MARIE assembly to do this program, using iteration and if/then/else. You will use two data values, one called NUM, initialized to 5. And one called RESLT, that stores the result of the calculation, initialized to zero. You will also need some other variables (your figure out). CTRL = 0 FOR I = 0 to 5 If CTRL == 0 RESLT = RESLT + NUM CTRL = CTRL + 1 ELSE RESLT = RESLT + RESLT CTRL = CTRL -1 2b) (20pts) “Play Computer” to execute your program virtually (logically on paper) to show the functioning of your program and to see what the correct answer should be. 2c) (10pts) What is the final value for RESLT?
Answered Same DayNov 04, 2021

Answer To: 2a) (30pts) Write MARIE assembly to do this program, using iteration and if/then/else. You will use...

Ayush answered on Nov 05 2021
124 Votes
Num=5 , RELST=0 , CTRL=0
I=0:
As CTRL=0, so If Block will execute
RELST=0+5=5
CTR
L=0+1=1
I=1:
As CTRL=1, so Else Block will execute
RELST=5+5=10
CTRL=1-1=0
I=2:
As CTRL=0, so If Block will execute
RELST=10+5=15
CTRL=0+1=1
I=3:
As...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here