lwat
Load Word Atomic
lwat RT,RA,FC
Loads a word from memory atomically.
Details
The lwat instruction loads a word from memory atomically. The effective address (EA) is calculated based on the contents of register RA. If RA is zero, EA is set to zero; otherwise, EA is set to the value in RA. The word at EA is loaded into RT, and the least significant 32 bits of RT are set to zero.
Pseudocode Operation
if RA=0 then
EA ←0
else
EA ←(RA)
(RT32:63,mem(EA,4))←lat(mem(EA-4,12), RT+132:63, RT+232:63, FC)
RT0:31←0
Programming Note
EA must be a multiple of 4, and the portion of mem(EA-4,12) accessed by the instruction must be contained within an aligned 32-byte block of storage. If either of these requirements is not satisfied, the system alignment error handler is invoked.
Example
lwat r3, r4, fc
Encoding
Binary Layout
18
0
LI
6
AA
30
LK
31
Operands
-
RT
Target General Purpose Register -
RA
Source General Purpose Register -
FC
Function Code