Hi, question is what you like to achieve.
If you want to have certain variable located in the GPR register, then you can simply register storage class.
Otherwise following code are being used for load of variable to the r31 register (where address points to the variable):
asm (lis r30, (address)@h);
asm (ori r30, r30, (address)@l);
asm (lwz r31, 0x0(r30));
Similar sequence for store operation:
asm (lis r30, (address)@h);
asm (ori r30, r30, (address)@l);
asm (stw r31, 0(r30));