GateAI
Instruction Set and Addressing Modes

GATE CSE 2017 Set 1 · Q11

MCQ1 markEasy

Time

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 using

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) Index addressing mode, X(R1), where X is an offset represented in 2's complement 16-bit representation.

Instruction Set and Addressing Modes

To access a specific field within a structure:

  1. The base address of the structure variable student is fixed in register R1.

  2. The member grade is located at a fixed compile-time byte offset from the start of the structure (specifically, the offset is after marks[100], which is 100×sizeof(int)100 \times \text{sizeof(int)} bytes, plus any required padding/alignment).

  3. In assembly/machine language, accessing an element at a fixed displacement from a base register is most efficiently performed using Base-Register / Indexed / Displacement addressing mode:

    Effective Address=Base Register (R1)+Offset X\text{Effective Address} = \text{Base Register (R1)} + \text{Offset } X

    where XX is the constant offset.

Therefore, (D) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Instruction Set and Addressing Modes previous year question is Q11 of the GATE CSE 2017 Set 1 paper. Find more GATE CSE PYQs on Instruction Set and Addressing Modes in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Instruction Set and Addressing Modes PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Instruction Set and Addressing Modes in GATE CSE

Instruction Set and Addressing Modes has 19 GATE CSE PYQs across 15 papers from 2011 to 2026. 6 of them are 1-mark MCQs like this one, and GATE CSE 2017 Set 1 has 2.

How GATE tests Instruction Set and Addressing Modes

More from GATE CSE 2017 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2017 Set 1 · Q11 · MCQ

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 using

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.