ITPEC FE Morning April 2018 Question 9

Which of the following addressing modes determines the effective address by adding the value of the instruction address register (program counter) to the value recorded in the address part of the instruction?

Explanation

Relative addressing — the effective address is the program counter plus the address part of the instruction.

Addressing modes differ in what is added to the address part (the displacement):

  • •Relative: program counter + displacement, so the target is given relative to the current instruction and the code runs unchanged wherever it is loaded
  • •Base: base register + displacement
  • •Indexed: index register + displacement
  • •Absolute (direct): the address part itself is the effective address

Answer (d)

Why not others:

  • •(a) — absolute addressing adds nothing; the address part is used as it is
  • •(b) — base addressing adds the base register, which holds the start address of a program or data area
  • •(c) — indexed addressing adds the index register, which steps through the elements of an array

Key rule: Name an addressing mode by the register added to the displacement: program counter for relative, base register for base, index register for indexed, none for absolute.

Computer Component · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.