Assembler Addressing Modes — Quick Reference
Table explains common addressing modes, assembler syntax, effective-address (EA) formula and short usage notes.
| Name | Assembler Syntax | Addressing Function (EA = Effective Address) | Explanation and Use |
|---|---|---|---|
| Index | X(Ri) |
EA = [Ri] + X |
EA is generated by adding a constant offset
X to the contents of the index register Ri. The register contents are not modified.Common when accessing arrays:
Ri holds base address, X selects element/field. (p. 38)
Copied!
Notes:
|
| Base with Index | (Ri, Rj) |
EA = [Ri] + [Rj] |
The effective address is the sum of two registers' contents — often one acts as base, the other as index.
Provides flexibility since both components can change; useful for segmented addressing or multi-level referencing. (p. 39)
Copied!
|
| Base with Index and Offset | X(Ri, Rj) |
EA = [Ri] + [Rj] + X |
EA is sum of two registers plus a constant offset. Can model multi-dimensional addressing (e.g., 3-D arrays) or complex frame offsets. (p. 40)
Copied!
|
| Relative | X(PC) |
EA = [PC] + X |
This variant uses the Program Counter (PC) instead of a general register. It commonly specifies branch/jump targets as an offset from the current PC. (p. 40)
Enables position-independent code and PC-relative addressing for branch targets or data in the same code segment.
Copied!
|
Tip: click Copy Syntax to copy the assembler syntax to clipboard. Use Details to expand extra notes.
No comments:
Post a Comment