home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ibm370 / ikcmac.asm < prev    next >
Assembly Source File  |  2020-01-01  |  42KB  |  514 lines

  1. *COPY                                                 CTOKN             00800000
  2.          MACRO                                                          00801000
  3. &LABEL   CTOKN &OPT1,&H=,&N=,&OPTS=                                     00802000
  4. .* Pick a token, optionally test for ?, set up for pad/trunc   @SC86224 00803000
  5. .*  &1: 'NOBRK' if not to check for comma break, 'FM' if getting FM,    00803300
  6. .*      'NODOT' if not to convert dots to blanks,                       00803500
  7. .*  &H= handler if '?' (LA), &N= handler if none (LA)                   00804000
  8. .*  &OPTS= handler if options already found (but 0 => don't test)       00804030
  9. .*  don't look for options if omitted                                   00804060
  10.          GBLC  &KVRSN,&KSYS                                    @SC89027 00804100
  11.          AIF   ('&KVRSN' EQ '4.3' OR '&KSYS' EQ '').VOK        @SC90072 00804200
  12.    MNOTE 16,'* * * --> IKCMAC version number should be &KVRSN' @SC89027 00804300
  13. .VOK     ANOP                                                  @SC89027 00804400
  14.          AIF   ('&LABEL' EQ '').NOLAB                          @SC89097 00805000
  15. &LABEL   DS    0H                                              @SC89097 00805100
  16. .NOLAB   AIF   ('&OPT1' EQ 'NOBRK').GETTOK                     @SC89097 00805200
  17.          CLI   BRK,C','      Found end?                        @SC89097 00805300
  18.          BE    &N            Take comma as end                 @SC89097 00805400
  19. .GETTOK  AIF   ('&OPTS' EQ '' OR '&OPTS' EQ '0').GETTK2        @SC89097 00805500
  20.          TM    FL2,FOPTS     Options already found?            @SC89218 00805600
  21.          BO    &OPTS                                           @SC89218 00805700
  22. .GETTK2  BAL   14,WSPTOK                                       @SC89097 00805800
  23.           B    &N                                              @SC86135 00806000
  24.          AIF   ('&H' EQ '').H                                  @SC86224 00808000
  25.          CLI   0(6),C'?'                                                00809000
  26.          BE    &H                                                       00810000
  27. .H       AIF   ('&OPT1' EQ 'FM' OR '&OPT1' EQ 'NODOT').CMST    @SC89097 00811000
  28.          BAL   14,FSPDOTS    Convert fn.ft.fm, if necessary    @SC89097 00811080
  29. .CMST    AIF   ('&OPTS' EQ '').CMSTK                           @SC89218 00811160
  30.          KCALL FOPSTR,(5),E=FSPINV                             @SC89218 00811170
  31. .CMSTK   BAL   14,CMSTOK8                                      @SC89097 00811180
  32.          AIF   ('&OPT1' NE 'FM').ZZ                            @SC89097 00811240
  33.          LA    1,L'FM                                          @SC89097 00811320
  34.          CLM   7,3,*-2       Valid length token?               @SC89097 00811400
  35.          BH    FSPINV        No                                @SC89097 00811480
  36.          BL    *+12          Ok, just disk                     @SC89097 00811560
  37.          CLI   1(6),C'0'     2nd character must be digit       @SC89097 00811640
  38.          BL    FSPINV        Oops                              @SC89097 00811720
  39. .ZZ      MEND                                                  @SC89097 00811800
  40. *COPY                                                 RTEXT             00812000
  41.          MACRO                                                          00813000
  42. &LABEL   RTEXT  &BUF,&PROMPT=,&E=1                                      00814000
  43. .* Read from the terminal, possible prompt.  Get length read in R0.     00815000
  44. .*  &1: read buffer (len=130) (LA), &PROMPT(1)= prompt buf. if any      00816000
  45. .*  (LA/R), &PROMPT(2)= prompt length (LA/R), &E= branch if error       00817000
  46. &LABEL   DS    0H                                              @SC87268 00818000
  47.          AIF   (T'&BUF EQ 'O').ERRB                            @SC87268 00819000
  48.          AIF   ('&BUF'(1,1) NE '(').SETPC                      @SC87268 00820000
  49.          STCM  &BUF(1),7,RT&SYSNDX+1                           @SC87268 00821000
  50. .SETPC   AIF   (T'&PROMPT EQ 'O').EXCT                         @SC87268 00822000
  51.          AIF   (N'&PROMPT NE 2).ERRP                           @SC87268 00823000
  52.          AIF   ('&PROMPT(1)' EQ '' OR '&PROMPT(2)' EQ '').ERRP @SC87268 00824000
  53.          MVI   RT&SYSNDX+5,C'0'  No prompt...                  @SC87268 00825000
  54.          LREG  15,&PROMPT(2)                                   @SC87268 00826000
  55.          ST    15,RT&SYSNDX+12                                 @SC87268 00827000
  56.          LTR   15,15                                           @SC87268 00828000
  57.          BNP   RT&SYSNDX.S                                     @SC87268 00829000
  58.          MVI   RT&SYSNDX+5,C'P'  Prompt...                     @SC87268 00830000
  59.          LREG  15,&PROMPT(1)                                   @SC87268 00831000
  60.          ST    15,RT&SYSNDX+8                                  @SC87268 00832000
  61. .EXCT    CNOP  0,4                                             @SC87268 00833000
  62. RT&SYSNDX.S BAL 1,RT&SYSNDX.X                                  @SC87268 00834000
  63.          DC    CL8'WAITRD'                                     @SC87268 00835000
  64. RT&SYSNDX DC X'01',AL3(&BUF)                                   @SC87268 00836000
  65.          DC    C'T0',AL2(0)                                    @SC87268 00837000
  66.          AIF   (T'&PROMPT EQ 'O').PLZ                          @SC87268 00838000
  67.          DC    AL4(0,0)      Prompt buffer+length              @SC87268 00839000
  68. .PLZ     ANOP                                                  @SC87268 00840000
  69. RT&SYSNDX.X SVC 202                                            @SC87268 00841000
  70.          DC    AL4(&E)                                         @SC87268 00842000
  71.          LH    0,RT&SYSNDX+6                                   @SC87268 00843000
  72.          MEXIT                                                 @SC87268 00844000
  73. .ERRB    MNOTE 2,'BUFFER ADDRESS OMITTED'                      @SC87268 00845000
  74.          MEXIT                                                 @SC87268 00846000
  75. .ERRP    MNOTE 2,'INVALID PROMPT PARAMETER'                    @SC87268 00847000
  76.          MEND                                                           00848000
  77. *COPY                                                 WRITF             00849000
  78.          MACRO                                                          00850000
  79. &LABEL   WRITF &TICK,&BUFFER=,&BSIZE=,&E=                      @VB89014 00851000
  80. .* Write to a disk file (ticket ptr in R1)                              00852000
  81. .*  &1: adr of file access ticket returned by OPENF (A),                00853000
  82. .*  &BUFFER= data ptr (LA/R), &BSIZE= data length (LA/R) - if either is 00854000
  83. .*  given, it replaces FDB value (see OPENF), &E= branch on error       00855000
  84. &LABEL   L     1,&TICK                                         @SC87034 00856000
  85.          AIF   ('&E' EQ '').EL                                 @VB89014 00856500
  86.        FSWRITE FSCB=(1),BUFFER=&BUFFER,BSIZE=&BSIZE,ERROR=&E   @SC87034 00857000
  87.          MEXIT                                                 @VB89014 00857300
  88. .EL    FSWRITE FSCB=(1),BUFFER=&BUFFER,BSIZE=&BSIZE            @VB89014 00857600
  89.          MEND                                                           00858000
  90. *COPY                                                 READF             00859000
  91.          MACRO                                                          00860000
  92. &LABEL   READF &TICK,&NONUM,&BUFFER=,&BSIZE=,&E=1                       00861000
  93. .* Read from disk file (or write) (see WRITF, but also...)              00861500
  94. .*  &2: NONUM means chop off numbers                                    00862000
  95. &LABEL   L     1,&TICK                                         @SC87034 00863000
  96.         FSREAD FSCB=(1),BUFFER=&BUFFER,BSIZE=&BSIZE,ERROR=&E   @SC87034 00864000
  97.          AIF   (T'&NONUM EQ 'O').RDC                           @SC88101 00864100
  98.          AIF   ('&NONUM' NE 'NONUM').ER1                       @SC88101 00864200
  99.          SR    0,0           Code 0 for chopping off numbers   @SC88101 00864300
  100.          KCALL DISKIO                                          @SC88101 00864400
  101. .RDC     MEXIT                                                          00864500
  102. .ER1     MNOTE 2,'INVALID PARAMETER ''&NONUM'''                @SC88101 00864600
  103.          MEND                                                           00865000
  104. *COPY                                                 SAVEF             00865100
  105.          MACRO                                                          00865200
  106. &LABEL   SAVEF &TICK,&E=                                       @VB89014 00865300
  107. .* Update disk directory for given file (ticket ptr in R1)              00865400
  108. .*  &1: adr of file access ticket (A), &E= branch on error              00865500
  109. &LABEL   L     1,&TICK                                         @SC88168 00865600
  110.          AIF   ('&E' EQ '').EL                                 @VB89014 00865650
  111.          FSCLOSE FSCB=(1),ERROR=&E                             @SC88168 00865700
  112.          MEXIT                                                 @VB89014 00865730
  113. .EL      FSCLOSE FSCB=(1)                                      @VB89014 00865760
  114.          MEND                                                  @SC88168 00865800
  115. *COPY                                                 CPCMD             00866000
  116.          MACRO                                                          00867000
  117. &LABEL   CPCMD &AREG,&LREG,&CMD,&RESP=NO                                00868000
  118. .* Issue a CP command, optionally return result into a buffer.          00869000
  119. .*  &1: reg->command text, &2: reg=length, &3: 'text' of command (opt)  00870000
  120. .*  &RESP= YES/NO if response to be intercepted at (&1+1) length (&2+1) 00871000
  121.          LCLA  &AREG2,&LREG2                                            00872000
  122.          AIF   ('&LABEL' EQ '').NOLAB                                   00873000
  123. &LABEL   DS    0H                                                       00874000
  124. .NOLAB   AIF   ('&CMD' EQ '').CMD                                       00875000
  125.          PTEXT &CMD,AREG=&AREG,LREG=&LREG                               00876000
  126. .CMD     AIF   ('&RESP' NE 'YES').DIAG                                  00877000
  127.          ICM   &LREG,B'1000',BLANK                                      00878000
  128. &AREG2   SETA  &AREG+1                                                  00879000
  129. &LREG2   SETA  &LREG+1                                                  00880000
  130.          L     &AREG2,CBUF                                              00881000
  131.          LA    &LREG2,512                                      @SC89235 00882000
  132. .DIAG    ANOP                                                           00883000
  133.          DIAG  &AREG,&LREG,X'0008'                                      00884000
  134.          AIF   ('&RESP' NE 'YES').EXIT                                  00885000
  135.          BZ    *+8                                                      00886000
  136.          LA    &LREG2,512                                      @SC89235 00887000
  137. .EXIT    MEND                                                           00888000
  138. *COPY                                                 KSETKW            00889000
  139.          MACRO                                                          00890000
  140.          KSETKW ,                                              @SC87166 00891000
  141. .* Define system-specific SET/SHOW parameters (keywords)                00892000
  142.          GBLC  &DESTINA,&SEARCHA                               @SC92300 00892500
  143.          KW    '&DESTINA',SHODST,MIN=4                         @SC92300 00893000
  144.          KW    '&SEARCHA',SHOSRCH,MIN=3                        @SC92300 00894000
  145.          MEND                                                           00895000
  146. *COPY                                                 KSETPRC           00896000
  147.          MACRO                                                          00897000
  148.          KSETPRC                                                        00898000
  149. .* System-specific SET handlers (in any order).  No operands.           00899000
  150.          PUSH  PRINT                                           @SC86355 00900000
  151.          PRINT GEN                                             @SC86355 00901000
  152. SETDST   KCALL CWDSET                                          @SC86164 00902000
  153.          B     RTRN          Preserve return code              @SC86295 00903000
  154.          POP   PRINT                                           @SC86355 00904000
  155.          MEND                                                           00905000
  156. *COPY                                                 KSHOPRC           00906000
  157.          MACRO                                                          00907000
  158.          KSHOPRC                                                        00908000
  159. .* System-specific SHOW handlers (in same order as KW).  No operands.   00909000
  160.          PUSH  PRINT                                           @SC86355 00910000
  161.          PRINT GEN                                             @SC86355 00911000
  162. SHODST   LA    8,DEST                                          @SC86316 00912000
  163.          BAL   14,SHOCHR                                       @SC86295 00913000
  164.           B    SETDST                                          @SC87166 00914000
  165. SHOSRCH  BAL   14,SHOOO      On or off                         @SC86209 00915000
  166.           OI   FL5,SALL                                        @SC87166 00916000
  167.          POP   PRINT                                           @SC86355 00917000
  168.          MEND                                                           00918000
  169. *COPY                                                 KFILKW            00919000
  170.          MACRO                                                          00920000
  171.          KFILKW ,                                              @SC87166 00921000
  172. .* Define system-specific file attribute parameters (keywords)          00922000
  173.          GBLC  &AARECFM                                        @SC92300 00923000
  174.          KW    '&AARECFM',SHORFM                               @SC87166 00923500
  175.          MEND                                                           00924000
  176. *COPY                                                 KFILSET           00925000
  177.          MACRO                                                          00926000
  178.          KFILSET                                                        00927000
  179. .* Specific SET FILE handlers (any order).  No operands.                00928000
  180.          GBLC  &FIXED,&VARIABL                                 @SC92300 00928500
  181.          PUSH  PRINT                                           @SC87012 00929000
  182.          PRINT GEN                                             @SC87012 00930000
  183. SETCMDS  CSECT                                                 @SC92300 00931000
  184. SETRFMKW KW    '&FIXED',SETT,F                                 @SC92300 00932000
  185.          KW    '&VARIABL',SETT,V                               @SC92300 00933000
  186.          KW    ,                                               @SC87012 00937000
  187. .* add any others here                                         @SC87012 00938000
  188. SET      CSECT                                                 @SC92300 00938500
  189.          POP   PRINT                                           @SC87012 00939000
  190.          MEND                                                           00940000
  191. *COPY                                                 KFILSHO           00941000
  192.          MACRO                                                          00942000
  193.          KFILSHO                                                        00943000
  194. .* Specific SHOW FILE handlers (same order as KW).  No operands.        00944000
  195.          PUSH  PRINT                                           @SC87012 00945000
  196.          PRINT GEN                                             @SC87012 00946000
  197. SHORFM   LA    4,SETRFMKW                                      @SC92300 00947000
  198.          LA    6,FILRCF                                        @SC92300 00947600
  199.          BAL   14,SHOBRV                                       @SC92300 00948200
  200.           NOP  0                                               @SC92300 00948800
  201. .* add any others here                                         @SC87012 00950000
  202.          POP   PRINT                                           @SC87012 00951000
  203.          MEND                                                           00952000
  204. *COPY                                                 WTEXT             00953000
  205.          MACRO                                                          00954000
  206. &LABEL   WTEXT &ARG,&LEN                                                00955000
  207. .* Display some text, e.g., WTEXT 'Hi there' or WTEXT (3),(4)           00956000
  208. .* Preserves R2-R14                                                     00957000
  209. .*  &1: 'text' (where text has no doubled ' or & characters)  OR        00958000
  210. .*  &1: adr of text (LA/R), &2: length of text (LA/R)                   00959000
  211. &LABEL   PTEXT &ARG,&LEN,AREG=1,LREG=0                         @SC86295 00960000
  212.          SVC   93            'TPUT'                            @SC86295 00961000
  213.          MEND                                                           00962000
  214. *COPY                                                 FDBD              00963000
  215.          MACRO                                                          00964000
  216.          FDBD                                                           00965000
  217. .* Map of File Descriptor Block + File Access Block                     00966000
  218. .* Required items below: FABCOMM, FDBD-FDBLRC, FDBSIZE, FDBDATE,        00966200
  219. .*     FDBDLRTR, FDBCOP, FDBINFO.  See also FDBPAT.                     00966400
  220. FABD     DSECT ,                                               @SC86295 00967000
  221. FABCOMM  DS    CL8           FAB maps FSCB                     @SC87007 00968000
  222. FABFN    DS    CL8                                             @SC86295 00969000
  223. FABFT    DS    CL8                                             @SC86295 00970000
  224. FABFM    DS    CL2                                             @SC87320 00971000
  225. FABITNO  DS    H             Unextended item number            @SC88120 00972000
  226. FDBD     DS    0F            Beginning of short descriptor     @SC86295 00973000
  227. FDBBUFF  DS    A             Buffer ptr                        @SC86295 00974000
  228. FDBBSIZ  DS    F             Max record length                 @SC86295 00975000
  229. FDBRCF   DS    C             Record format                     @SC86295 00976000
  230. FDBFLGS  DS    X             Flags                             @SC86295 00977000
  231. FDBACTV  EQU   X'80'         File is already open              @SC86295 00978000
  232. * SVATT  EQU   X'40'         Preserve attributes               @SC90033 00979000
  233. FDBEPL   EQU   X'20'         Extended form                     @SC86295 00980000
  234. * APPN   EQU   X'10'         DISP=MOD                          @SC86295 00981000
  235. FDBLRCTT DS    H             File record length (temp)         @SC92076 00985000
  236. FDBSIZE  DS    0F            File size in Kbytes               @SC86295 00987000
  237. FABNORD  DS    F             Bytes read                        @SC86295 00988000
  238. FDBCOP   EQU   *-FDBD        Length to copy for OPEN           @SC90037 00988500
  239. FABAITN  DS    F             Item number                       @SC86295 00989000
  240. FABANIT  DS    F             Number of items                   @SC86295 00990000
  241. FDBDATE  DS    0XL7          Time stamp: packed yyyymmddhhmmss @SC88235 00991000
  242. FABWPTR  DS    F             Write pointer                     @SC86295 00992000
  243. FABRPTR  DS    F             Read pointer                      @SC86295 00994000
  244. FDBNREC  DS    F             Length of file in records         @SC89218 00994070
  245. FDBSREC  DS    F             Length of send request            @SC89218 00994140
  246. FDBLRC   DS    H             File record length                @SC92076 00994170
  247. FDBINFO  EQU   *-FDBD        Length of info returned           @SC88235 00994200
  248. FABLRTR  DS    F             Record length for truncation      @SC88120 00994500
  249. FABDWDS  EQU   (*-FABD+7)/8                                    @SC86295 00995000
  250.          MEND                                                           00996000
  251. *COPY                                                 FDBPAT            00997000
  252.          MACRO                                                          00998000
  253.          FDBPAT &N,&RFM,&SIZ                                   @SC88120 00999000
  254. .* Define system-dependent part of output FDB patterns                  01000000
  255. .*  &1: variable-name prefix (or null if defining init. values)         01001000
  256. .*  &2: RECFM (1-char), &3: LRECL (skip rest of FDB if omitted)@SC88120 01001300
  257.          LCLC  &R,&F,&L,&S                                     @SC90037 01001600
  258.          AIF   ('&N' EQ '').ALC                                @SC86316 01002000
  259. &R       SETC  'RCF'                                           @SC88120 01002200
  260. &F       SETC  'FLGS'                                          @SC88120 01002400
  261. &L       SETC  'LRC'                                           @SC88120 01002600
  262. &S       SETC  'FSIZ'                                          @SC90037 01002800
  263. .ALC     ANOP                                                  @SC86316 01003000
  264. &N&R     DC    C'&RFM'       RECFM                             @SC88120 01003100
  265. &N&F     DC    X'00'         Flags                             @SC88120 01003200
  266.          AIF   ('&SIZ' EQ '').DONE                             @SC88120 01003300
  267. &N&L     DC    Y(&SIZ)       LRECL                             @SC88120 01003400
  268. &N&S     DC    F'0'          File size in Kbytes               @SC90037 01003450
  269. .DONE    ANOP                                                  @SC88120 01003500
  270.          MEND                                                           01004000
  271. *COPY                                                 KSYSVAR           01005000
  272.          MACRO                                                          01006000
  273.          KSYSVAR                                                        01007000
  274. .* Define system-dependent globally-known variables                     01008000
  275. ASTMUSET DS    A             Ptr to user CP settings           @SC87117 01009000
  276. STMUITB  DS    A             Ptr to user translate table       @SC87201 01010000
  277. STMUOTB  DS    A             Ptr to user translate table       @SC87201 01011000
  278. KRMNAM   DS    CL8           Saved Kermit name invoked         @SC88049 01011500
  279. *          Extra FDB for file manipulations                             01012000
  280. DSKSTT   DC    0F'0',CL8'ESTATE'                               @SC86295 01013000
  281. DSKSTNM  DS    CL18          File name                         @SC86295 01014000
  282.          ORG   DSKSTT+FDBD-FABD                                @SC86295 01015000
  283.          DS    XL(FDBINFO)   Room for FDB                      @SC86295 01016000
  284. FLGXA    DS    X             Flags for XA vs. 370              @SC89235 01016100
  285. XACP     EQU   X'02'         Running under VM/XA               @SC89235 01016200
  286. XACMS    EQU   X'01'         Running under XA CMS              @SC89235 01016300
  287. *          Variables for file directory search                          01017000
  288. NXFSTR   DS    D             Move FN or FT here from FST       @SC87201 01018000
  289. NXFHYPE  DS    A             Address of current hyperblk                01019000
  290. NXFHEND  DS    A             End of current hyperblk                    01020000
  291. NXFN     DS    CL8           Pattern filespec                  @SC86295 01021000
  292. NXFT     DS    CL8                                             @SC86295 01022000
  293. NXFM     DS    CL2                                             @SC86295 01023000
  294. *                                                                       01023100
  295. DSKFL    DS    X             Flags for directory scanning      @SC90033 01023200
  296. CWDF     EQU   X'80'         Looking only for disk             @SC86295 01023300
  297. WARB     EQU   X'40'         Wild char seen                    @SC86295 01023400
  298. WFM      EQU   X'08'         Filemode contains wild chars               01023500
  299. WFT      EQU   X'04'         Filetype contains wild chars               01023600
  300. WFN      EQU   X'02'         Filename contains wild chars               01023700
  301. *                                                                       01024000
  302. FST      DS    A             Last FST ptr                      @SC86295 01025000
  303. NXFFNL   DS    F             Pattern length for FN             @SC86295 01026000
  304. ADT      DS    A             Saved ADT ptr                     @SC86295 01027000
  305. NXFFTL   DS    F             Pattern length (must be NXFFNL+8) @SC86295 01028000
  306. * HNDINT Plist for Series/1 interrupt handling                 @SC88326 01028080
  307. HNDINTPL DS    CL8'HNDINT'   HNDINT plist                      @SC88326 01028160
  308. HNDFNC   DS    CL4'SET'      Set function                      @SC88326 01028240
  309. HNDDV    DS    CL4'CONK'     Symbolic device (or CON1)         @SC88326 01028320
  310.          DS    AL4(0)        S1 Interrupt handler              @SC88326 01028400
  311. CONSADDR DS    AL2(9)        Console address (fill in)         @SC88326 01028480
  312.          DS    CL2'WC'                                         @SC88326 01028560
  313.          DS    4X'FF'                                          @SC88326 01028640
  314. HNDWAIT  DS    CL8'WAIT'     WAITD macro plist                 @SC88326 01028720
  315. WAITDV   DS    CL4'CONK'                                       @SC88326 01028800
  316.          DS    2F'0'                                           @SC88326 01028880
  317.          MEND                                                           01029000
  318. *COPY                                                 KSYSTF            01030000
  319.          MACRO                                                          01031000
  320.          KSYSTF                                                         01032000
  321. .* Define system-dependent globally-known constants and init. variables 01033000
  322. .*  symb .DS + label &P.DEFS mark start of variables/init. values       01034000
  323.          GBLC  &STORDS                                         @SC89268 01034500
  324.          LCLC  &P                                                       01035000
  325.          PUSH  PRINT                                                    01036000
  326.          PRINT GEN                                                      01037000
  327.          AIF   ('&SYSECT' EQ '&STORDS').DS                     @SC89268 01038000
  328. &P       SETC  'I'           For initial values                         01039000
  329. KSYSATOE DC    A(0)          Normal TTY E/A translation        @SC88302 01039300
  330. KSYSETOA DC    A(0)                                            @SC88302 01039600
  331. SYSATR   DC    AL1(ADOT,ABL+2,AI,A1)  ."I1  System type=CMS    @SC88273 01040000
  332. LSYSATR  EQU   *-SYSATR      Length of stuff for A-packet      @SC88273 01040500
  333. LOGNAM   DC    C'KER LOG A'                                    @SC86295 01041000
  334. REPNAM   DC    C'KER REPLY A'                                  @SC86295 01042000
  335. SYSTAKE  DC    C'SYSTEM KERMINI' File type                              01043000
  336. LSYST    EQU   *-SYSTAKE                                       @SC86295 01044000
  337. KMAIL1   DC    C'EXEC KERMAIL ' System cmd for invoking mail   @SC90037 01044100
  338. KMAIL2   DC    C' ('                                           @SC90037 01044200
  339. KMAIL3   DC    C' '                                            @SC90037 01044300
  340. KPRNT1   DC    C'EXEC KERMPRT ' System cmd for printing        @SC90037 01044400
  341. KPRNT2   DC    C' ('                                           @SC90037 01044500
  342. KPRNT3   DC    C' '                                            @SC90037 01044600
  343. KSUBM1   DC    C'EXEC KERMSUB ' System cmd for submitting job  @SC90037 01044700
  344. KSUBM2   DC    C' ('                                           @SC90037 01044800
  345. KSUBM3   DC    C' '                                            @SC90037 01044900
  346. ASTER    DC    CL8'*'                                          @SC86295 01045000
  347. KSYSNIT  CSECT                                                 @SC89215 01045500
  348. .DS      ANOP                                                           01046000
  349. &P.DEFS  DS    0D                                                       01047000
  350. &P.QDISK DC    CL8'Q',CL8'DISK',CL8' ',8X'FF'                  @SC87201 01048000
  351. &P.USRTAKE DS  CL8           User for init file                         01049000
  352.          DC    C' KERMINI'   File type expected                         01050000
  353. &P.LUSRT EQU   *-&P.USRTAKE                                    @SC86295 01051000
  354. &P.DEST  DC    C'A '         Default filemode                  @SC86158 01052000
  355. &P.UFM   DC    C'A1'         Filemode user wants                        01053000
  356. &P.KPRPL DC    AL1(L'KPRPT+1)                                  @SC89334 01054000
  357. &P.KPRPT DC    C'Kermit-CMS>'                                  @SC87268 01055000
  358.          DC    AL1(XON)                                        @SC89334 01056000
  359.          ORG   &P.KPRPT+21                                     @SC89334 01056500
  360.          POP   PRINT                                                    01057000
  361.          MEND                                                           01058000
  362. *COPY                                                 KSYSBUF           01059000
  363.          MACRO                                                          01060000
  364.          KSYSBUF                                                        01061000
  365. .* Store buffer ptrs from R1 and increment R1 for specific buffers      01062000
  366.          ST    1,ASTMUSET    User CP settings                  @SC87117 01063000
  367.          LA    1,STMUL+STMLL(1)  Length of user CP settings    @SC87117 01064000
  368.          MEND                                                           01065000
  369. *COPY                                                 HOST              01066000
  370.          MACRO                                                          01067000
  371. &LABEL   HOST  &PLIST,&E=1,&EPL=NO                             @SC89264 01068000
  372. .* Issue system cmd - if no PLIST, assume prepped command at (R1)       01069000
  373. .*  &1: text of cmd (LA), &E= error branch (A)                          01070000
  374. .*  &EPL= YES if extended PLIST may be used                    @SC89264 01070500
  375. &LABEL   LA    1,&PLIST                                                 01071000
  376.          AIF   ('&EPL' NE 'YES').SVC                           @SC89264 01071100
  377.          TM    FL4,UCMD                                        @SC89264 01071200
  378.          BZ    *+12          Not from user -- don't bother     @SC89264 01071300
  379.           ICM  1,8,=X'0B'    Indicate Extended PLIST used      @SC91170 01071400
  380.           LA   0,NUCPLIST    and assume we called SCANN        @SC89264 01071500
  381. .SVC     SVC   202                                                      01072000
  382.          DC    AL4(&E)                                                  01073000
  383.          MEND                                                           01074000
  384. *COPY                                                 SSYMS             01075000
  385.          MACRO                                                          01076000
  386.          SSYMS                                                          01077000
  387. .* Set global symbols for conditional assembly                          01078000
  388.          GBLC  &KVRSN,&KSYS,&KDATE,&RTN,&TYPCMD,&S1CMD,&KCONT  @SC88309 01079000
  389.          GBLC  &KEDIT,&STORDS,&KTAG,&AEACMD,&CONOPTS,&S1CMD1   @SC91311 01079500
  390.          GBLC  &CMSSFS                                         @SC92076 01079700
  391.          GBLA  &MAXLR,&MAXBS                                   @SC86268 01080000
  392.          GBLC  &CPCMND,&CWDERRM,&DESTINA                       @SC92300 01080100
  393.          GBLC  &FILCLSN,&FMTFSPC,&NONXAMS,&SEARCHA             @SC92300 01080200
  394. &KSYS    SETC  'CMS'         System name                       @SC86268 01081000
  395.   MNOTE '*** Kermit-&KSYS release &KVRSN..&KEDIT &KTAG (&KDATE) ***'    01082000
  396. ** BEGIN LANGUAGE-SPECIFIC DATA **   ** CMS-specific **        @SC92300 01082050
  397. &CPCMND  SETC 'Specify a CP command to issue'                  @SC92300 01082100
  398. &CWDERRM SETC 'Must be valid CMS mode letter'                  @SC86295 01082150
  399. &FILCLSN SETC 'File name collision'                            @SC88049 01082200
  400. &FMTFSPC SETC 'Filespec has format: fn ft [fm]'                @SC92300 01082250
  401. &NONXAMS SETC 'This is a non-XA Kermit: SET MACHINE 370'       @SC89235 01082300
  402. * Subcommand keywords                                          @SC92300 01082350
  403. &DESTINA SETC 'DESTINATION'     kwd->AAAASET, m=4              @SC92300 01082400
  404. &SEARCHA SETC 'SEARCH-ALL'      kwd->AAAASET, m=3              @SC92300 01082450
  405. ** END LANGUAGE-SPECIFIC DATA **                               @SC92300 01082500
  406. &MAXLR   SETA  65535         Max lrecl                         @SC86268 01083000
  407. &MAXBS   SETA  65535         Max blksize                       @SC86268 01084000
  408. &AEACMD  SETC  '0X''0'''     AEA command prefix (X'F3'=WSF)    @SC90173 01084500
  409. &S1CMD   SETC  'X''C2'''     S/1 command prefix                @SC90264 01085000
  410. &S1CMD1  SETC  'X''C1'''     S/1 command prefix for Status Req @SC91311 01085100
  411. &CONOPTS SETC  'STCQNS1'     SETCON options                    @SC91311 01085200
  412. &KCONT   SETC  'T'           Default controller type (TTY)     @SC88309 01085500
  413. &CMSSFS  SETC  'NO'          CMS does not have SFS             @SC92076 01085700
  414.          PUSH  PRINT                                                    01086000
  415.          PRINT GEN                                                      01087000
  416. MAXWT    EQU   1760          Max WRTERM buffer                 @SC86268 01088000
  417. MAXRT    EQU   2030          Max RDTERM buffer                 @SC86268 01089000
  418. MAXWS    EQU   1920          Max fullscreen output buffer      @SC90277 01089100
  419. MAXRS    EQU   1920          Max fullscreen input buffer       @SC90277 01089200
  420. FSRDOF   EQU   0             No offset for full-screen read    @SC92030 01089250
  421. MAXDOF   EQU   0             Offset of disk out buffer         @SC90264 01089300
  422. STMGT    EQU   0             Overhead for storage mngmnt       @SC90264 01089600
  423. LFID     EQU   18            Max length of filespec            @SC86268 01090000
  424. &TYPCMD  SETC  'TYPE'        Host command for TYPE             @SC86268 01091000
  425. TYPMIN   EQU   2             Min abbrv of system TYPE cmd or 2 @SC86268 01092000
  426. FBRK1    EQU   C'<'          Starting character for options    @SC89218 01092300
  427. FBRK2    EQU   C'>'          Ending character for options      @SC89218 01092600
  428. KMAXE    EQU   2030          < 9025  Kermit extended max pkt   @SC90277 01093000
  429. STKDWDS  EQU   511           Size of save-area stack           @SC87012 01094000
  430. &STORDS  SETC  'KSTORG'      Storage DSECT for Kermit globals  @SC89268 01094200
  431. KWRKBASE EQU   11            Base register for work area       @SC89268 01094400
  432. KSUBBASE EQU   12            Base register for CSECT           @SC89268 01094600
  433.          POP   PRINT                                                    01095000
  434.          MEND                                                  @SC86268 01096000
  435. *COPY                                                 SYSMACS           01097000
  436.          MACRO                                                          01098000
  437.          SYSMACS                                                        01099000
  438. .* Include system control block definition macros and list all macros   01100000
  439.          GBLC  &KTAG                                           @SC90067 01100500
  440.  MNOTE '---MACLIBs needed: DMSSP, CMSLIB, TSOMAC, OSMACRO'              01101000
  441.  MNOTE '---MACROs: ADT, DCH, DIAG, DMSEXS, DMSFREE, DMSFRET, DMSKEY,'   01102000
  442.  MNOTE '---        DEVSECT,'                                            01102500
  443.  MNOTE '---        FSCB, FSCLOSE, FSPOINT, FSREAD, FSSTATE,'   @SC92076 01103000
  444.  MNOTE '---        FSTB, FSWRITE, FVS, GETFST, HNDINT,'                 01103500
  445.  MNOTE '---        LINEDIT, NUCON, RDTERM, SAVE, STAX, WAITD, WAITT'    01104000
  446.  MNOTE '--- (for XA): ENABLE, GETSID, SVCSECT'                 @SC90067 01104500
  447.          USING NUCON,0                                                  01105000
  448.          NUCON ,             CMS Nucleus                                01106000
  449.          FSTB  ,             File Status Table                          01107000
  450.          DCH   ,             Data Control Hyperblock                    01108000
  451.          ADT   ,             Active Disk Table                          01109000
  452.          FVS   ,             File system storage               @SC86268 01110000
  453.          DEVSECT ,           Device table entry                @SC88326 01110500
  454.          AIF   ('&KTAG' NE 'XA').CMSXA0                        @SC90067 01110600
  455.          SVCSECT ,           SVC table                         @XS89235 01110700
  456. .CMSXA0  ANOP                                                  @SC90067 01110800
  457.          MEND                                                  @SC86268 01111000
  458. *COPY                                                 STRTMSGS          01112000
  459.          MACRO                                                          01113000
  460. &LABEL   STRTMSGS                                                       01114000
  461. .* Print system-dependent start-up messages                             01115000
  462.          GBLC  &HANDXON                                        @SC92300 01115500
  463. &LABEL   CLI   S1HND,XON                                       @SC87338 01116000
  464.          BNE   STRT1Z                                          @SC87338 01117000
  465.          WTEXT '&HANDXON'                                      @SC87338 01118000
  466. STRT1Z   DS    0H                                              @SC87338 01119000
  467.          MEND                                                  @SC87338 01120000
  468. *COPY                                                 KMAIN             01121000
  469.          MACRO                                                          01122000
  470. &LABEL   KMAIN &TYPE                                                    01123000
  471. .* Linkage conventions with system.                                     01124000
  472. .*  &1: ENTER if entering, RETURN if returning                          01125000
  473.          AIF   ('&TYPE' NE 'RETURN').ENT                       @SC89268 01126000
  474. &LABEL   L     13,4(13)      Unlink                            @SC86295 01127000
  475.          ST    15,16(13)     Save return code                  @SC86295 01128000
  476.          LA    0,STODWDS+STKDWDS                               @SC87012 01129000
  477.          LR    1,KWRKBASE                                      @SC89268 01130000
  478.          DMSFRET DWORDS=(0),LOC=(1)                            @SC86295 01131000
  479.          LM    14,12,12(13)  Restore registers                 @SC86295 01132000
  480.          BR    14                                              @SC86295 01133000
  481.          MEXIT ,                                               @SC89268 01134000
  482. .ENT     AIF   ('&TYPE' NE 'ENTER').OTH                        @SC89268 01135000
  483.          SAVE  (14,12),,&LABEL                                 @SC90264 01135500
  484.          LR    KSUBBASE,15                                     @SC89268 01136000
  485.          L     10,=A(COMMON) Common code addressibility        @SC86316 01137000
  486.          LA    0,STODWDS+STKDWDS                               @SC87012 01138000
  487.          DMSFREE DWORDS=(0)  Get storage for vars + stack      @SC86295 01139000
  488.          LR    KWRKBASE,1    Get addressibility                @SC89268 01140000
  489.          LR    0,1                                             @SC86295 01141000
  490.          LA    1,8*STODWDS   Length of storage                 @SC86295 01142000
  491.          SR    15,15         Zero fill                         @SC86295 01143000
  492.          MVCL  0,14                                            @SC86295 01144000
  493.          LR    15,0          Start of stack                    @SC86295 01145000
  494.          A     0,=A(8*STKDWDS) End of stack                    @SC87012 01146000
  495.          STM   15,0,STKPTR                                     @SC86295 01147000
  496.          ST    15,STKLO                                        @SC89089 01148000
  497.          LM    15,1,16(13)   Restore registers                 @SC86295 01149000
  498.          MEXIT ,                                               @SC89268 01150000
  499. .OTH     MNOTE 12,'Invalid type &TYPE'                         @SC89268 01151000
  500.          MEND                                                  @SC89268 01152000
  501. *COPY                                                 ENABLE            01153000
  502.          MACRO                                                          01154000
  503. &LABEL   ENABLE &INTTYPE=                                      @SC90067 01155000
  504. .* Set system mask in non-XA environments                               01156000
  505. .* &INTTYPE= 'ALL' or 'NONE'                                            01157000
  506.          AIF   ('&INTTYPE' NE 'ALL').TNONE                     @SC90067 01158000
  507. &LABEL   SSM   =X'FF'                                          @SC90067 01159000
  508.          MEXIT                                                 @SC90067 01160000
  509. .TNONE   AIF   ('&INTTYPE' NE 'NONE').ERR                      @SC90067 01161000
  510. &LABEL   SSM   *+1                                             @SC90067 01162000
  511.          MEXIT                                                 @SC90067 01163000
  512. .ERR     MNOTE 8,'INVALID ''INTTYPE'' OPERAND'                 @SC90067 01164000
  513.          MEND                                                  @SC90067 01165000
  514.