That's a great point, Tony. I know I've written many things with a LTR/BNP/BCTR 
sequence; this removes one instruction, as well as being less obscure/idiomatic 
for the youngsters!

-----Original Message-----
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> On Behalf 
Of Tony Harminc
Sent: Thursday, July 10, 2025 3:12 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Food for thought.

On Thu, 10 Jul 2025 at 12:39, Mark Hammack < 
00001b4f3fed68ca-dmarc-requ...@listserv.uga.edu> wrote:
[...]

>
> Really, the same question can be asked about:
>
> BCTR Rx,0 vs.
> AHI  Rx,-1


I've been using the AHI for this for many years now because by far the most 
frequent reason I want to subtract 1 from a register is to use it immediately 
in an EX of an MVC or TR or the like. And in this case it's very good to have 
that condition code, because you can with one BM/JM instruction following the 
AHI avoid the case where your MVC or whatever runs with a length of 256 because 
some earlier code didn't anticipate the original content of Rx being 0. This is 
a common cause of overlays, in my experience.

Tony H.

Reply via email to