20.6k views
1 vote
Consider the MARIE program below. What is the value stored in the AC when the program terminates? Indicate the base with your answer.

Hex
Address Label Instruction
100 Start. LOAD A
101 ADD B
102 STORE D
103 CLEAR
104 OUTPUT
105 ADDI D
106 STORE B
107 HALT
108 A. HEX 00FC
109 B. DEC 14
10A C. HEX 0108
10B D. HEX 0000

1 Answer

3 votes

Final answer:

The value in the AC (Accumulator) at the end of the MARIE program cannot be determined without the content at the indirect address 010A. However, before the execution of the ADDI D instruction, the AC contains the value HEX 0000.

Step-by-step explanation:

The student has asked to determine the value stored in the AC (Accumulator) when the MARIE program terminates. To find this value, we need to step through the program instructions. Here's the breakdown:

  1. LOAD A - Loads the value from address 108, which is HEX 00FC into the AC.
  2. ADD B - Adds the value from address 109 with the current value in AC. Address 109 holds DEC 14, which is HEX 0E. The result is 00FC + 0E = 010A, stored back to the AC.
  3. STORE D - Stores the current value from the AC (010A) into address 10B.
  4. CLEAR - Clears the AC, setting it to 0000.
  5. OUTPUT - No impact on AC. The OUTPUT instruction would display the contents of AC, which is currently 0000.
  6. ADDI D - Adds the value at the address held in address 10B to the AC. Address 10B (D) now contains 010A, suggesting an indirect reference, which leads us to the value at address 010A (not given), which will then be added to AC.
  7. STORE B - The value from the previous operation would be stored in address 109 (B).
  8. The program then reaches the HALT instruction, terminating the execution.

Without the value at the indirect address 010A, we cannot definitively determine the final value stored in the AC. We can state, however, that before the ADDI D instruction took effect, the AC contained the value HEX 0000.

User Filmor
by
9.0k points