GATE CSE 2017 Session 1 Q21: Addressing mode to access student.grade in a struct
- Computer Organization and Architecture
- 1 mark
- MCQ
- −1/3 if wrong
Syllabus topic: Instruction set and addressing modes
Question
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
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2017 final answer key)
Concept used: A struct field at a fixed offset from a base address held in a register is reached with base/index (displacement) addressing.
First step: Compute the offset of grade from the start of the struct (after 100 ints) and ask which mode adds a constant offset to R1.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Instruction set and addressing modes
Every PYQ on this topic →Share this question
Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Computer Organization and Architecture PYQs
- 2026 Session 1 · Q14Match addressing modes with high-level data elements
- 2026 Session 1 · Q15Instruction sequence for Z = X + Y on a load-store machine
- 2026 Session 1 · Q16Register dependency that causes a data hazard
- 2026 Session 1 · Q36IEEE 754 single-precision sum of 35C00000 and 34A00000
- 2026 Session 1 · Q38Tag length: direct-mapped vs K-way set-associative cache
- 2026 Session 1 · Q54Impossible TLB / page table / cache event sequences