All instructions, except branches, generate addresses by incrementing
a program counter. All load and store instructions specify a base register.
The effective address in memory for a data value is calculated relative
to the base register in one of three ways:
- Register + Displacement – The displacement forms of the load and
store instructions calculate an address that is the sum of a displacement
specified by the sign-extended 16-bit immediate field of the instruction plus
the contents of the base register.
- Register + Register – The indexed forms of the load and store instructions
calculate an address that is the sum of the contents of the index register,
which is a GPR, plus the contents of the base register.
- Register – The Load String Immediate and Store String Immediate
instructions use the unmodified contents of the base register to calculate
an address.
Loads and stores can specify an update form that reloads the base register
with the computed address, unless the base register is the target register
of the load.
Branches are the only instructions that explicitly specify the address
of the next instruction. A branch instruction specifies the effective address
of the branch target in one of the following ways:
- Branch Not Taken – The byte address of the next instruction is
the byte address of the current instruction, plus 4.
- Absolute – The word address of the next instruction is given in
an immediate field of the branch instruction.
- Relative – The word address of the next instruction is given by
the sum of the immediate field of the branch instruction and the word address
of the branch instruction itself.
- Link Register or Count Register – The byte address of the next
instruction is the effective byte address of the branch target specified in
the Link Register or Count Register, respectively.