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)
(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) Index 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.
No comments:
Post a Comment