home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / bit / listserv / ibmmain / 2666 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  3.9 KB

  1. Xref: sparky bit.listserv.ibm-main:2666 bit.listserv.asm370:174
  2. Path: sparky!uunet!nevada.edu!news.unomaha.edu!sol.ctr.columbia.edu!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!ah739
  3. From: ah739@cleveland.Freenet.Edu (Leslie J. Somos)
  4. Newsgroups: bit.listserv.ibm-main,bit.listserv.asm370
  5. Subject: Re: Using EXTRACT macro to detect execution under TSO
  6. Date: 18 Nov 1992 16:15:59 GMT
  7. Organization: Case Western Reserve University, Cleveland, OH (USA)
  8. Lines: 104
  9. Message-ID: <1edq7vINNlmg@usenet.INS.CWRU.Edu>
  10. References: <MRL.92Nov5152809@sun4.uai.com>
  11. Reply-To: ah739@cleveland.Freenet.Edu (Leslie J. Somos)
  12. NNTP-Posting-Host: slc10.ins.cwru.edu
  13.  
  14.  
  15. In a previous article, mrl@uai.com (Mark R. Ludwig) says:
  16.  
  17. >Several months ago, I asked how to determine, from Assembler, whether
  18. >the program is executing under TSO.  You collectively pointed me to
  19. >the EXTRACT macro, which I've been using happily for months to do just
  20. >that.  Suddenly, it's not working, and I'm at a loss to explain why.
  21. >I would appreciate any insight into what's wrong with the following
  22. >code.  That is, I want to know why I get a high-order byte of X'00' in
  23. >TSOFLAG from EXTRACT when I execute the program from the terminal!
  24. >
  25. >(On the off chance that a guru's reading and it actually means
  26. >something, the rest of TSOFLAG is X'B0E6B1'.)
  27. >
  28. >                                      O o
  29. >                                       X
  30. >--------------------------------------/-\--------------------------------------
  31. >         SPACE
  32. >R0       EQU   0
  33. >R1       EQU   1
  34. >R2       EQU   2
  35. >R3       EQU   3
  36. >R4       EQU   4
  37. >R5       EQU   5
  38. >R6       EQU   6
  39. >R7       EQU   7
  40. >R8       EQU   8
  41. >R9       EQU   9
  42. >R10      EQU   10
  43. >R11      EQU   11
  44. >R12      EQU   12
  45. >R13      EQU   13
  46. >R14      EQU   14
  47. >R15      EQU   15
  48. >         SPACE
  49. >TESTTERM CSECT
  50. >         SAVE  (14,12),T,*
  51. >*
  52. >         BALR  R12,0
  53. >         USING *,R12
  54. >*
  55. >         OPEN  (SNAPDCB,(OUTPUT))
  56. >         SNAP  DCB=SNAPDCB,ID=0
  57. >*
  58. >         EXTRACT TSOFLAG,'S',FIELDS=(TSO) Get flag indicating TSO
  59. >         TM    TSOFLAG,TSOYES
  60. >         BO    TSO
  61. >*
  62. >         L     R5,TSOFLAG
  63. >         LA    R6,TSOYES
  64. >         SNAP  DCB=SNAPDCB,PDATA=REGS,ID=1
  65. >*
  66. >TSO      DS    0H
  67. >         RETURN (14,12),T
  68. >*
  69. >         DROP
  70. >*
  71. >         LTORG
  72. >*
  73. >TSOFLAG  DC    F'-1'              Flag indicating presence of TSO
  74. >TSOYES   EQU   B'10000000'        Flag value meaning TSO is present
  75. >*
  76. >SNAPDCB  DCB   DSORG=PS,RECFM=VBA,MACRF=(W),BLKSIZE=882,LRECL=125,     +
  77. >               DDNAME=SNAPOUT
  78. >         END
  79. >--------------------------------------\-/--------------------------------------
  80. >                                       X
  81. >                                      O o
  82. >
  83. >On the assumption that I have done something wrong (which has waited
  84. >until this most inopportune time to fail), please reply directly, and
  85. >I'll summarize if there's interest.$$
  86. >-- 
  87. >INET: mrl@uai.com           NIC: ML255           ICBM: USA; Lower Left Coast
  88. >"A computer is one of life's joys; it follows simple rules.  Just like
  89. > children, adults need toys, only we like to call them 'tools.'" -- Dave Ross
  90. >
  91.  
  92. I don't understand how it could ever have worked correctly.
  93. I looked at the manual describing the EXTRACT macro,
  94. it tells me that you get back "the _address_ of a byte in which
  95. a high bit of 1 indicates a TSO address space, and a high byte
  96. of 0 indicates a non-TSO address space".
  97.  
  98. I changed the field name 'TSOFLAG' to 'FLAGADDR', and coded:
  99.  
  100. ...
  101.          EXTRACT FLAGADDR,'S',FIELDS=(TSO)  Get _address_ of flag
  102.          L     R7,FLAGADDR
  103.          TM    0(R7),TSOYES
  104.          BO    TSO
  105. ...
  106. FLAGADDR DC    A(-1)   Pointer to flag indicating presence of TSO
  107. ...
  108.  
  109. With everything else the same as you coded, it works correctly
  110. for me (does the right thing in TSO and non-TSO environments).
  111.  
  112. I don't understand how it could ever have worked correctly
  113. as originally coded.
  114.  
  115. --
  116. Leslie J. Somos    ah739@cleveland.Freenet.edu
  117.  
  118.