Loads a halfword of data from a specified location in memory into a general-purpose register and sets the remaining 16 bits of the general-purpose register to 0.
Bits | Value |
---|---|
0-5 | 31 |
6-10 | RT |
11-15 | RA |
16-20 | RB |
21-30 | 279 |
31 | / |
lhzx | RT, RA, RB |
The lhzx instruction loads a halfword of data from a specified location in memory, addressed by the effective address (EA), into bits 16-31 of the target general-purpose register (GPR) RT and sets bits 0-15 of GPR RT to 0.
If GPR RA is not 0, the EA is the sum of the contents of GPR RA and GPR RB. If GPR RA is 0, then the EA is the contents of GPR RB.
The lhzx instruction has one syntax form and does not affect the Fixed-Point Exception Register or Condition Register Field 0.
The following code loads a halfword of data into bits 16-31 of GPR 6 and sets bits 0-15 of GPR 6 to 0:
.csect data[rw] .short 0xffff .csect text[pr] # Assume GPR 5 contains the address of csect data[rw]. # Assume 0xffff is the halfword located at displacement 0. # Assume GPR 4 contains 0x0000 0000. lhzx 6,5,4 # GPR 6 now contains 0x0000 ffff.
Fixed-Point Load and Store Instructions .