Which of the following addressing modes is convenient to handle pointers?
indirect addressing
Addressing modes determine how the operand (the data being operated upon) of an instruction is specified. Different addressing modes are used depending on how and where the data is stored.
Let's look at some common addressing modes:
A pointer is a variable that stores the memory address of another variable. When you use a pointer, you are essentially saying "go to this address and find the data there".
Consider a pointer variable, say ptr, which holds the address of another variable, say data_var.
If you want to access the value of data_var using ptr, you first need to read the content of ptr (which is an address) and then use that address to fetch the value of data_var.
Let's see how addressing modes relate to this:
Therefore, indirect addressing is the most convenient mode for handling pointers because it directly supports the concept of using a stored address to access data.
How many bits are required to distinguish between a direct and an indirect address?
| LIST-I | LIST-II |
| A. Immediate addressing mode | I. MOV A,@R0 |
| B. Indexed addressing mode | II. MOV DPTR,#4521H |
| C. Register addressing mode | III. MOVC A,@A+DPTR |
| D. Register indirect addressing mode | IV. MOV A,R0 |
| List I | List II |
| P. Immediate | 1. Element of an array |
| Q. Indirect | 2. Pointer |
| R. Base with index | 3. Element of a record |
| S. Base with offset/displacement | 4. Constant |