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 258 on the MARIE simulator environment. Observe the changes of the different registers (Addr, Next, Num, Sum, Ctr)
\table[[EXAMPLE 4.2 Here is an example using a loop to add five numbers:],[Hex Address Instruction first],[100,Load,,/Load address of first number to be added],[101,Store,Nex,],[102,Load,Num,Load thent],[103,Subt,One,/ Store this value in Ctr to control],[104,Store,,/Load the Sum into AC],[105,Loop, Load,\table[[Sum],[Next]],/Add the value pointed to by location Noxt],[106,AddI,Sum,/Store this sum],[108,Load,Next,/ Load Next],[109,Add,One,/ Increment by one to point to next addre],[10 A,Store,Next,/Store in our pointer Next],[10B,Load,Ctr,/Load the loop control variable],[10 C,Subt,One,/ Subtract one from the loop control variable],[10D,Store,Ctr,/Store this new value in loop control variable],[10E,Skipcond,000,\table[[/If control variable 0, skip next],[/instruction]]],[10F,Jump,Loop,/Otherwise, go to Loop],[110,Halt,,/Terminate program],[111,Addr, Hex,117,/ Numbers to be summed start at location],[112,Next, Hex,0,/A pointer to the next number to add],[113,Num, Dec,5,/ The number of values to add],[114,Sum, Dec,0,/The sum],[115,Ctr, Hex,0,/The loop control variable],[116,One, Dec,1,/Used to increment and decrement by],[117,Dec,10,/The values to be added together],[118,Dec,15,],[119,Dec,20,],[11A,Dec,25,],[11B,Dec,30,]]
Input the program on page 2 5 8 on the MARIE

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!