Unfortunately, a lot of the high half instructions come along (not 
surprisingly) with the "high-word facility" which is z196 and above. I've never 
used it, but Add Immediate High (AIH) looks like what you are looking for -- 
but it's high-word facility.

How about the floating point registers? Could you use one of them to hold your 
depth code?  I don't know the FP instruction set at all. I see a number of 
storage to register adds.

I assume the problem here is that you have no spare 32-bit registers, so the 
otherwise unused high halves appealed?

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Wendell Lovewell
Sent: Friday, October 27, 2017 4:32 PM
To: [email protected]
Subject: Using the High Halfs of registers

Hello,

I've inherited a large (31-bit) application with little documentation and lots 
and lots of BASRs to subprograms.  I can't tell how deep the calls can go, but 
I've seen over 20 levels deep.   I'm looking for a way to keep track of the 
stack level of a routine that doesn't add much code.  There are standard $SAVE 
and $RETN macros I think I can use to keep track of the stack level.  

There are also a large number of $TRACE calls where I've added an IIHF 
statement in the macro to load a global counter (for the number of trace 
statements in that assembly--there are over 4000 of those in some cases).  For 
example,  IIHF R2,&ZTSEQ, where &ZTSEQ is a GLBLA incremented once each time 
the $TRACE macro is encountered.

Sorry for all the background.  What I'm looking for are "high-half" versions of 
 LA and BCTR commands, so that the incrementing and decrementing could be done 
with 2 statements per CSECT--without affecting the low halves of the register.  
For example in 31-bit land if R2 was always available, I could say "LA  
R2,1(R2)" at the start of the modules, and "BCTR R2,0"  at the end.  In this 
case reg 2 would always be the stack level.  

I'd also need to keep the application compatible with z9 (OPCODE(ZS3)) or later 
machines.

Can anyone tell me if such statements exist in OPCODE(ZS3)?  I can't find them 
if they are there.   


TIA,
Wendell Lovewell

Reply via email to