Back to the 2014 paper

Module 2: x86 Architecture, CPU Control, I/O, Memory System Design

20142m

Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the effective address of the memory operand in each of the following instructions?

  • (i) Load 20(R1), R5
  • (ii) Add –(R2), R5
Worked SolutionAI Assisted

Answer: Effective Address calculation:

Given R1=1200, R2=4600
(i) Load 20(R1), R5 → Indexed/Displacement mode: EA = R1 + 20 = 1200+20 = 1220. Content at memory 1220 loaded into R5.
(ii) Add -(R2), R5 → Autodecrement mode: First R2 = R2 - word size (assume 4 for 32-bit or 1 for simplicity; textbook uses R2 = 4600-1 = 4599 if byte, or 4596 if word). If byte-addressable decrement by 2? Typically -(R) means R ← R - size, then EA = R (new). So EA = 4599 (byte) or 4596 (word), value at that address added to R5. If size unspecified, EA = R2 -1 = 4599.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.