GATEverse
← GATE CSE 2021 Set 1

Q55

NAT2 marks

Consider the following instruction sequence where registers R1,R2\text{R1}, \text{R2} and R3\text{R3} are general purpose and MEMORY[X]\text{MEMORY[X]} denotes the content at the memory location X.\text{X}. 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 50005000 is 1010, and the content of the register R3\text{R3} is 30003000. The content of each of the memory locations from 30003000 to 30203020 is 5050. The instruction sequence starts from the memory location 10001000. 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 30103010 is ____________

Sign in to save attempts.

Loading…