Question: Input the program on page 2 5 8 on the MARIE simulator environment. Observe the changes of the different registers ( Addr , Next, Num,
Input the program on page on the MARIE simulator environment. Observe the changes of the different registers Addr Next, Num, Sum, Ctr
tableEXAMPLE Here is an example using a loop to add five numbers:Hex Address Instruction firstLoad,,Load address of first number to be addedStore,Nex,Load,Num,Load thentSubt,One, Store this value in Ctr to controlStore,,Load the Sum into ACLoop, Load,tableSumNextAdd the value pointed to by location NoxtAddI,Sum,Store this sumLoad,Next, Load NextAdd,One, Increment by one to point to next addre AStore,Next,Store in our pointer NextLoad,CtrLoad the loop control variable CSubt,One, Subtract one from the loop control variableStore,CtrStore this new value in loop control variableSkipcond,tableIf control variable skip nextinstructionJump,Loop,Otherwise go to LoopHalt,,Terminate programAddr, Hex, Numbers to be summed start at locationNext, Hex,A pointer to the next number to addNum, Dec, The number of values to addSum, Dec,The sumCtr Hex,The loop control variableOne, Dec,Used to increment and decrement byDec,The values to be added togetherDec,Dec,Dec,BDec,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
