I doubt that a relative branch will help. Register 1 is expected to contain an 
address below the line.

It works in RMODE 31, but only if MF=(E,address) is specified on GTTERM and the 
specified address is below the line. The macro expansion will just point 
register 1 to the specified address, or if the address is (1) leave it 
unchanged.

If register 1 points above the line, as it would with a BAL, SVC 94 gets a 
S0C4, presumably because the above-the-line address in register 1 is not 
expected.

Bill

On Sat, 23 May 2015 09:13:06 -0700, Charles Mills wrote:

>Sorry to belabor this thread but for the sake of future Googlers felt I needed 
>to say that a global IEABRCX DEFINE is probably a necessary part of this 
>solution. GTTERM contains the common BAL 1,*+12 type formulation and that will 
>not work when moved to GETMAIN storage without either converting the BAL to a 
>relative branch (as IEABRCX does) or some cleverness with USING.
>
>Charles
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:[email protected]] On 
>Behalf Of Charles Mills
>Sent: Wednesday, May 20, 2015 5:14 PM
>To: [email protected]
>Subject: Re: Where can a running TSO program get its "terminal name"
>
>Thanks all for your suggestions. In the hope of helping a future Googler, here 
>is "How to Use GTTERM from an AMODE 31 Program." I don't claim this method is 
>novel or optimal, just that it works.
>
>BTW, I am using the GTTERM now primarily for the other information it returns 
>like the IP address. I get the terminal name from ACEETRID.
>
>I built a "model" GTTERM. This is assembled like a constant, not in the line 
>of executable code.
>
>GTTERMmdl EQU   *
>         GTTERM PRMSZE=(R2),       TERMSIZE,   mandatory               +
>               TERMID=(R4)         TERMWORK
>         BSM   0,R11               Return in 31-bit mode
>GTTERMmdl_len EQU *-GTTERMmdl
>
>The module already had a GETMAIN for a save area and other (small) reentrant 
>storage. I changed the GETMAIN to LOC=BELOW and added the following to the 
>reentrant storage:
>
>         DS    0H                  Align
>GTTERMarea DS  XL(GTTERMmdl_len)   GTTERM moved here
>TERMSIZE DS    H                   GTTERM terminal size
>TERMWORK DS    CL39                GTTERM return area
>
>In the executable code, I move the "model" GTTERM into the GETMAIN area and 
>BASSM to it
>
>             MVC   GTTERMarea,GTTERMmdl
>             MVC   TERMWORK(6),=C'CODEPG'
>             LA    R2,TERMSIZE
>             LA    R4,TERMWORK
>             LA    R15,GTTERMarea 
>             BASSM R11,R15
>
>I have not done extensive testing but this does all seem to work.
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to