>>  ...then I could use either an alternate entry point **or** a second
DSECT...

So, here is how I documented my use of re-basing.

...snip...
         LA    R1,4(,R1)          INCREMENT TO NEXT PARAMETER
         ST    R1,PARMPTR         SAVE PARAMETER ADDRESSES POINTER
         L     R10,0(,R1)         GET ADDRESS OF THIS PARAMETER
         LA    R10,0(,R10)        CLEAR LAST PARM INDICATOR (IF ANY)
*
         IF    TXTREQU,NE,REQU_SCRIPTED   IF NOT SCRIPTING MODE       <==
header field
          IF   TXTREQU,NE,REQ_RSTP IF NOT RESET POINTER REQUEST       <==
header field
           MVI TXTRETN,REQ_DONE     SET STRING RETURN CODE            <==
header field
          ENDIF                    ENDIF
         ELSE                     ELSE--SCRIPTING MODE
          AHI  R10,2               RE-BASE FOR LEGACY LEN AND VAL
* note that "re-basing" is required because I didn't want to duplicate
*      the legacy functions to work with two different formats for the
*      input string parameter.  With re-basing, the two bytes prior to
*      the legacy input string parm are available in scripting mode by
*      using CLIY or MVIY as they allow a negative displacement. Thus,
*      TXTSTRL and TXTSTRG are the same for both execution modes.
          IF   TXTSREQU,(EQ,CLIY),S_REQ_INHRT   INHERITANCE REQUEST?  <==
input parm field
           IF  STRGADDR,(ON,TF),X'80'   IF FIRST SCRIPTING STRING
            MVIY TXTSRETN,S_INV_INHRT SIGNAL INVALID INHERITANCE      <==
input parm field
            J  SCRIPTXT              TAKE THE SCRIPTING EXIT
           ENDIF                    ENDIF
           CF  STRGADDR,X'80'       OK, FIRST PARM STRING PROCESSED
...snip...
SCRIPTXT EQU   *
         MVI   TXTRETN,SCR_TERM   SIGNAL SCRIPT TERMINATED            <==
header field
         J     RETURN
TXTDONE  EQU   *
         MVI   TXTRETN,REQ_DONE   SIGNAL PROCESSING COMPLETE          <==
header field
RETURN   EQU   *
         TRAILER RC=0             RETURN TO CALLER

Sincerely,
Dave Clark


On Tue, Feb 17, 2026 at 1:56 PM David Clark <[email protected]> wrote:

> Got it.  I knew that USING was for the assembler, only, and that once the
> machine code is generated it is cast in stone--as it were.  So, I really am
> stuck with re-basing because it works as intended.
>
> If I wanted to duplicate all the code, then I could use either an
> alternate entry point and a second DSECT that was only used by the new
> code.  But I don't want two functions for FIND, two functions for DELETE,
> two functions for INSERT, etc.  repeated for 16 functions.
>
> Sincerely,
> Dave Clark
>
>

Reply via email to