Multiple choice

Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.

InstructionR OperationR Instruction size (no. of words)R
MOV R1, (3000)R R1 _ m[3000]R 2R
LOOP: MOV R2, (R3)R R2 _ M[R3]R 1R
ADD R2, R1R R2 _ R1 + R2R 1R
MOV (R3), R2R M[R3] _ R2R 1R
INC R3R R3 _ R3 + 1R 1R
DEC R1R R1 _ R1 - 1R 1R
BNZ LOOPR Branch on not zeroR 2R
HALTR StopR 1R

Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are in decimal.

Assume that the memory is byte addressable and the word size is 32 bits. If an interrupt occurs during the execution of the instruction “INC R3”, what return address will be pushed on to the stack?

  1. 1005

  2. 1020

  3. 1024

  4. 1040

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation