• edited by
11,401 views
39 39 votes

Match each of the high level language statements given on the left hand side with the most natural addressing mode from those listed on the right hand side.$$\begin{array}{clcl} \text{(1)} &\text{$A[I] = B[J]$} & \qquad\text{(a)} &\text{Indirect addressing} \\ 
\text{(2)} &\text{while }(^*A\text{++}); & \qquad\text{(b)} & \text{Indexed addressing} \\   
\text{(3)} & \text{int temp = }*x & \qquad\text{(c)} &\text{Auto increment}  \\ \end{array}$$

  1. $(1, c), (2, b), (3, a)$
  2. $(1, c), (2, c), (3, b)$
  3. $(1, b), (2, c), (3, a)$
  4. $(1, a), (2, b), (3, c)$

2 Answers

Best answer
49 49 votes

$C$ is the answer.

  • $A[i] = B[j]$;     Indexed addressing
  • while $(^*A++)$;      Auto increment
  • temp $=^*x$;       Indirect addressing
• edited by
7 7 votes

A[i] = B[j];

  • Array indexing hai, yaani base address + index offset.
  • Yeh typical example hai indexed addressing ka.
  • So (1) → (b)

while(*++A);

  • Yahaan pointer A ko pre‐increment karke uski nayi location ko dereference kar rahe hain.
  • Isse kehte hain “auto‐increment addressing,” kyunki pointer update + use ho raha hai.
  • So (2) → (c)

*int temp = x;

  • Yahaan pointer x ko dereference karke uske andar ke address se data la rahe hain.
  • Yeh direct example hai indirect addressing ka (pointer ke andar ke address par jaa ke access).
  • So (3) → (a)

 

Answer:
Position:
Show:

Related questions

32 32 votes
3 answers 3 answers
15.6k
15.6k views
gatecse asked Sep 21, 2014
15,641 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...
202 202 votes
9 answers 9 answers
80.0k
80.0k views
Kathleen asked Sep 22, 2014
79,995 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
10 10 votes
3 answers 3 answers
4.3k
4.3k views
sh!va asked May 7, 2017
4,253 views
The most appropriate matching for the following pairs :$\begin{array}{clcl} \text{X.} & \text{Indirect Addressing} & \text{i.} & \text{Loop} \\ \text{Y.} & \text{Immedi...
44 44 votes
3 answers 3 answers
12.9k
12.9k views
Misbah Ghaya asked Nov 27, 2016
12,914 views
Match the pairs in the following questions:$$\begin{array}{|ll|ll|}\hline \text{(A)} & \text{Base addressing} & \text{(p)} & \text{Reentranecy} \\\hline \text{(B)} & \te...