Oh, and don't forget

1. IIRC some z/OS services may use (destroy, corrupt, whatever you want to call 
it) those high halves. Not certain of that -- perhaps Peter or someone will 
correct me.

2. OTOH it would be polite of you to save and restore your caller's high halves 
if relevant. IIRC the Assembler Services Guide has save area formats.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Charles Mills
Sent: Saturday, October 28, 2017 10:03 AM
To: [email protected]
Subject: Re: Using the High Halfs of registers

I believe those are all z Architecture instructions and should work on any z 
Architecture machine.

NIHF might be your best bet for clearing the high half of a register: no 
storage access. Requires the extended-immediate facility, available on a z9.

You could avoid the storage references on the AG's if you had a spare register. 
You could LHI R0,1/SLLG R0,R0,32/AGR r,R0 for example.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of retired mainframer
Sent: Saturday, October 28, 2017 1:27 AM
To: [email protected]
Subject: Re: Using the High Halfs of registers

According to the 2004 POO (SA22-7832-03), which I believe predates z9, you can:
     Simulate an LA to clear the high half contents of a register with ICMH 
Rx,15,=XL4(00) or NG Rx,=XL8(FFFFFFFF)
     Simulate an LA to increment the count in the high half with AG 
Rx,=XL8(100000000)
     Simulate a BCTR to decrement the count in the high half with AG 
Rx,=X(FFFFFFFF00000000)

Reply via email to