Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the following MARIE program to add 5 numbers using a loop. (When answer

ID: 3544069 • Letter: C

Question

 Complete the following MARIE program to add 5 numbers using a loop. (When answering, please separate the 4 missing keywords by 1 space)
 
Address Instruction Comments
 100                         Load _____               /Load address of first number to be added
 101                         Store Next               /Store this address as our Next pointer
 102                         ____ Num               /Load the number of items to be added
 103                         Subt One                 /Decrement
 104                         Store Ctr                 /Store this value in Ctr to control looping
 105                         Clear                       /Clear AC
 Loop, 106                   Load Sum               /Load the Sum into AC
 107                         AddI Next               /Add the value pointed to by location Next
 108                         Store Sum                /Store this Sum
 109                         Load Next                /Load Next
 10A                         Add One                   /Increment by one to point to next address
 10B                        Store Next                /Store in our pointer Next
 10C                        Load Ctr                   /Load the loop control variable
 10D                        Subt One                  /Subtract one from the loop control variable
 10E                        Store Ctr                   /Store this new value in the loop control variable
 10F                       ________ 00              /If control variable < 0, skip next instruction
 110                       Jump ____                /Otherwise, go to Loop
 111                       Halt                           /Terminate program
 Addr, 112                 Hex 118                    / Numbers to be summed start at location 118
 Next, 113                 Hex 0                        /A pointer to the next number to add
 Num, 114                  Dec 5                        /The number of values to add
 Sum, 115                  Dec 0                        /The sum
 Ctr, 116                  Hex 0                       /The loop control variable
 One, 117                  Dec 1                        /Used to increment and decrement by 1
  

Explanation / Answer

100      load One

102      load Num

10F      skiocond 00

100      jump 106


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote