Complex and Relative Addressing Modes: Effective Address Examples for GATE

Learn to separate address arithmetic, memory dereferences, PC-relative offsets, and register side effects. The worked examples use one 32-bit machine state throughout.

KnowledgeGate Team

Exam prep & CS education

Updated 31 Oct 20265 min read
Complex and Relative Addressing Modes: Effective Address Examples for GATE

An instruction can contain a number without that number being the final operand address. That is where complex and relative addressing questions become deceptive: you may stop before the last dereference, use the instruction's starting address instead of the post-fetch PC, or update a register in the wrong order. One shared machine state and fully worked hexadecimal calculations address all three errors. Use a repeatable method for finding the effective address, the operand, and any side effect rather than memorizing a catalogue of definitions.

Start with the effective-address model

An addressing mode is a rule for locating an operand or a control-flow target. EA denotes effective address, and M[x] denotes the contents of memory at address x.

Keep the address separate from the stored value. If EA = 0x1030 and M[0x1030] = 42, then 0x1030 is the effective address. The operand fetched from that address is 42.

Use this byte-addressable 32-bit machine for the calculations:

  • A word occupies 4 bytes.

  • The instruction starts at 0x0200 and occupies 4 bytes.

  • After fetch, PC = 0x0204.

  • Rb = 0x1000 and Ri = 0x0024.

  • Displacements are signed two's-complement values.

The earlier Addressing Modes and Instruction Formats guide owns the survey of immediate, direct, indirect, and instruction-format fields. The calculations below start where that survey stops: stack a base, index, displacement, optional pointer dereference, and register side effect without confusing a temporary address with the final EA.

Decode complex modes as combinations of simple steps

"Complex addressing mode" names a family of combinations, not one universal formula. Read a compound operand as an operator pipeline:

Pipeline stage

Rule

Result

Combine components

T = Rb + Ri + d

Temporary address

Apply a scale when stated

T = Rb + s x Ri + d

Scaled temporary address

Follow one stored pointer

EA = M[T]

Final effective address

Fetch the operand

operand = M[EA]

Stored value

Use scale s only when supplied. Keep address calculation separate from indirection:

  1. Calculate a temporary address: T = Rb + Ri + d.

  2. Read the pointer stored there: EA = M[T].

  3. Read the operand: M[EA].

Steps 2 and 3 are two data-memory reads after fetch. Pre-decrement and post-increment are ordered side effects whose amount follows operand size, here 4 bytes.

Work a base-indexed-displacement example all the way through

Suppose Rb = 0x1000, Ri = 0x0024, displacement d = 0x000C, and M[0x1030] = 42. For the operand form 0x000C(Rb,Ri):

EA = 0x1000 + 0x0024 + 0x000C

First, 0x1000 + 0x0024 = 0x1024. Then 0x1024 + 0x000C = 0x1030. Therefore:

EA = 0x1030, and operand = M[0x1030] = 42.

Now extend the state to the indirect compound form @0x001C(Rb,Ri), with M[0x1040] = 0x2080 and M[0x2080] = 99:

  1. T = 0x1000 + 0x0024 + 0x001C = 0x1040.

  2. EA = M[0x1040] = 0x2080.

  3. Operand = M[0x2080] = 99.

The first sum does not finish the indirect problem. It only locates the pointer.

Form

Arithmetic result

Final EA

Operand

Data-memory reads

0x000C(Rb,Ri)

0x1030

0x1030

42

1

@0x001C(Rb,Ri)

T = 0x1040

0x2080

99

2

Two effective-address pipelines compare direct addressing yielding EA 0x1030 and an extra dereference through 0x1040 to M[0x2080] = 99.

Compute PC-relative targets from the correct PC

Consider a branch instruction that begins at 0x0200, occupies 4 bytes, and contains the 8-bit displacement field 0xD0. The architecture defines the reference as the next instruction, so begin with PC = 0x0204.

As an unsigned value, 0xD0 is 208. As a signed 8-bit two's-complement value, it is 208 - 256 = -48, which is -0x30. The target is therefore:

EA = 0x0204 - 0x0030 = 0x01D4.

If the branch is taken, load PC = 0x01D4. If it is not taken, execution continues at 0x0204. The target is 48 bytes behind the next PC, but only 44 bytes before the branch's starting address. That difference exposes the instruction-length trap.

For this stated byte-displacement format, an 8-bit signed field ranges from -128 to +127. Relative to 0x0204, the reachable range is:

  • Lowest target: 0x0204 - 0x0080 = 0x0184.

  • Highest target: 0x0204 + 0x007F = 0x0283.

Apply word scaling or instruction scaling only when the question or ISA says that the displacement is scaled.

Address-line figure shows a 4-byte instruction at 0x0200, post-fetch PC 0x0204, and target 0x01D4 reached by an offset of -48 bytes.

Keep auto-increment and auto-decrement order straight

For post-increment (R4)+, let R4 = 0x1000 and M[0x1000] = 17. Use the old register value as the EA, read the operand, and then increment the register by one 4-byte word.

For pre-decrement -(R4), begin with R4 = 0x1004. Decrement first, then use the new register value as the EA.

Form

Before

Use

After

(R4)+

R4 = 0x1000

EA = 0x1000, operand = 17

R4 = 0x1004

-(R4)

R4 = 0x1004

First set R4 = 0x1000, then EA = 0x1000, operand = 17

R4 = 0x1000

The update is 4 only because this example accesses a 4-byte word. A byte or half-word operation can use a different update amount.

Use a five-step check to avoid addressing-mode traps

Before substituting any values, turn the notation into an explicit procedure:

  1. Identify the reference register.

  2. Sign-extend the displacement.

  3. Perform the address arithmetic.

  4. Count the required dereferences.

  5. Apply any register update at its defined time.

The worked values make wrong answers easy to diagnose. In the indirect example, 0x1040 is only the temporary address, 0x2080 is the final EA, and 99 is the operand. In the branch example, 0x02D4 comes from treating 0xD0 as unsigned +208. The value 0x01D0 comes from subtracting 0x30 from the starting address 0x0200 instead of the post-fetch PC 0x0204.

A negative relative displacement must move backward from the stated reference. Every M[...] in a formula represents one memory lookup unless the question defines a cache or another abstraction.

How GATE-style questions can test the concept

The official GATE 2026 CS syllabus places "Machine instructions and addressing modes" under Computer Organization and Architecture. That statement establishes scope, not weightage or frequency.

The official GATE 2026 question-paper pattern permits MCQ, MSQ, and NAT questions. An MCQ can offer competing EA values. An MSQ can test several true claims about update order and dereference count. A NAT can ask for 0x01D4, or 468 when the answer is explicitly required in decimal.

These calculations isolate compound and PC-relative traps rather than repeat the broad mode survey. Next, use Addressing Modes and Instruction Formats MCQs: 12 Solved COA Questions to practise the distinctions, or move across related topics in CS Fundamentals for Exams and Placements.

Short version and next step

Write the formula, sign-extend first, calculate the EA, dereference exactly as many times as the formula shows, and perform pre/post updates in order. The two anchor answers are worth checking once more: the compound indirect form gives EA = 0x2080 and operand 99; the PC-relative branch target is 0x01D4.

If you need a full core-CS learning sequence, continue with ZERO TO HERO. If you want a structured GATE preparation path, use GATE Guidance by Sanchit Sir. Choose your next path, then solve the examples without the formulas.