Loads consecutive bytes in storage from a specified location in memory into consecutive general-purpose registers.
Bits | Value |
---|---|
0-5 | 31 |
6-10 | RT |
11-15 | RA |
16-20 | NB |
21-30 | 597 |
31 | / |
PowerPC | |
---|---|
lswi | RT, RA, NB |
POWER family | |
---|---|
lsi | RT, RA, NB |
The lswi and lsi instructions load N consecutive bytes in storage addressed by the effective address (EA) into general-purpose register GPR RT, starting with the leftmost byte, through GPR RT+NR-1, and wrapping around back through GPR 0, if required.
If GPR RA is not 0, the EA is the contents of GPR RA. If GPR RA is 0, then the EA is 0.
Consider the following when using the lswi and lsi instructions:
For the PowerPC instruction lswi, if GPR RA is in the range of registers to be loaded or RT = RA = 0, the instruction form is invalid.
Consider the following when using the POWER family instruction lsi:
The lswi and lsi instructions have one syntax form which does not affect the Fixed-Point Exception Register or Condition Register Field 0.
Note: The lswi and lsi instructions can be interrupted by a Data Storage interrupt. When such an interrupt occurs, the instruction is restarted from the beginning.
RT | Specifies starting general-purpose register of stored data. |
RA | Specifies general-purpose register for EA calculation. |
NB | Specifies byte count. |
The following code loads the bytes contained in a location in memory addressed by GPR 7 into GPR 6:
.csect data[rw] .string "Hello, World" # Assume GPR 7 contains the address of csect data[rw]. .csect text[pr] lswi 6,7,0x6 # GPR 6 now contains 0x4865 6c6c.
Fixed-Point String Instructions .