IBM SA14-2339-04 Personal Computer User Manual


 
Programming Model 2-7
2.3.2.2 Link Register (LR)
The LR is written from a GPR using mtspr, and by branch instructions that have the LK bit set to 1.
Such branch instructions load the LR with the address of the instruction following the branch
instruction. Thus, the LR contents can be used as the return address for a subroutine that was called
using the branch.
The LR contents can be used as a target address for the bclr instruction. This allows branching to any
address.
When the LR contents represent an instruction address, LR
30:31
are assumed to be 0, because all
instructions must be word-aligned. However, when LR is read using mfspr, all 32 bits are returned as
written.
The LR is in the user programming model.
2.3.2.3 Fixed Point Exception Register (XER)
The XER records overflow and carry conditions generated by integer arithmetic instructions.
The Summary Overflow (SO) field is set to 1 when instructions cause the Overflow (OV) field to be set
to 1. The SO field does not necessarily indicate that an overflow occurred on the most recent
arithmetic operation, but that an overflow occurred since the last clearing of XER[SO]. mtspr(XER)
sets XER[SO, OV] to the value of bit positions 0 and 1 in the source register, respectively.
Figure 2-3. Count Register (CTR)
0:31 Count Used as count for branch conditional with
decrement instructions, or as address for
branch-to-counter instructions.
Figure 2-4. Link Register (LR)
0:31 Link Register contents If (LR) represents an instruction address,
LR
30:31
should be 0.
0 31
0 31