5.1.3 · D1Instruction Set Architecture (ISA)

Foundations — Addressing modes

1,773 words8 min readBack to topic

Before you can read the parent note, you must be able to read its language. This page builds every symbol, box, and word it uses — starting from nothing. Read top to bottom; each idea leans only on the ones above it.


1. A bit, a word, and a number

How many distinct patterns fit in bits? Each bit doubles the count, so bits give patterns.

Figure — Addressing modes

With bits you get patterns; with bits you get — about four billion. That number, , is exactly the count of memory locations the parent note says we might need to point at. See Instruction Format for how a word is chopped into fields.


2. Memory as a row of numbered boxes

Figure — Addressing modes

3. The notation — "contents of box "

The picture: point at box number , open it, read the value.

This inside-out reading is the entire mechanism behind indirect mode later (, and the operand is ).


4. Registers and the notation

Figure — Addressing modes

5. The instruction fields and

Figure — Addressing modes

6. The Program Counter,


7. Putting a "+" between homes: how EA gets built

Now every symbol in a rule like is earned:


8. Counting memory accesses


Prerequisite map

Bit and word

2 to the n patterns

Address space size

Memory box and address

Contents notation M of x

Register

Contents notation R in brackets

Effective Address EA

Instruction fields A and R

Program Counter PC

Addressing modes

Count memory accesses

Everything on this page flows downward into the single node Addressing modes — the parent topic.


Equipment checklist

Cover the right side and test yourself. If any answer is fuzzy, reread that section before opening the parent note.

How many distinct patterns fit in bits, and why?
, because each added bit doubles the number of patterns.
What is the difference between an address and the contents of a box?
The address is which box (its number); the contents are what value is inside it.
Read in plain words.
The value stored in the memory box whose address is .
Evaluate given and .
— work inside-out: inner is , then .
What does mean versus ?
is the value currently held in register ; is just the register's name.
What does tell the CPU to do?
Take the number inside register , use it as an address, and read that memory box.
What are and inside an instruction?
is a number field (an address or a small offset); names a register.
Why can the same bits mean different things?
The mode bits select the recipe, so may act as a full address or just an offset added to a register.
What is the and why does PC-relative mode use it?
The Program Counter holds the current instruction's address; adding to it gives position-independent (relocatable) code.
Compute for , in displacement mode.
.
How do you count memory accesses from an operand expression?
Count the nested wrappers: none = 0 trips, one = 1 trip, two = 2 trips.

Recall Feynman one-liner

Memory is a street of numbered mailboxes. An address is a house number; the contents are the mail inside. Square brackets mean "open that mailbox"; round brackets mean "read the sticky note on the CPU's own desk." Every addressing mode is just a short recipe for deciding which mailbox to open.