home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ibmtsoqueens.tar.gz / ibmtsoqueens.tar / ts2ker.asm < prev    next >
Assembly Source File  |  1988-08-16  |  12KB  |  153 lines

  1. TREAD    CSECT ,                                                        00000100
  2. *********************************************************************** 00000200
  3. *                                                                     * 00000300
  4. * TREAD (PROMPT_MESSAGE,PROMPT_LENGTH,MESSAGE_AREA,LENGTH,RTN_CODE)   * 00000400
  5. *                                                                     * 00000500
  6. *********************************************************************** 00000600
  7. R0       EQU   0                                                        00000700
  8. R1       EQU   1                                                        00000800
  9. R2       EQU   2                                                        00000900
  10. R3       EQU   3                                                        00001000
  11. R4       EQU   4                                                        00001100
  12. R5       EQU   5                                                        00001200
  13. R6       EQU   6                                                        00001300
  14. R7       EQU   7                                                        00001400
  15. R8       EQU   8                                                        00001500
  16. R9       EQU   9                                                        00001600
  17. R10      EQU   10                                                       00001700
  18. R11      EQU   11                                                       00001800
  19. R12      EQU   12                                                       00001900
  20. R13      EQU   13                                                       00002000
  21. R14      EQU   14                                                       00002100
  22. R15      EQU   15                                                       00002200
  23.          SAVE  (14,12),,*                                               00002300
  24.          LR    R12,R15                                                  00002400
  25.          USING TREAD,R12                                                00002500
  26. *********************************************************************** 00002600
  27. *  FIRST WE WILL DO A TPUT FOR THE PROMPT MESSAGE (IF IT EXISTS)      * 00002700
  28. *  THEN.. ASK FOR THE INPUT.                                          * 00002800
  29. *                                                                     * 00002900
  30. *********************************************************************** 00003000
  31.          LR    R5,R1               SAVE INPUT PARM PTR                  00003100
  32.          L     R1,0(R5)            GET THE PTR TO THE MSG TEXT          00003200
  33.          L     R2,4(R5)            GET THE LENGTH                       00003300
  34.          L     R0,0(R2)            ...                                  00003400
  35.          LTR   R0,R0               IS IT THERE ?                        00003500
  36.          BZ    TRE0                NO.. JUST DO TGET                    00003600
  37.          ICM   1,8,=B'00000001'                                         00003700
  38.          TPUT  (1),(0),R                                                00003800
  39. TRE0     EQU   *                                                        00003900
  40.          L     R1,8(R5)            PICK UP THE ADDRESS INPUT TEXT       00004000
  41.          LR    R3,R1               SAVE THE BUFFER ADDRESS              00004100
  42.          LA    R0,1024             HOW MUCH WE CAN STAND = 1K           00004200
  43.          ICM   R1,8,=B'10000000'   TURN ON 'TGET' FLAG                  00004300
  44.          TGET  (1),(0),R                                                00004400
  45.          L     R2,16(R5)           GET THE RETURN CODE PTR              00004500
  46.          LA    R15,1               SET SUPER RETURN CODE                00004600
  47.          ST    R15,0(R2)           STORE IT..                           00004700
  48.          L     R2,12(R5)           GET HOW MUCH TCAM BOUGHT             00004800
  49.          ST    R1,0(R2)            AND GIVE IT BACK TO THE CALLER       00004900
  50.          RETURN (14,12),RC=0                                            00005000
  51.          SPACE 4                                                        00005100
  52. BLANKS   DC    4CL256' '                                                00005200
  53.          LTORG ,                                                        00005300
  54.          END   ,                                                        00005400
  55. *                                                                       00640100
  56. *                                                                       00640200
  57. *                                                                       00640300
  58. *                                                                       00640400
  59. *                                                                       00640500
  60. *                                                                       00640600
  61. TWRITE   CSECT ,                                                        00640700
  62. *********************************************************************** 00640800
  63. *                                                                     * 00640900
  64. * TWRITE (MESSAGE,MESSAGE LENGTH,RETURN CODE)                         * 00641000
  65. *                                                                     * 00641100
  66. *********************************************************************** 00641200
  67. R0       EQU   0                                                        00641300
  68. R1       EQU   1                                                        00641400
  69. R2       EQU   2                                                        00641500
  70. R3       EQU   3                                                        00641600
  71. R4       EQU   4                                                        00641700
  72. R5       EQU   5                                                        00641800
  73. R6       EQU   6                                                        00641900
  74. R7       EQU   7                                                        00642000
  75. R8       EQU   8                                                        00642100
  76. R9       EQU   9                                                        00642200
  77. R10      EQU   10                                                       00642300
  78. R11      EQU   11                                                       00642400
  79. R12      EQU   12                                                       00642500
  80. R13      EQU   13                                                       00642600
  81. R14      EQU   14                                                       00642700
  82. R15      EQU   15                                                       00642800
  83. *********************************************************************** 00642900
  84. * TWRITE -                                                            * 00643000
  85. *                                                                     * 00643100
  86. * ISSUE A TPUT FOR THE CALLING PROGRAM..                              * 00643200
  87. *                                                                     * 00643300
  88. *                                                                     * 00643400
  89. *********************************************************************** 00643500
  90.          SAVE  (14,12)                                                  00643600
  91.          LR    R12,R15                                                  00643700
  92.          USING TWRITE,R12                                               00643800
  93.          LR    R5,R1               SAVE PTR TO INPUT PARMS              00643900
  94.          L     R1,0(R5)            PT TO OUTPUT TEXT                    00644000
  95.          L     R2,4(R5)            GET OUTPUT LENGTH                    00644100
  96.          L     R0,0(R2)            ...                                  00644200
  97.          ICM   1,8,=B'00000010'    'CONTROL'-PROCESSING                 00644300
  98.          TPUT  (1),(0),R           DO IT                                00644400
  99.          LA    R15,1               SET CRAZY RETURN CODE                00644500
  100.          L     R1,8(R5)            GET THE CCODE PTR                    00644600
  101.          ST    R15,0(R1)           SAVE IT.                             00644700
  102.          RETURN (14,12),RC=0                                            00644800
  103.          SPACE 4                                                        00644900
  104.          LTORG ,                                                        00645000
  105.          END   ,                                                        00645100
  106. *                                                                       00645200
  107. *                                                                       00645300
  108. *                                                                       00645400
  109. *                                                                       00645500
  110. *                                                                       00645600
  111.          PRINT GEN                                                      00645700
  112. WAIT     CSECT                                                          00645800
  113.          USING *,15                                                     00645900
  114.          STM   14,12,12(13)                                             00646000
  115.          ST    13,SAVEAREA+4                                            00646100
  116.          BALR  5,0                                                      00646200
  117.          USING *,5                                                      00646300
  118.          L     2,0(1)                                                   00646400
  119. *                                                                       00646500
  120.          L     3,0(2)                                                   00646600
  121.          ST    3,DELAY                                                  00646700
  122.          STIMER  WAIT,BINTVL=DELAY                                      00646800
  123. *                                                                       00646900
  124.          L     13,SAVEAREA+4                                            00647000
  125.          LM    14,12,12(13)                                             00647100
  126.          BR    14                                                       00647200
  127. DELAY    DS    F                                                        00647300
  128. SAVEAREA DS    18F                                                      00647400
  129.          END                                                            00647500
  130. *                                                                       00647600
  131. *                                                                       00647700
  132. *                                                                       00647800
  133. *                                                                       00647900
  134. *                                                                       00648000
  135.          PRINT GEN                                                      00648100
  136. TERMSIZE CSECT                                                          00648200
  137.          USING  *,15                                                    00648300
  138.          STM    14,12,12(13)                                            00648400
  139.          ST     13,SAVEAREA+4                                           00648500
  140.          BALR   5,0                                                     00648600
  141.          USING  *,5                                                     00648700
  142.          L      2,0(1)                                                  00648800
  143. *                                                                       00648900
  144.          GTSIZE ,                 GET TERMINAL INFO                     00649000
  145. *                                 R1: CHARS/LINE  R0: LINES ON SCREEN   00649100
  146.          ST     0,0(2)                                                  00649200
  147. *                                                                       00649300
  148.          L      13,SAVEAREA+4                                           00649400
  149.          LM     14,12,12(13)                                            00649500
  150.          BR     14                                                      00649600
  151. SAVEAREA DS     18F                                                     00649700
  152.          END                                                            00649800
  153.