retagged by
8,778 views
9 votes
9 votes
Consider the following instruction sequence where registers $\text{R1}, \text{R2}$ and $\text{R3}$ are general purpose and $\text{MEMORY[X]}$ denotes the content at the memory location $\text{X}.$

$\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 $\text{R3}$ is $3000$. The content of each of the memory locations from $3000$ to $3020$ 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 ____________
retagged by

3 Answers

Best answer
20 votes
20 votes
The given code is iterating 10 times and incrementing the contents of locations $3000$ to $3000+i$ by $10-i,$ for $i < 10.$ Location $3010$ is left untouched.

So, correct answer: $50.$
selected by
Answer:

Related questions