GATE | GATE-CS-2005 | Question 66

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.

 1 A[1] = B[J];         a Indirect addressing
 2 while [*A++];     b Indexed, addressing
 3 int temp = *x;    c Autoincrement 

(A) (1, c), (2, b), (3, a)
(B) (1, a), (2, c), (3, b)
(C) (1, b), (2, c), (3, a)
(D) (1, a), (2, b), (3, c)


Answer: (C)

Explanation:

List 1                           List 2
1) A[1] = B[J];      b) Indirect addressing 
Here indexing is used

2) while [*A++];     c) auto increment
The memory locations are automatically incremented

3) int temp = *x;    a) Indirect addressing
Here temp is assigned the value of int type stored
at the address contained in X

Hence (C) is correct solution.

See Addressing Modes for more information.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.