Addressing Modes · Computer Organization and Architecture
12 questions · asked in 11 of 27 years (2000–2026)
MCQ 11 · NAT 11-mark 10 · 2-mark 2
2000Questions per year2026
Questions 1–5 of 12
Match each addressing mode in with a data element or an element of a data structure (in a high-level language) in :
Answer: (B)
Match each addressing mode with the data element it is normally used for:
- P. Immediate: the operand value is placed inside the instruction itself → used for a Constant (4).
- Q. Indirect: the instruction holds the address of the address of the data → used for a Pointer (2).
- R. Base with index: effective address = base + index. It is normally used to reach an Element of an array (1), where the base is the start of the array and the index is the subscript.
- S. Base with offset/displacement: effective address = base + a fixed offset. It is normally used to reach an Element of a record/struct (3), where the base is the start of the record and the offset is the position of the field.
Answer: P-4, Q-2, R-1, S-3
- P. Immediate: the operand value is placed inside the instruction itself → used for a Constant (4).
- Q. Indirect: the instruction holds the address of the address of the data → used for a Pointer (2).
- R. Base with index: effective address = base + index. It is normally used to reach an Element of an array (1), where the base is the start of the array and the index is the subscript.
- S. Base with offset/displacement: effective address = base + a fixed offset. It is normally used to reach an Element of a record/struct (3), where the base is the start of the record and the offset is the position of the field.
Answer: P-4, Q-2, R-1, S-3
Consider the C struct defined below:
struct data {
int marks [100] ;
char grade;
int cnumber;
};
struct data student; The base address of student is available in register R1. The field student.grade can be accessed efficiently usingAnswer: (D)
The array has 100 ints. With 4-byte ints it takes 400 bytes, and comes right after it, so is at a fixed offset of 400 bytes from the start of the struct. Its address is R1 + 400.
Index (displacement) addressing, , forms exactly this address. The offset fits easily in a 16-bit 2's complement number.
The others cannot do it efficiently:
- (R1)+ reaches only the address in R1 (the start of the struct), then increments R1.
- -(R1) first decrements R1 and so reaches the memory before the struct.
- Register direct, R1, uses the register's own value as the operand, not a memory location.
Answer: (D)
Index (displacement) addressing, , forms exactly this address. The offset fits easily in a 16-bit 2's complement number.
The others cannot do it efficiently:
- (R1)+ reaches only the address in R1 (the start of the struct), then increments R1.
- -(R1) first decrements R1 and so reaches the memory before the struct.
- Register direct, R1, uses the register's own value as the operand, not a memory location.
Answer: (D)
Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC- relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence.
If the target of the branch instruction is i, then the decimal value of the Offset is __________
If the target of the branch instruction is i, then the decimal value of the Offset is __________
Answer: -16
The beq is instruction . The offset is counted from the next instruction, .
Each instruction is 4 bytes, so:
The target is instruction , so
Answer: -16
Each instruction is 4 bytes, so:
The target is instruction , so
Answer: -16
For computers based on three-address instruction formats, each address field can be used to specify which of the following:
(S1) A memory operand
(S2) A processor register
(S3) An implied accumulator register
(S1) A memory operand
(S2) A processor register
(S3) An implied accumulator register
Answer: (A)
In a three-address instruction, every address field names a memory location or a register directly. An implied accumulator belongs only to one-address formats.
Answer: Either S1 or S2
Answer: Either S1 or S2
Consider a hypothetical processor with an instruction of type LW R1, 20(R2), which during execution reads a 32-bit word from memory and stores it in a 32-bit register R1. The effective address of the memory location is obtained by the addition of constant 20 and the contents of register R2. Which of the following best reflects the addressing mode implemented by this instruction for the operand in memory?
Answer: (D)
The effective address is found by adding the constant 20 to the contents of R2. When a register is added to a displacement, this is called base (base-indexed or displacement) addressing.
Answer: Base Indexed Addressing
Answer: Base Indexed Addressing
Keep practising