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

  1. *COPY                                                 IK0MAI            01500000
  2.          CHECKVER IK0MAI,4.3                                   @SC90072 01500500
  3.          TITLE 'Kermit-370 main code'                          @SC86268 01501000
  4. KERMIT   ENTER MAIN                                            @SC86295 01502000
  5.          STM   0,1,ORGR0     Save R0,R1                        @SC87253 01503000
  6. * Initialize STORAG section                                             01504000
  7.          LM    0,1,=A(IDEFS,LDEFS)  Init. value array          @SC90080 01506000
  8.          LA    14,DEFS       Storage to initialize             @SC90080 01506200
  9.          LR    15,1                                            @SC90080 01506400
  10.          MVCL  14,0          Set up arrays                     @SC90080 01506600
  11.          MVC   S1EOL(2),IS1EOL  Set up prompt                  @SC90173 01507000
  12.          MVI   TRTBL+C' ',1  Set up blank finder               @SC86295 01510000
  13.          MVI   TRMTP,C'&KCONT' Default controller type (TTY)   @SC88309 01511000
  14.          LA    1,ATOE                                          @SC92352 01511200
  15.          LA    2,ETOA                                          @SC92352 01511400
  16.          STM   1,2,AEPTRS    Initially, use normal tables      @SC92352 01511600
  17.          MVC   ETOA,ETOAD    Init translators                  @SC86295 01512000
  18.          MVC   ATOE,ATOED                                      @SC86295 01513000
  19.          L     1,=A(TRNTBL)  1st entry is A/E                  @SC90040 01513300
  20.          MVC   TRNALF(2*LALF),0(1)                             @SC91325 01513600
  21.          MVC   FILALF2,FILALF                                  @SC91325 01513800
  22.          MVC   TETOA,ETOAD                                     @SC87117 01514000
  23.          MVC   TATOE,ATOED                                     @SC87117 01515000
  24.          LA    1,CMD                                           @SC86295 01524000
  25.          ST    1,TAKBUF                                        @SC86295 01525000
  26.          LA    0,((MAXDOF+7)/8)*8  Allow for offset            @SC90264 01526000
  27.          A     0,F64KP       Length of disk buffers            @SC90264 01526060
  28.          SRA   0,3                                             @SC90264 01526120
  29.          DMSFREE DWORDS=(0),ERR=KRMXITS                        @SC90264 01526180
  30.          ST    1,FREED1      1st disk buffer                   @SC90264 01526240
  31.          LA    1,STMGT+MAXDOF(,1) Skip over mgmt stuff & offset@SC90264 01526300
  32.          ST    1,WBUF        Save ptr to buffer itself         @SC90264 01526360
  33.          L     0,F64KP                                         @SC90264 01526420
  34.          SRA   0,3                                             @SC90264 01526480
  35.          DMSFREE DWORDS=(0),ERR=KRMXITS                        @SC90264 01526540
  36.          ST    1,FREED2      2nd disk buffer                   @SC90264 01526600
  37.          LA    1,STMGT(,1)   Skip over management stuff, if any@SC90264 01526660
  38.          ST    1,RBUF        Save ptr to buffer itself         @SC90264 01526720
  39.          LA    1,STMGT       Allow for management stuff        @SC90264 01526780
  40.          LA    5,4095        For page boundaries...            @SC87281 01527000
  41.          BAL   14,STPTRS     Get length of storage needed      @SC86295 01528000
  42.          LA    0,7(1,5)      Round up                          @SC87281 01529000
  43.          SRA   0,3                                             @SC86295 01530000
  44.          ST    0,FREEDW      Number of dw's to get             @SC86295 01531000
  45.        DMSFREE DWORDS=(0),ERR=KRMXITS                          @SC86295 01532000
  46.          ST    1,FREEPTR     Save start of area                @SC87286 01533000
  47.          LA    1,STMGT(,1)   Skip over management stuff, if any@SC90264 01533500
  48.          BAL   9,KRMPG       Round up to next page             @SC87281 01534000
  49.          BAL   14,STPTRS     Set up ptrs                       @SC86295 01535000
  50.          LH    1,BUFSIZ                                        @SC86295 01536000
  51.          ST    1,RIOPTRS+4   Init read length                  @SC90173 01537000
  52.          L     1,LOGBUF                                        @SC86295 01540000
  53.          MVI   1(1),C':'     Set up prefix                     @SC86190 01541000
  54.          KCALL SETMSG,1,E=KRMXITF Get user's settings                   01542000
  55.          KCALL SPARSET                                         @SC86152 01543000
  56.          MVC   DATL,F0                                         @SC87012 01544000
  57.          KCALL SPAR          Set defaults for other Kermit     @SC87012 01545000
  58.          KCALL USNTRF        Call main loop                    @SC87117 01546000
  59. *                                                                       01547000
  60. KRMXITF  KCALL SETMSG,4      System-dependent clean-up         @SC86316 01548000
  61.          CLOSF SIMPTR        Close                             @SC91312 01548100
  62.          TM    FL1,DEBUG                                       @SC88119 01548200
  63.          BZ    KRMXITG                                         @SC88119 01548400
  64.          CLOSF LOGPTR        Close                             @SC88119 01548600
  65. KRMXITG  DS    0H                                              @SC88119 01548800
  66.          LM    0,1,FREEDW    Number of dw's, ptr to area       @SC87286 01549000
  67.        DMSFRET DWORDS=(0),LOC=(1)                              @SC86295 01550000
  68. KRMXITQQ ICM   1,15,FREED1   Get 1st buffer area               @SC90264 01554000
  69.          BZ    KRMXITD1      Not assigned                      @SC90264 01554060
  70.          LA    0,((MAXDOF+7)/8)*8  Allow for offset            @SC90264 01554120
  71.          A     0,F64KP       Length of disk buffers            @SC90264 01554180
  72.          SRA   0,3                                             @SC90264 01554240
  73.          DMSFRET DWORDS=(0),LOC=(1)                            @SC90264 01554300
  74. KRMXITD1 ICM   1,15,FREED2   Get 2nd buffer area               @SC90264 01554360
  75.          BZ    KRMXITD2      Not assigned                      @SC90264 01554420
  76.          L     0,F64KP       Length of disk buffers            @SC90264 01554480
  77.          SRA   0,3                                             @SC90264 01554540
  78.          DMSFRET DWORDS=(0),LOC=(1)                            @SC90264 01554600
  79. KRMXITD2 DS    0H                                              @SC90264 01554660
  80.          BAL   14,LDERR      Get error code                    @SC90264 01554720
  81.          RET   MAIN                                            @SC86295 01555000
  82. *                                                                       01556000
  83. KRMXITS  WTEXT '&NOBUFFS'                                      @SC92300 01557000
  84.          B     KRMXITQQ                                                 01558000
  85. *                                                                       01559000
  86. STPTRS   DS    0H            Set up buffer pointers            @SC90264 01560000
  87.          ST    1,TSENT               address of sent files              01564000
  88.          A     1,=A(MAXNSENT*ACTLEN) Length of table           @SC91172 01565000
  89.          ST    1,MSNDBUF     Buffer for extra filespecs        @SC88306 01565590
  90.          AH    1,=Y(MSNDMAX*LFSTF)                             @SC89218 01565700
  91.          ST    1,CBUF        Ptr to CP answer buffer           @SC86295 01566000
  92.          LA    1,512(,1)                                   8*N @SC90264 01567000
  93.          KTRACE SETUP   Get internal trace buffer              @LM91008 01567300
  94.          ST    1,EMSGP       Ptr to saved micro error msg      @SC86295 01568000
  95.          LA    1,LEMSG(1)                                      @SC86295 01569000
  96.          LA    1,MAXDOF(,1)  Leave room for offset, if any     @SC90264 01569500
  97.          ST    1,LOGBUF      Ptr to LOG buffer                 @SC86295 01570000
  98.          LA    1,2(,1)       Room for log labels               @SC91191 01571000
  99.          AH    1,BUFSIZ      Room for data buffer              @SC91191 01571500
  100.          LA    2,TRNSPL(1)   Length of transparency starters   @SC90173 01572000
  101.          BAL   9,KRMPGTB     Round up if necessary             @SC87281 01573000
  102.          ST    1,SIOPTRS                                       @SC90173 01574000
  103.          AH    1,BUFSIZ      Ptr to input buffer               @SC86190 01577000
  104.          LA    2,16(,1)      Extra for I/O stuff               @SC90173 01578000
  105.          BAL   9,KRMPGTB     Round up if necessary             @SC87281 01579000
  106.          ST    1,APKT                                          @SC86190 01583000
  107.          ST    1,RIOPTRS                                       @SC90173 01584000
  108.          AH    1,BUFSIZ      Ptr to output holding buffer      @SC86190 01585000
  109.          ST    1,ASPKT                                         @SC86190 01586000
  110.          ST    1,AASPKT                                        @SC86190 01587000
  111.          LA    2,7(1)        Skip over extended header         @SC86190 01588000
  112.          ST    2,ASDATA                                        @SC86190 01589000
  113.          AH    1,BUFSIZ      Ptr to input decoding buffer      @SC86190 01590000
  114.          ST    1,ARPKT                                         @SC86190 01591000
  115.          AH    1,BUFSIZ      Ptr to take table                 @SC86190 01592000
  116.          KSYSBUF ,           Other buffers                     @SC86355 01593000
  117.          BR    14            Return with R1 -> end             @SC86295 01594000
  118. *                                                                       01595000
  119. * Round up R1 to next page if (R1)-(R2) would cross boundary.  @SC87281 01596000
  120. * (R5) = page size - 1 (should be 4095), return to (R9)        @SC87281 01597000
  121. KRMPGTB  AH    2,BUFSIZ      Tentative end of buffer           @SC87281 01598000
  122. KRMPGT   BCTR  2,0           Last byte                         @SC87281 01599000
  123.          XR    2,1           Same page as first?               @SC87281 01600000
  124.          NR    2,5                                             @SC87281 01601000
  125.          BZR   9             Same page, ok                     @SC87281 01602000
  126. KRMPG    AR    1,5           Round up to next page             @SC87281 01603000
  127.          OR    1,5                                             @SC87281 01604000
  128.          XR    1,5                                             @SC87281 01605000
  129.          BR    9                                                        01606000
  130.          LOCALS ,                                              @SC86295 01607000
  131. KERMIT   EXIT                                                           01608000
  132.