Page 3 of 3

Re: How to display the current PSW?

PostPosted: Thu Mar 03, 2011 9:48 am
by belkin99
Do not worry, will be a small possibly pseudo code or the code, but will be based on the demand.
what part of that reply was not clear to you
forget it, I am not going to make it a chat room here which do not serve the topic itself.
The very important point is that I got your message. ;)

Re: How to display the current PSW?

PostPosted: Thu Mar 03, 2011 10:36 am
by steve-myers
belkin99 wrote:TO STEVE-MYERS

YES i DID THAT, and I can send you the code

I looked into it. As long as you can use an EPIE the code should be quite trivial, but as far as I know the only place you can use an EPIE is in an ESPIE exit, and that, sir, is slightly more complicated than the level of expertise you appear to actually have. In 40+ years I don't think I've ever done ESPIE (or SPIE, for that matter) exit code.
  • You have to establish an ESPIE environment
  • You have to actually code an ESPIE exit that
    • Recognizes an event that requires the PSW.
    • Recognizes an event that is a "real" entry to the ESPIE exit and operates as though the ESPIE was not in effect.
I got hung up on the 2nd bullet and lost interest. Of course if that level of recovery is not in your requirement, then it could be done fairly easily.

Re: How to display the current PSW?

PostPosted: Thu Mar 03, 2011 10:55 am
by belkin99
So, it is possible to be done !
Yes, I have not the
level of expertise you appear to actually have
, but I did the ESPIE, and I did exit routine for it.

Final words for me in this, Sir I am not trying to show my musles and I did not say that I am a professinal, I am looking for an input from the people who has the expertise like you, and I put what I learned.
I appreciate if you correct my understanding to topics, and I thank your reply and your time for checking that.

Re: How to display the current PSW?

PostPosted: Thu Mar 03, 2011 12:50 pm
by steve-myers
What follows is proof of concept code. It is not complete.
         MACRO
&NAME    SHOWPSW &MSG
         LCLC  &L,&LX
&L       SETC  'L''MSG&SYSNDX'
&LX      SETC  'MSG&SYSNDX'
&NAME    DC    0H'0',X'00FF'       SPECIFY THE SHOWPSW "OP CODE"
         B     PSW&SYSNDX          BR AROUND THE MSG
         DC    AL1(&L)             DEFINE THE MESSAGE LENGTH
&LX      DC    C&MSG               DEFINE THE MESSAGE
&LX      SETC  'PSW&SYSNDX'
&LX      DC    0H'0'
         MEND
SHOWPSW  CSECT                     DEFINE THE PROGRAM CSECT
         PUSH  PRINT
         PRINT NOGEN
         DCBD  DSORG=QS,DEVD=DA
         POP   PRINT
         IHAEPIE ,
SHOWPSW  CSECT                     RETURN TO THE PROGRAM CSECT
         USING *,12                DEFINE PROGRAM ADDRESSABILITY
         SAVE  (14,12),,SHOWPSW-&SYSDATE-&SYSTIME  SAVE REGISTERS
         LR    12,15               COPY ENTRY POINT ADDRESS TO REG 12
         LA    15,SAVEAREA         LOAD ADDRESS OF THE NEW SAVE AREA
         ST    15,8(,13)           ADD THE NEW SAVE AREA TO THE
         ST    13,4(,15)            SAVE AREA CHAIN
         LR    13,15               ESTABLISH NEW SAVE AREA POINTER
         ESPIE SET,SPIEEXIT,1      ESTABLISH AN ESPIE ENVIRONMENT     ->
                                    FOR AN S0C1 INTERRUPTION
         ST    1,TOKEN             SAVE THE TOKEN FOR SPIE RESET
         OPEN  MF=(E,OPARM)        OPEN THE PRINT DCB
         SHOWPSW 'TEST POINT'      SHOW THE PSW
         CLOSE MF=(E,CPARM)        CLOSETHE PRINT DCB
         L     13,4(,13)           LOAD ADDR OF THE PREVIOUS SAVE AREA
         RETURN (14,12),T,RC=0     RESTORE REGISTERS & RETURN
         DROP  ,                   KILL ADDRESSABILITY
* THE ESPIE EXIT ROUTINE
         DC    0D'0'
SPIEEXIT BALR  12,0                STORE THE CURRENT ADDRESS IN REG 12
         USING *,12                ESTABLISH EXIT ADDRESSABILITY
         USING EPIE,3              ESTABLISH EPIE ADDRESSABILITY
         LR    2,14                COPY THE RETURN ADDRESS TO REG 2
         LR    3,1                 COPY EPIE ADDRESS TO REG 3
         IC    0,EPIEILC1          LOAD THE ILC
         N     0,=A(B'11')         ISOLATE THE ILC ITSELF
         STC   0,XILC              SAVE THE ILC
         C     0,=F'2'             TEST IF ILC 2
         BNE   X0100               BR IF NOT 2
         L     1,EPIENXT1          LOAD THE ADDRESS OF THE NEXT       ->
                                    INSTRUCTION
         CLC   =X'47F0',0(1)       TEST IF IT'S A BC 15
         BNE   X0100               BR IF NOT
         BCTR  1,0                 SUBTRACT 2
         BCTR  1,0                  FROM THE PSW
         CLC   =X'00FF',0(1)       TEST IF THE "INSTRUCTION" IS X'0001'
         BNE   X0100               BR IF NOT
*                          ----+----1--
         MVC   XMSG(12),=C' THE PSW AT '
         LA    1,6(,1)             COMPUTE THE ADDRESS OF THE MSG
         SR    15,15               SET REG 15 = 0
         IC    15,0(,1)            LOAD THE LENGTH
         BCTR  15,0                REDUCE LENGTH BY 1
         EX    15,XMVC             COPY THE MSG TXT
         LA    14,XMSG+13(15)      COMPUTE THE RESUME POINT
         MVC   0(4,14),=C' IS '
         UNPK  4(9,14),EPIEPSW(5)
         TR    4(8,14),HEXTAB
         MVI   12(14),C' '
         UNPK  13(9,14),EPIEPSW+4(5)
         TR    13(8,14),HEXTAB
         LA    13,XSAVE
         PUT   PRINT,XMSG
         BR    2
X0100    DC    H'0'
XMVC     MVC   XMSG+12(*-*),1(1)   **EXECUTE ONLY **
XILC     DC    AL1(0)
XMSG     DC    CL121' ',0D'0'
HEXTAB   EQU   *-C'0'
         DC    C'0123456789ABCDEF'
         PUSH  PRINT
         PRINT NOGEN
PRINT    DCB   DSORG=PS,MACRF=PM,DDNAME=SYSPRINT,RECFM=FBA,LRECL=121
         POP   PRINT
XSAVE    DC    9D'0'
SAVEAREA DC    9D'0'
OPARM    OPEN  (PRINT,OUTPUT),MF=L
CPARM    CLOSE PRINT,MF=L
TOKEN    DC    F'0'
         DC    0D'0'
         LTORG ,
         DC    0D'0'
         END   SHOWPSW

It actually does work as planned!

Re: How to display the current PSW?

PostPosted: Fri Mar 04, 2011 5:30 am
by belkin99
Always you suprise us.
Thanks boss