Consider the following instruction sequence where registers \(R1,R2\) and…

GATE · 2021 · CS · Set 1 · Computer Science & IT

Consider the following instruction sequence where registers R1,R2R1,R2 and R3R3 are general purpose and MEMORY[X]MEMORY[X] denotes the content at the memory location XX.

InstructionSemanticsInstruction Size (bytes)MOV R1,(5000)R1←MEMORY[5000]4MOV R2,(R3)R2←MEMORY[R3]4ADDR2,R1R2←R1+R22MOV (R3),R2MEMORY[R3]←R24INC R3R3←R3+12DEC R1R1←R1−12BNZ 1004Branch if not zero to the2given absolute addressHALTStop1\begin{array}{llc} \textbf{Instruction} & \textbf{Semantics} & \textbf{Instruction Size} \text{ (bytes)} \\ \hline \text{MOV } \text{R1}, (5000) & \text{R1} \leftarrow \text{MEMORY}[5000] & 4 \\ \hline \text{MOV } \text{R2}, (\text{R3}) & \text{R2} \leftarrow \text{MEMORY[R3]} & 4 \\ \hline \text{ADD} \text{R2}, \text{R1} & \text{R2} \leftarrow \text{R1} + \text{R2} & 2 \\ \hline \text{MOV } (\text{R3}), \text{R2} & \text{MEMORY[R3]} \leftarrow \text{R2} & 4 \\ \hline \text{INC } \text{R3} & \text{R3} \leftarrow \text{R3}+1 & 2 \\ \hline \text{DEC } \text{R1} & \text{R1} \leftarrow \text{R1}-1 & 2 \\ \hline \text{BNZ } 1004 & \text{Branch if not zero to the} & 2 \\ & \text{given absolute address}& \\ \hline \text{HALT} & \text{Stop} & 1 \\ \hline \end{array}

Assume that the content of the memory location 5000 is 10, and the content of the register R3R3 is 3000. The content of each of the memory locations from 3000 to 3010 is 50. The instruction sequence starts from the memory location 1000. All the numbers are in decimal format. Assume that the memory is byte addressable.

After the execution of the program, the content of memory location 3010 is ____________ .

Attempted by 92 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…