I might believe MILTEN.
Setting CC is not at all arcane
Z: CLI *,X'95'
H: CLI *,0
L: CLI *,255
O: TM *,1
I thought maybe the 360/67 had IPM for 32-bit mode, but, no, so XA it is.
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Assembler List [[email protected]] on behalf
of Dan Greiner [[email protected]]
Sent: Tuesday, June 2, 2020 5:30 PM
To: [email protected]
Subject: Re: Returning bool and similar values from subroutines (was z/OS
HLASM: EQU for statement labels)
Although Seymour has pointed out the OS/360 convention of placing a return code
in GR15, there are numerous alternative approaches used elsewhere. Your example
of using "historical opcodes" (BAL 14,some_test / BE success) was used
extensively in the National Institute of Health (NIH) version of the Wylbur /
Milton text editing / communications packages of the 1960s. Other operating
systems and languages take different approaches (an early version of Bell Labs
mainframe version of UNIX used R7 for a return code).
Other than the conventional OS-360 approach, I tend to favor the above example
(i.e., having the subroutine set the CC, rather than the indexed-branch
approach). Having the subroutine set the CC provides a means of having (up to)
four possible actions that the calling program can take upon return. You state:
"The problem for me was that you have to jump through some convolutions to set
the condition code." However, you still have to have some determination in the
subroutine that loads a condition code (conventional approach), or selects
which branch to used (index-branch approach).
Using the indexed branch allows for many more possible actions -- not just
binary true/false -- but may necessitate accommodating all possible branch
cases following each return. I also agree that the indexed branch approach may
be more complicated to maintain.
As to how to set [and preserve] the condition code, many experienced assembler
programmers have yet to discover the "newer" instruction SET PROGRAM MASK (SPM)
[and INSERT PROGRAM MASK (IPM)]. I say "newer" with tongue pressed firmly in
cheek, since these unprivileged instructions have been around since the
introduction of the S/370 (five decades ago).