Skip to main content

LD instruction under addressing modes

Short answer

The LD instruction loads data into the accumulator using various addressing modes: immediate (LD #NBR), direct (LD ADR), indirect (LD @ADR), relative (LD $ADR), indexed (LD ADR(X)), register (LD R1), register indirect (LD (R1)), and autoincrement (LD (R1)+). Each mode computes a different effective address: immediate uses the operand in the instruction, direct uses the address field, indirect fetches the address from memory, relative adds to PC, indexed adds to XR, and register modes use register contents directly or as pointers.

Describe the operation of the LD (load) instruction under various addressing modes with syntax.

LD (load) copies data into a register (usually the accumulator AC) from the memory or from the instruction. The effective address (EA) depends on the mode. Syntax shown is the form used in textbooks; # means immediate, @ means indirect.

ModeSyntaxOperation
ImmediateLD #NBRAC ← NBR (operand is in the instruction)
DirectLD ADRAC ← M[ADR] (EA = ADR)
IndirectLD @ADRAC ← M[M[ADR]] (EA = M[ADR])
RelativeLD $ADRAC ← M[PC + ADR]
IndexedLD ADR(X)AC ← M[ADR + XR]
RegisterLD R1AC ← R1
Register indirectLD (R1)AC ← M[R1]
AutoincrementLD (R1)+AC ← M[R1]; R1 ← R1 + 1

Example: address field ADR = 500, PC = 200, R1 = 400, XR = 100. Then for direct EA = 500, relative EA = 700, indexed EA = 600, register indirect EA = 400, and immediate loads the number 500 itself.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 2 questions →