home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / extra / prott.mac < prev    next >
Text File  |  1988-08-16  |  20KB  |  903 lines

  1.     .NLIST
  2.     .ENABL    LC
  3.     .NLIST    BIN,LOC
  4.     .LIST
  5. ;      0001    MODULE KERTT (IDENT = '2.0.004'
  6. ;      0002            ) =
  7. ;      0003    BEGIN
  8. ;      0004    
  9. ;      0005    SWITCHES LANGUAGE (COMMON);
  10. ;      0006    
  11. ;      0007    !<BLF/WIDTH:100>
  12. ;      0008    
  13. ;      0009    !++
  14. ;      0010    ! FACILITY:
  15. ;      0011    !
  16. ;      0012    !    KERMIT text processing
  17. ;      0013    !
  18. ;      0014    ! ABSTRACT:
  19. ;      0015    !
  20. ;      0016    !    This module contains all of the text processing required for
  21. ;      0017    !    KERMSG.
  22. ;      0018    !
  23. ;      0019    ! ENVIRONMENT:
  24. ;      0020    !
  25. ;      0021    !    TOPS-10, P/OS, VAX/VMS
  26. ;      0022    !
  27. ;      0023    ! AUTHOR: Robert C. McQueen, CREATION DATE: 29-August-1983
  28. ;      0024    !--
  29. ;      0025    
  30. ;      0026    
  31. ;      0027    %SBTTL 'Table of Contents'
  32. ;      0028    !
  33. ;      0029    ! TABLE OF CONTENTS:
  34. ;      0030    !
  35. ;      0031    
  36. ;      0032    %SBTTL 'Revision History'
  37. ;      0033    
  38. ;      0034    !++
  39. ;      0035    !
  40. ;      0036    ! Create this module for PRO/Kermit 1.0, Kermit-10 2(100) and Kermit-32 1.2
  41. ;      0037    !
  42. ;      0038    ! 1.2.000    By: Robert C. McQueen            On: 29-August-1983
  43. ;      0039    !        Create this module.
  44. ;      0040    !
  45. ;      0041    ! 1.2.001    By: Robert C. McQueen        On: 9-Sept-1983
  46. ;      0042    !        Make the string passed to TERM_DUMP a counted ASCIZ string,
  47. ;      0043    !        not a counted ASCII string.
  48. ;      0044    !
  49. ;      0045    ! 1.2.002    By: Robert C. McQueen        On: 16-September-1983
  50. ;      0046    !        Make TT_OUTPUT a global routine, so we can force information
  51. ;      0047    !        output a various points in time.
  52. ;      0048    !
  53. ;      0049    ! 2.0.003    Release for TOPS-10 KERMIT-10 version 2.
  54. ;      0050    !        Release for VAX/VMS KERMIT-32 version 2.
  55. ;      0051    !
  56. ;      0052    ! 2.0.004    By: Nick Bush            On: 22-December-1983
  57. ;      0053    !        Add TT_HOLD to indicate that output should not be dumped
  58. ;      0054    !        when LF's are seen, only when buffer is full.
  59. ;      0055    !--
  60. ;      0056    
  61. ;      0057    
  62. ;      0058    %SBTTL 'Library files'
  63. ;      0059    !
  64. ;      0060    ! INCLUDE FILES:
  65. ;      0061    !
  66. ;      0062    !
  67. ;      0063    ! KERMIT common definitions
  68. ;      0064    !
  69. ;      0065    
  70. ;      0066    REQUIRE 'KERCOM';
  71. ;      0266    
  72. ;      0267    
  73. ;      0268    %SBTTL 'Symbol definitions'
  74. ;      0269    !
  75. ;      0270    ! EQUATED SYMBOLS:
  76. ;      0271    !
  77. ;      0272    
  78. ;      0273    LITERAL
  79. ;      0274        TEXT_BFR_LENGTH = 256;            ! Length of the text buffer
  80. ;      0275    
  81. ;      0276    
  82. ;      0277    %SBTTL 'Storage'
  83. ;      0278    !
  84. ;      0279    ! OWN STORAGE:
  85. ;      0280    !
  86. ;      0281    !
  87. ;      0282    ! TT_xxxxx routine storage
  88. ;      0283    !
  89. ;      0284    
  90. ;      0285    OWN
  91. ;      0286        HOLD_FLAG,                    ! Output should be held even if CRLF seen
  92. ;      0287        DUMP_ROUTINE,                ! Address of routine to dump text
  93. ;      0288        TEXT_COUNT,                    ! Count of the characters
  94. ;      0289        TEXT_POINTER,                ! Pointer to store characters
  95. ;      0290        TEXT_BUFFER : VECTOR [CH$ALLOCATION (TEXT_BFR_LENGTH)];    ! Buffer of characters
  96. ;      0291    
  97. ;      0292    
  98. ;      0293    %SBTTL 'External storage'
  99. ;      0294    
  100. ;      0295    !++
  101. ;      0296    ! The following is the various external storage locations that are
  102. ;      0297    ! referenced from this module.
  103. ;      0298    !--
  104. ;      0299    
  105. ;      0300    !
  106. ;      0301    ! KERMSG storage
  107. ;      0302    !
  108. ;      0303    
  109. ;      0304    EXTERNAL
  110. ;      0305        CONNECT_FLAG;                ! Flag if communications line is TT:
  111. ;      0306    
  112. ;      0307    !++
  113. ;      0308    ! The following is the only external routine used by this module.  This
  114. ;      0309    ! routine will cause the terminal buffer that we have been building to be
  115. ;      0310    ! output on the terminal
  116. ;      0311    !--
  117. ;      0312    
  118. ;      0313    EXTERNAL ROUTINE
  119. ;      0314        TERM_DUMP : NOVALUE;            ! Output the terminal buffer
  120. ;      0315    
  121. ;      0316    
  122. ;      0317    %SBTTL 'Terminal routines -- TT_INIT - Initialize this module'
  123. ;      0318    
  124. ;      0319    GLOBAL ROUTINE TT_INIT : NOVALUE =
  125. ;      0320    
  126. ;      0321    !++
  127. ;      0322    ! FUNCTIONAL DESCRIPTION:
  128. ;      0323    !
  129. ;      0324    !    This routine will initialize the terminal processing module.  It will
  130. ;      0325    !    initialize the various data locations in this module.
  131. ;      0326    !
  132. ;      0327    ! CALLING SEQUENCE:
  133. ;      0328    !
  134. ;      0329    !    TT_INIT();
  135. ;      0330    !
  136. ;      0331    ! INPUT PARAMETERS:
  137. ;      0332    !
  138. ;      0333    !    None.
  139. ;      0334    !
  140. ;      0335    ! IMPLICIT INPUTS:
  141. ;      0336    !
  142. ;      0337    !    None.
  143. ;      0338    !
  144. ;      0339    ! OUTPUT PARAMETERS:
  145. ;      0340    !
  146. ;      0341    !    None.
  147. ;      0342    !
  148. ;      0343    ! IMPLICIT OUTPUTS:
  149. ;      0344    !
  150. ;      0345    !    None.
  151. ;      0346    !
  152. ;      0347    ! COMPLETION CODES:
  153. ;      0348    !
  154. ;      0349    !    None.
  155. ;      0350    !
  156. ;      0351    ! SIDE EFFECTS:
  157. ;      0352    !
  158. ;      0353    !    None.
  159. ;      0354    !
  160. ;      0355    !--
  161. ;      0356    
  162. ;      0357        BEGIN
  163. ;      0358    !
  164. ;      0359    ! Now initialize the various pointers
  165. ;      0360    !
  166. ;      0361        TEXT_COUNT = 0;
  167. ;      0362        TEXT_POINTER = CH$PTR (TEXT_BUFFER);
  168. ;      0363        DUMP_ROUTINE = TERM_DUMP;            ! Initial output routine is to terminal
  169. ;      0364        HOLD_FLAG = FALSE;                ! Dump output on CRLF's
  170. ;      0365        END;                    ! End of TT_INIT
  171.     .NLIST
  172.     .LIST    BIN,LOC
  173.     .LIST
  174.  
  175.     .TITLE    KERTT
  176.     .IDENT    /2.0.00/
  177.  
  178.  
  179.     .PSECT    $OWN$,  D  
  180. ; HOLD.FLAG
  181. U.1:    .BLKW    1
  182. ; DUMP.ROUTINE
  183. U.2:    .BLKW    1
  184. ; TEXT.COUNT
  185. U.3:    .BLKW    1
  186. ; TEXT.POINTER
  187. U.4:    .BLKW    1
  188. ; TEXT.BUFFER
  189. U.5:    .BLKW    200
  190.  
  191.  
  192.     .GLOBL    CONNECT.FLAG, TERM.DUMP
  193.  
  194.  
  195. FNM.NORMAL==        1
  196. FNM.FULL==        2
  197. FNM.UNTRAN==        4
  198. PR.MIN==        0
  199. PR.NONE==        0
  200. PR.MARK==        1
  201. PR.EVEN==        2
  202. PR.ODD==        3
  203. PR.SPACE==        4
  204. PR.MAX==        4
  205. GC.MIN==        1
  206. GC.EXIT==        1
  207. GC.DIRECTORY==        2
  208. GC.DISK.USAGE==     3
  209. GC.DELETE==        4
  210. GC.TYPE==        5
  211. GC.HELP==        6
  212. GC.LOGOUT==        7
  213. GC.LGN==        10
  214. GC.CONNECT==        11
  215. GC.RENAME==        12
  216. GC.COPY==        13
  217. GC.WHO==        14
  218. GC.SEND.MSG==        15
  219. GC.STATUS==        16
  220. GC.COMMAND==        17
  221. GC.MAX==        17
  222. DP.FULL==        0
  223. DP.HALF==        1
  224. CHK.1CHAR==        61
  225. CHK.2CHAR==        62
  226. CHK.CRC==        63
  227. MAX.MSG==        140
  228.  
  229.  
  230.     .SBTTL    TT.INIT Terminal routines -- TT_INIT - Initialize this 
  231.     .PSECT    $CODE$,  RO 
  232.  
  233.     .NLIST
  234.     .ENABL    LSB
  235.     .LIST
  236. TT.INIT::
  237.     CLR    U.3                ;                    0361
  238.     MOV    #U.5,U.4            ;                    0362
  239.     MOV    #TERM.DUMP,U.2            ;                    0363
  240.     CLR    U.1                ;                    0364
  241.     RTS    PC                ;                    0319
  242.  
  243. ; Routine Size:  11 words,    Routine Base:  $CODE$ + 0000
  244. ; Maximum stack depth per invocation:  0 words
  245.     .NLIST
  246.     .DSABL    LSB
  247.     .NLIST    BIN,LOC
  248.     .LIST
  249.  
  250.  
  251. ;      0366    
  252. ;      0367    
  253. ;      0368    %SBTTL 'TT_SET_OUTPUT - Set output routine to use'
  254. ;      0369    
  255. ;      0370    GLOBAL ROUTINE TT_SET_OUTPUT (OUT_RTN) =
  256. ;      0371    
  257. ;      0372    !++
  258. ;      0373    ! FUNCTIONAL DESCRIPTION:
  259. ;      0374    !
  260. ;      0375    ! This routine will set the output routine to use for the TT_xxx routines.
  261. ;      0376    !The argument is a routine address which will output a counted ASCIZ string.
  262. ;      0377    !It will return the address of the previous output routine.
  263. ;      0378    !
  264. ;      0379    ! CALLING SEQUENCE:
  265. ;      0380    !
  266. ;      0381    !    OLD_RTN = TT_SET_OUTPUT (OUT_RTN);
  267. ;      0382    !
  268. ;      0383    ! INPUT PARAMETERS:
  269. ;      0384    !
  270. ;      0385    !    OUT_RTN - Address of routine to output a counted ASCIZ string
  271. ;      0386    !        called as OUT_RTN (Address of string, length of string)
  272. ;      0387    !
  273. ;      0388    ! IMPLICIT INPUTS:
  274. ;      0389    !
  275. ;      0390    !    DUMP_ROUTINE - Previous output routine
  276. ;      0391    !
  277. ;      0392    ! OUPTUT PARAMETERS:
  278. ;      0393    !
  279. ;      0394    !    The value of the routine is the previous output routine address.
  280. ;      0395    !
  281. ;      0396    ! IMPLICIT OUTPUTS:
  282. ;      0397    !
  283. ;      0398    !    DUMP_ROUTINE - New output routine
  284. ;      0399    !
  285. ;      0400    ! COMPLETION CODES:
  286. ;      0401    !
  287. ;      0402    !    None.
  288. ;      0403    !
  289. ;      0404    ! SIDE EFFECTS:
  290. ;      0405    !
  291. ;      0406    !    None.
  292. ;      0407    !
  293. ;      0408    !--
  294. ;      0409    
  295. ;      0410        BEGIN
  296. ;      0411    
  297. ;      0412        LOCAL
  298. ;      0413        OLD_RTN;                ! Old routine address
  299. ;      0414    
  300. ;      0415        OLD_RTN = .DUMP_ROUTINE;            ! Remember the old address
  301. ;      0416        DUMP_ROUTINE = .OUT_RTN;            ! Save the new
  302. ;      0417        RETURN .OLD_RTN;                ! And return the old value
  303. ;      0418        END;                    ! End of TT_SET_OUTPUT
  304.     .NLIST
  305.     .LIST    BIN,LOC
  306.     .LIST
  307.  
  308.     .SBTTL    TT.SET.OUTPUT TT_SET_OUTPUT - Set output routine to use
  309.     .NLIST
  310.     .ENABL    LSB
  311.     .LIST
  312. TT.SET.OUTPUT::
  313.     MOV    U.2,R0                ; *,OLD.RTN                0415
  314.     MOV    2(SP),U.2            ; OUT.RTN,*                0416
  315.     RTS    PC                ;                    0370
  316.  
  317. ; Routine Size:  6 words,    Routine Base:  $CODE$ + 0026
  318. ; Maximum stack depth per invocation:  0 words
  319.     .NLIST
  320.     .DSABL    LSB
  321.     .NLIST    BIN,LOC
  322.     .LIST
  323.  
  324.  
  325. ;      0419    
  326. ;      0420    
  327. ;      0421    %SBTTL 'TT_HOLD - Start holding text until TT_OUTPUT call'
  328. ;      0422    
  329. ;      0423    GLOBAL ROUTINE TT_HOLD (FLAG) : NOVALUE =
  330. ;      0424    
  331. ;      0425    !++
  332. ;      0426    ! FUNCTIONAL DESCRIPTION:
  333. ;      0427    !
  334. ;      0428    !    This routine is called to start buffering an amount of data
  335. ;      0429    !    which should not be output until TT_OUTPUT is called.  It
  336. ;      0430    !    sets a flag to indicate that output should not be done on
  337. ;      0431    !    CRLF's.
  338. ;      0432    !
  339. ;      0433    ! CALLING SEQUENCE:
  340. ;      0434    !
  341. ;      0435    !    TT_HOLD (TRUE or FALSE);
  342. ;      0436    !
  343. ;      0437    ! INPUT PARAMETERS:
  344. ;      0438    !
  345. ;      0439    !    FLAG - True if output should be held past LF's.  False if output
  346. ;      0440    !           should be dumped on each LF.
  347. ;      0441    !
  348. ;      0442    ! IMPLICIT INPUTS:
  349. ;      0443    !
  350. ;      0444    !    None.
  351. ;      0445    !
  352. ;      0446    ! OUPTUT PARAMETERS:
  353. ;      0447    !
  354. ;      0448    !    None.
  355. ;      0449    !
  356. ;      0450    ! IMPLICIT OUTPUTS:
  357. ;      0451    !
  358. ;      0452    !    HOLD_FLAG is set to true.
  359. ;      0453    !
  360. ;      0454    ! COMPLETION CODES:
  361. ;      0455    !
  362. ;      0456    !    None.
  363. ;      0457    !
  364. ;      0458    ! SIDE EFFECTS:
  365. ;      0459    !
  366. ;      0460    !    None.
  367. ;      0461    !
  368. ;      0462    !--
  369. ;      0463    
  370. ;      0464        BEGIN
  371. ;      0465        HOLD_FLAG = .FLAG;
  372. ;      0466        END;                    ! End of TT_HOLD
  373.     .NLIST
  374.     .LIST    BIN,LOC
  375.     .LIST
  376.  
  377.     .SBTTL    TT.HOLD TT_HOLD - Start holding text until TT_OUTPUT ca
  378.     .NLIST
  379.     .ENABL    LSB
  380.     .LIST
  381. TT.HOLD::
  382.     MOV    2(SP),U.1            ; FLAG,*                0465
  383.     RTS    PC                ;                    0423
  384.  
  385. ; Routine Size:  4 words,    Routine Base:  $CODE$ + 0042
  386. ; Maximum stack depth per invocation:  0 words
  387.     .NLIST
  388.     .DSABL    LSB
  389.     .NLIST    BIN,LOC
  390.     .LIST
  391.  
  392.  
  393. ;      0467    
  394. ;      0468    
  395. ;      0469    %SBTTL 'Terminal routines -- TT_OUTPUT - Output the buffer'
  396. ;      0470    
  397. ;      0471    GLOBAL ROUTINE TT_OUTPUT : NOVALUE =
  398. ;      0472    
  399. ;      0473    !++
  400. ;      0474    ! FUNCTIONAL DESCRIPTION:
  401. ;      0475    !
  402. ;      0476    !    This routine will dump the text buffer on the output device.
  403. ;      0477    !
  404. ;      0478    ! CALLING SEQUENCE:
  405. ;      0479    !
  406. ;      0480    !    TT_OUTPUT();
  407. ;      0481    !
  408. ;      0482    ! INPUT PARAMETERS:
  409. ;      0483    !
  410. ;      0484    !    None.
  411. ;      0485    !
  412. ;      0486    ! IMPLICIT INPUTS:
  413. ;      0487    !
  414. ;      0488    !    None.
  415. ;      0489    !
  416. ;      0490    ! OUTPUT PARAMETERS:
  417. ;      0491    !
  418. ;      0492    !    None.
  419. ;      0493    !
  420. ;      0494    ! IMPLICIT OUTPUTS:
  421. ;      0495    !
  422. ;      0496    !    None.
  423. ;      0497    !
  424. ;      0498    ! COMPLETION CODES:
  425. ;      0499    !
  426. ;      0500    !    None.
  427. ;      0501    !
  428. ;      0502    ! SIDE EFFECTS:
  429. ;      0503    !
  430. ;      0504    !    None.
  431. ;      0505    !
  432. ;      0506    !--
  433. ;      0507    
  434. ;      0508        BEGIN
  435. ;      0509    
  436. ;      0510        LOCAL
  437. ;      0511        STATUS;                    ! Status returned by the library routine
  438. ;      0512    
  439. ;      0513    !
  440. ;      0514    ! Output the text
  441. ;      0515    !
  442. ;      0516        CH$WCHAR_A (CHR_NUL, TEXT_POINTER);
  443. ;      0517        (.DUMP_ROUTINE) (TEXT_BUFFER, .TEXT_COUNT);    ! Output the buffer to the correct place
  444. ;      0518    !
  445. ;      0519    ! Now reset the descriptor and the pointer to a virgin state
  446. ;      0520    !
  447. ;      0521        TEXT_COUNT = 0;
  448. ;      0522        TEXT_POINTER = CH$PTR (TEXT_BUFFER);
  449. ;      0523    !
  450. ;      0524        END;                    ! End of TT_OUTPUT
  451.     .NLIST
  452.     .LIST    BIN,LOC
  453.     .LIST
  454.  
  455.     .SBTTL    TT.OUTPUT Terminal routines -- TT_OUTPUT - Output the buf
  456.     .NLIST
  457.     .ENABL    LSB
  458.     .LIST
  459. TT.OUTPUT::
  460.     CLRB    @U.4                ;                    0516
  461.     INC    U.4
  462.     MOV    #U.5,-(SP)            ;                    0517
  463.     MOV    U.3,-(SP)
  464.     JSR    PC,@U.2
  465.     CLR    U.3                ;                    0521
  466.     MOV    #U.5,U.4            ;                    0522
  467.     CMP    (SP)+,(SP)+            ;                    0508
  468.     RTS    PC                ;                    0471
  469.  
  470. ; Routine Size:  17 words,    Routine Base:  $CODE$ + 0052
  471. ; Maximum stack depth per invocation:  3 words
  472.     .NLIST
  473.     .DSABL    LSB
  474.     .NLIST    BIN,LOC
  475.     .LIST
  476.  
  477.  
  478. ;      0525    
  479. ;      0526    
  480. ;      0527    %SBTTL 'Terminal routines -- TT_CHAR - Output a single character'
  481. ;      0528    
  482. ;      0529    GLOBAL ROUTINE TT_CHAR (CHARACTER) : NOVALUE =
  483. ;      0530    
  484. ;      0531    !++
  485. ;      0532    ! FUNCTIONAL DESCRIPTION:
  486. ;      0533    !
  487. ;      0534    !    This routine will store a character into the text buffer.  It will
  488. ;      0535    !    cause the text to be output if the character is a line terminator.
  489. ;      0536    !
  490. ;      0537    ! CALLING SEQUENCE:
  491. ;      0538    !
  492. ;      0539    !    TT_CHAR(Character);
  493. ;      0540    !
  494. ;      0541    ! INPUT PARAMETERS:
  495. ;      0542    !
  496. ;      0543    !    Character - Character to store into the text buffer.
  497. ;      0544    !
  498. ;      0545    ! IMPLICIT INPUTS:
  499. ;      0546    !
  500. ;      0547    !    None.
  501. ;      0548    !
  502. ;      0549    ! OUTPUT PARAMETERS:
  503. ;      0550    !
  504. ;      0551    !    None.
  505. ;      0552    !
  506. ;      0553    ! IMPLICIT OUTPUTS:
  507. ;      0554    !
  508. ;      0555    !    None.
  509. ;      0556    !
  510. ;      0557    ! COMPLETION CODES:
  511. ;      0558    !
  512. ;      0559    !    None.
  513. ;      0560    !
  514. ;      0561    ! SIDE EFFECTS:
  515. ;      0562    !
  516. ;      0563    !    None.
  517. ;      0564    !
  518. ;      0565    !--
  519. ;      0566    
  520. ;      0567        BEGIN
  521. ;      0568    !
  522. ;      0569    ! Increment the count of the characters
  523. ;      0570    !
  524. ;      0571        TEXT_COUNT = .TEXT_COUNT + 1;
  525. ;      0572    !
  526. ;      0573    ! And store the character
  527. ;      0574    !
  528. ;      0575        CH$WCHAR_A (.CHARACTER, TEXT_POINTER);
  529. ;      0576    !
  530. ;      0577    ! If this is a line feed then just output the text string
  531. ;      0578    !
  532. ;      0579    
  533. ;      0580        IF (.CHARACTER EQL CHR_LFD) AND NOT .HOLD_FLAG THEN TT_OUTPUT ();
  534. ;      0581    
  535. ;      0582    !
  536. ;      0583    ! Check to make sure we are not exceeding the limit of the buffer
  537. ;      0584    !
  538. ;      0585    
  539. ;      0586        IF .TEXT_COUNT EQL TEXT_BFR_LENGTH - 1 THEN TT_OUTPUT ();
  540. ;      0587    
  541. ;      0588    !
  542. ;      0589        END;                    ! End of TT_CHAR
  543.     .NLIST
  544.     .LIST    BIN,LOC
  545.     .LIST
  546.  
  547.     .SBTTL    TT.CHAR Terminal routines -- TT_CHAR - Output a single 
  548.     .NLIST
  549.     .ENABL    LSB
  550.     .LIST
  551. TT.CHAR::
  552.     INC    U.3                ;                    0571
  553.     MOVB    2(SP),@U.4            ; CHARACTER,*                0575
  554.     INC    U.4
  555.     CMP    2(SP),#12            ; CHARACTER,*                0580
  556.     BNE    1$
  557.     BIT    #1,U.1
  558.     BNE    1$
  559.     JSR    PC,TT.OUTPUT
  560. 1$:    CMP    U.3,#377            ;                    0586
  561.     BNE    2$
  562.     JSR    PC,TT.OUTPUT
  563. 2$:    RTS    PC                ;                    0529
  564.  
  565. ; Routine Size:  24 words,    Routine Base:  $CODE$ + 0114
  566. ; Maximum stack depth per invocation:  1 word
  567.     .NLIST
  568.     .DSABL    LSB
  569.     .NLIST    BIN,LOC
  570.     .LIST
  571.  
  572.  
  573. ;      0590    
  574. ;      0591    
  575. ;      0592    %SBTTL 'Terminal routines -- TT_TEXT - Output a text string'
  576. ;      0593    
  577. ;      0594    GLOBAL ROUTINE TT_TEXT (ADDRESS) : NOVALUE =
  578. ;      0595    
  579. ;      0596    !++
  580. ;      0597    ! FUNCTIONAL DESCRIPTION:
  581. ;      0598    !
  582. ;      0599    !    This routine will output text on the user's terminal.  It will
  583. ;      0600    !    assume that it must check to determine if it can output the text
  584. ;      0601    !    or not.
  585. ;      0602    !
  586. ;      0603    ! CALLING SEQUENCE:
  587. ;      0604    !
  588. ;      0605    !    TT_TEXT(TEXT_ADDRESS);
  589. ;      0606    !
  590. ;      0607    ! INPUT PARAMETERS:
  591. ;      0608    !
  592. ;      0609    !    None.
  593. ;      0610    !
  594. ;      0611    ! IMPLICIT INPUTS:
  595. ;      0612    !
  596. ;      0613    !    None.
  597. ;      0614    !
  598. ;      0615    ! OUTPUT PARAMETERS:
  599. ;      0616    !
  600. ;      0617    !    None.
  601. ;      0618    !
  602. ;      0619    ! IMPLICIT OUTPUTS:
  603. ;      0620    !
  604. ;      0621    !    None.
  605. ;      0622    !
  606. ;      0623    ! COMPLETION CODES:
  607. ;      0624    !
  608. ;      0625    !    None.
  609. ;      0626    !
  610. ;      0627    ! SIDE EFFECTS:
  611. ;      0628    !
  612. ;      0629    !    None.
  613. ;      0630    !
  614. ;      0631    !--
  615. ;      0632    
  616. ;      0633        BEGIN
  617. ;      0634    
  618. ;      0635        LOCAL
  619. ;      0636        CHARACTER,                ! Character being processed
  620. ;      0637        ARG_POINTER;                ! Pointer to the argument's text
  621. ;      0638    
  622. ;      0639    !
  623. ;      0640    ! Construct a pointer to the argument.
  624. ;      0641    !
  625. ;      0642        ARG_POINTER = CH$PTR (.ADDRESS);
  626. ;      0643    !
  627. ;      0644    ! Get the first character that was passed.
  628. ;      0645    !
  629. ;      0646        CHARACTER = CH$RCHAR_A (ARG_POINTER);
  630. ;      0647    !
  631. ;      0648    ! Loop reading characters and calling the output routine to process
  632. ;      0649    ! them
  633. ;      0650    !
  634. ;      0651    
  635. ;      0652        WHILE .CHARACTER NEQ CHR_NUL DO
  636. ;      0653        BEGIN
  637. ;      0654        TT_CHAR (.CHARACTER);
  638. ;      0655        CHARACTER = CH$RCHAR_A (ARG_POINTER);
  639. ;      0656        END;
  640. ;      0657    
  641. ;      0658        END;                    ! End of TT_TEXT
  642.     .NLIST
  643.     .LIST    BIN,LOC
  644.     .LIST
  645.  
  646.     .SBTTL    TT.TEXT Terminal routines -- TT_TEXT - Output a text st
  647.     .NLIST
  648.     .ENABL    LSB
  649.     .LIST
  650. TT.TEXT::
  651.     JSR    R1,$SAVE2            ;                    0594
  652.     MOV    10(SP),R1            ; ADDRESS,ARG.POINTER            0642
  653.     CLR    R2                ; CHARACTER                0646
  654.     BISB    (R1)+,R2            ; ARG.POINTER,CHARACTER
  655. 1$:    TST    R2                ; CHARACTER                0652
  656.     BEQ    2$
  657.     MOV    R2,-(SP)            ; CHARACTER,*                0654
  658.     JSR    PC,TT.CHAR
  659.     CLR    R2                ; CHARACTER                0655
  660.     BISB    (R1)+,R2            ; ARG.POINTER,CHARACTER
  661.     TST    (SP)+                ;                    0653
  662.     BR    1$                ;                    0652
  663. 2$:    RTS    PC                ;                    0594
  664.  
  665. ; Routine Size:  16 words,    Routine Base:  $CODE$ + 0174
  666. ; Maximum stack depth per invocation:  5 words
  667.     .NLIST
  668.     .DSABL    LSB
  669.     .NLIST    BIN,LOC
  670.     .LIST
  671.  
  672.  
  673. ;      0659    
  674. ;      0660    
  675. ;      0661    %SBTTL 'Terminal routines -- TT_NUMBER - Output a three digit number'
  676. ;      0662    
  677. ;      0663    GLOBAL ROUTINE TT_NUMBER (NUMBER) : NOVALUE =
  678. ;      0664    
  679. ;      0665    !++
  680. ;      0666    ! FUNCTIONAL DESCRIPTION:
  681. ;      0667    !
  682. ;      0668    !    This routine will store a three digit number into the text buffer.
  683. ;      0669    !    It will just return if the number is greater than 999.
  684. ;      0670    !
  685. ;      0671    ! CALLING SEQUENCE:
  686. ;      0672    !
  687. ;      0673    !    TT_NUMBER(Value);
  688. ;      0674    !
  689. ;      0675    ! INPUT PARAMETERS:
  690. ;      0676    !
  691. ;      0677    !    Value - Value to output.
  692. ;      0678    !
  693. ;      0679    ! IMPLICIT INPUTS:
  694. ;      0680    !
  695. ;      0681    !    None.
  696. ;      0682    !
  697. ;      0683    ! OUTPUT PARAMETERS:
  698. ;      0684    !
  699. ;      0685    !    None.
  700. ;      0686    !
  701. ;      0687    ! IMPLICIT OUTPUTS:
  702. ;      0688    !
  703. ;      0689    !    None.
  704. ;      0690    !
  705. ;      0691    ! COMPLETION CODES:
  706. ;      0692    !
  707. ;      0693    !    None.
  708. ;      0694    !
  709. ;      0695    ! SIDE EFFECTS:
  710. ;      0696    !
  711. ;      0697    !    None.
  712. ;      0698    !
  713. ;      0699    !--
  714. ;      0700    
  715. ;      0701        BEGIN
  716. ;      0702        ROUTINE TT_NUM_WORKER (VALUE) : NOVALUE =
  717. ;      0703        BEGIN
  718. ;      0704    
  719. ;      0705        IF .VALUE LEQ 9
  720. ;      0706        THEN
  721. ;      0707            TT_CHAR (.VALUE + %C'0')
  722. ;      0708        ELSE
  723. ;      0709            BEGIN
  724. ;      0710            TT_NUM_WORKER (.VALUE/10);
  725. ;      0711            TT_CHAR ((.VALUE MOD 10) + %C'0');
  726. ;      0712            END;
  727. ;      0713    
  728. ;      0714        END;
  729.     .NLIST
  730.     .LIST    BIN,LOC
  731.     .LIST
  732.  
  733.     .SBTTL    TT.NUM.WORKER Terminal routines -- TT_NUMBER - Output a three
  734.     .NLIST
  735.     .ENABL    LSB
  736.     .LIST
  737. ; TT.NUM.WORKER
  738. U.13:    JSR    R1,$SAVE2            ;                    0702
  739.     MOV    10(SP),R2            ; VALUE,*                0705
  740.     CMP    R2,#11
  741.     BGT    1$
  742.     MOV    R2,-(SP)            ;                    0707
  743.     BR    2$
  744. 1$:    MOV    R2,R1                ;                    0710
  745.     SXT    R0
  746.     DIV    #12,R0
  747.     MOV    R0,-(SP)
  748.     JSR    PC,U.13
  749.     MOV    R2,R1                ;                    0711
  750.     SXT    R0
  751.     DIV    #12,R0
  752.     MOV    R1,(SP)
  753. 2$:    ADD    #60,(SP)
  754.     JSR    PC,TT.CHAR
  755.     TST    (SP)+                ;                    0703
  756.     RTS    PC                ;                    0702
  757.  
  758. ; Routine Size:  27 words,    Routine Base:  $CODE$ + 0234
  759. ; Maximum stack depth per invocation:  5 words
  760.     .NLIST
  761.     .DSABL    LSB
  762.     .NLIST    BIN,LOC
  763.     .LIST
  764.  
  765.  
  766. ;      0715    
  767. ;      0716        IF .NUMBER LSS 0
  768. ;      0717        THEN
  769. ;      0718        BEGIN
  770. ;      0719        TT_CHAR (%C'-');
  771. ;      0720        NUMBER = -.NUMBER;
  772. ;      0721        END;
  773. ;      0722    
  774. ;      0723        TT_NUM_WORKER (.NUMBER);
  775. ;      0724        END;                    ! End of TT_NUMBER
  776.     .NLIST
  777.     .LIST    BIN,LOC
  778.     .LIST
  779.  
  780.     .SBTTL    TT.NUMBER Terminal routines -- TT_NUMBER - Output a three
  781.     .NLIST
  782.     .ENABL    LSB
  783.     .LIST
  784. TT.NUMBER::
  785.     TST    2(SP)                ; NUMBER                0716
  786.     BGE    1$
  787.     MOV    #55,-(SP)            ;                    0719
  788.     JSR    PC,TT.CHAR
  789.     NEG    4(SP)                ; NUMBER                0720
  790.     TST    (SP)+                ;                    0718
  791. 1$:    MOV    2(SP),-(SP)            ; NUMBER,*                0723
  792.     JSR    PC,U.13
  793.     TST    (SP)+                ;                    0701
  794.     RTS    PC                ;                    0663
  795.  
  796. ; Routine Size:  16 words,    Routine Base:  $CODE$ + 0322
  797. ; Maximum stack depth per invocation:  2 words
  798.     .NLIST
  799.     .DSABL    LSB
  800.     .NLIST    BIN,LOC
  801.     .LIST
  802.  
  803.  
  804. ;      0725    
  805. ;      0726    
  806. ;      0727    %SBTTL 'Terminal routines -- TT_CRLF - Output a CRLF'
  807. ;      0728    
  808. ;      0729    GLOBAL ROUTINE TT_CRLF : NOVALUE =
  809. ;      0730    
  810. ;      0731    !++
  811. ;      0732    ! FUNCTIONAL DESCRIPTION:
  812. ;      0733    !
  813. ;      0734    !    This routine will cause the contents of the terminal buffer to be
  814. ;      0735    !    output to SYS$OUTPUT:.
  815. ;      0736    !
  816. ;      0737    ! CALLING SEQUENCE:
  817. ;      0738    !
  818. ;      0739    !    TT_CRLF();
  819. ;      0740    !
  820. ;      0741    ! INPUT PARAMETERS:
  821. ;      0742    !
  822. ;      0743    !    None.
  823. ;      0744    !
  824. ;      0745    ! IMPLICIT INPUTS:
  825. ;      0746    !
  826. ;      0747    !    None.
  827. ;      0748    !
  828. ;      0749    ! OUTPUT PARAMETERS:
  829. ;      0750    !
  830. ;      0751    !    None.
  831. ;      0752    !
  832. ;      0753    ! IMPLICIT OUTPUTS:
  833. ;      0754    !
  834. ;      0755    !    None.
  835. ;      0756    !
  836. ;      0757    ! COMPLETION CODES:
  837. ;      0758    !
  838. ;      0759    !    None.
  839. ;      0760    !
  840. ;      0761    ! SIDE EFFECTS:
  841. ;      0762    !
  842. ;      0763    !    None.
  843. ;      0764    !
  844. ;      0765    !--
  845. ;      0766    
  846. ;      0767        BEGIN
  847. ;      0768        TT_CHAR (CHR_CRT);
  848. ;      0769        TT_CHAR (CHR_LFD);
  849. ;      0770        END;                    ! End of TT_CRLF
  850.     .NLIST
  851.     .LIST    BIN,LOC
  852.     .LIST
  853.  
  854.     .SBTTL    TT.CRLF Terminal routines -- TT_CRLF - Output a CRLF
  855.     .NLIST
  856.     .ENABL    LSB
  857.     .LIST
  858. TT.CRLF::
  859.     MOV    #15,-(SP)            ;                    0768
  860.     JSR    PC,TT.CHAR
  861.     MOV    #12,(SP)            ;                    0769
  862.     JSR    PC,TT.CHAR
  863.     TST    (SP)+                ;                    0767
  864.     RTS    PC                ;                    0729
  865.  
  866. ; Routine Size:  10 words,    Routine Base:  $CODE$ + 0362
  867. ; Maximum stack depth per invocation:  2 words
  868.     .NLIST
  869.     .DSABL    LSB
  870.     .NLIST    BIN,LOC
  871.     .LIST
  872.  
  873.  
  874. ;      0771    
  875. ;      0772    
  876. ;      0773    %SBTTL 'End of KERTRM'
  877. ;      0774    END                        ! End of module
  878. ;      0775    
  879. ;      0776    ELUDOM
  880.     .NLIST
  881.     .LIST    BIN,LOC
  882.     .LIST
  883.  
  884.  
  885. ; OTS external references
  886.     .GLOBL    $SAVE2
  887.  
  888.  
  889. ;                    PSECT SUMMARY
  890. ;
  891. ;    Psect Name            Words    ; Attributes
  892. ;     $OWN$                  132    ;   RW ,  D  ,  LCL,  REL,  CON
  893. ;     $CODE$                  131    ;   RO ,  I  ,  LCL,  REL,  CON
  894.  
  895.  
  896.  
  897.  
  898.  
  899. ; Compilation Complete
  900.  
  901.     .END
  902.  
  903.