home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / b / krtdsp.mac < prev    next >
Text File  |  2020-01-01  |  16KB  |  516 lines

  1.     .title    KRTDSP    I/O dispatch and support
  2.     .ident    "V03.63"
  3.  
  4. ; /63/    27-Sep-97  Billy Youdelman  V03.63
  5.  
  6. ; /62/    27-Jul-93  Billy Youdelman  V03.62
  7. ;
  8. ;    leave comm handler chans open after assigning it as the link device
  9. ;    add version testing to support RT-11 V4
  10.  
  11. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  12. ;
  13. ;    this module has been extensively modified
  14. ;
  15. ;    moved kbread here, one copy is sufficient, cleaned up also
  16. ;    streamlined jsw/nowait/single_char modes/setting/resetting/etc
  17. ;    added writ1char routine - writes a single character to TT
  18. ;    add entry for inqdtr, only works with CL handler
  19. ;    assdev patched for new mapxl in krtxl
  20. ;    made packet buffer length = $ALLSIZ to match checkpacket buffer
  21. ;    ttyrst - resume TSX window processing, as after packets, connect
  22. ;    added cl.dump to clean up CL stuff when exiting/modifying the line
  23. ;    inqbuf patched to use MAXLNG for TSX+, MAXPAK for RT-11
  24. ;    added inqcd
  25. ;
  26. ;    moved binread here so CONNECT can share it and XL can be left
  27. ;    open under TSX and RT-11SJ where there is no hope of closing it
  28. ;
  29. ;    I/O is now dispatched this way:
  30. ;     1) if via the controlling terminal line, use routines in KRTERM
  31. ;        regardless of operating system.  that is, the t.tty... calls
  32. ;     2) if via a handler, use routines in KRTXL.  that is, the
  33. ;        x.tty... calls for CL XC or XL
  34. ;     3) RT-11 multi-terminal I/O has been pulled
  35. ;
  36. ;    moved set$line here, patched to reset modem to idle state and release
  37. ;    a TSX CL line after SET LINE TT if same was acquired within Kermit
  38. ;
  39. ;    set$line won't write bad device to ttname
  40. ;    SET LINE TT now reverts to remote mode
  41.  
  42. ;    08-Nov-84  16:16:40  Brian Nelson
  43. ;
  44. ;     Collect  K11PRT  and  K11TSX  into  separate  overlays  in
  45. ;    the same region (either disk or virtual).  Dispatch to  the
  46. ;    correct one based on how the link device is SET.  While the
  47. ;    cost in address  space  to create overlay table entries for
  48. ;    all of the ept's in each module is about 300 words doing so
  49. ;    saves me the need to create multiple save images every time
  50. ;    I  change Kermit-11.  Additionally,  one save image for all
  51. ;    systems sounds like a nice idea to me.
  52. ;
  53. ;    12-Sep-86  11:20:20 BDN Changed around to separate I/D space
  54.  
  55.  
  56.     .include "IN:KRTMAC.MAC"
  57.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  58.  
  59. ; /62/    .ABTIO,.POKE bypassed for V4, also expanded to allow assy under same
  60.  
  61.     .mcall    .CLOSE    ,.GVAL    ,.RCTRLO,.RSUM
  62.     .mcall    .SPFUN    ,.TTINR    ,.TTYIN    ,.TTYOU    ,.TWAIT
  63.  
  64.  
  65.     .macro    entry    ep        ; dispatch to TT or handler as needed
  66.     .list me
  67.     .enabl    lsb
  68. ep::    mov    #200$    ,r0
  69.     jmp    dispat
  70.     .save
  71.     .psect    $pdata
  72. 200$:    .word    x.'ep,t.'ep        ; dropped multi-term stuff
  73.     .restore
  74.     .dsabl    lsb
  75.     .nlist me
  76.     .endm    entry
  77.  
  78.  
  79.     .sbttl    Global and local data
  80.  
  81.     CLHOSE    =    265        ; reset for TSX V6.0 and up CL handler
  82.     DTRDRV    =    206        ; RT-11 V5.2 and up, set/clear DTR
  83.     OFFDRV    =    205        ; disable interrupts at program exit
  84.     $tcfig    =    424        ; ADDR of SET TERM options status word
  85.  
  86.     .psect    xcdata    ,rw,d,gbl,rel,con
  87. attcl::    .byte    0 ,155            ; attach a CL unit to a TSX line
  88. cl.unit::.word    0            ; integer copy of CL unit number
  89. cl.line::.word    0            ; connect CL unit to this TSX line #
  90. cl$line::.word    0            ; perm copy, follows valid assign
  91. d.allo::.byte    0 ,156            ; (de)allocate a device emt args
  92.     .word    cl.r50            ; device to (de)allo..
  93. cl.r50::.word    0 ,0 ,0 ,0        ; ..which lives here
  94. km.lock::.word    0            ; /62/ if <> it's KM running
  95. r50dev::.word    0 ,0 ,0 ,0        ; current link dev name, if handler
  96. suspnd::.word    0            ; suspend count for CONNECT tasks
  97. xcdone::.word    0            ; moved here, read is complete
  98. xk.con::.word    0            ; if <>, reads to terminal emulator
  99. xkrd1:    .word    0 ,0 ,0 ,0 ,0 ,0    ; work area for handler reads
  100. xksize    ==    100            ; size in bytes for handler reads
  101. xkbuff::.blkb    xksize+2        ; read buffer for handler
  102. xkpoint::.word    xkbuff            ; pointer to current position in buff
  103. xkspeed::.word    0            ; moved here to live in root
  104. xl.lock::.word    0            ; if <> XL can't do .close
  105. z.atch::.word    0            ; if <> TSX line was gotten here
  106.  
  107.     .psect    $pdata
  108. tsxwai:    .word    0 ,1            ; ticks between reads from keyboard
  109. w$resume:.byte    4 ,161            ; resume TSX window processing
  110.     .even
  111.  
  112.     .psect    packet    ,rw,d,lcl,rel,con
  113. packet::.blkb    $allsiz            ; the packet buffer
  114.  
  115.  
  116.     .psect    $code            ; /62/ missed this in the last edit..
  117.     .sbttl    SET LINE        ; /BBS/ moved this here
  118.  
  119. set$li::tst    xl.lock            ; can current device go away?
  120.     beq    10$            ; no problem
  121.     mov    #er$150    ,r0        ; big problem
  122.     br    30$            ; go handle it
  123.  
  124. 10$:    upcase    argbuf            ; ensure case is correct..
  125.     strlen    argbuf            ; get length of device name
  126.     add    argbuf    ,r0        ; then point to end of it
  127.     cmpb    -(r0)    ,#':        ; is last byte a colon?
  128.     beq    20$            ; ya
  129.     tstb    (r0)+            ; no, bump to where colon goes
  130.     movb    #':    ,(r0)+        ; insert same after device name
  131.     clrb    @r0            ; and re-terminate
  132.  
  133. 20$:    calls    assdev    ,<argbuf>    ; try to get the exec to allocate it
  134.     tst    r0            ; did the allocation work?
  135.     beq    40$            ; ya..
  136. 30$:    direrr    r0            ; no, print out the directive error
  137.     call    incsts            ; /62/ flag there was an error
  138.     clr    r0            ; error just handled
  139.     sec                ; so CONNECT can detect error
  140.     br    80$            ; done
  141.  
  142. 40$:    tst    tt$io            ; /62/ talking to TT?
  143.     beq    50$            ; no
  144.     clrb    ttname            ; ya, clear the name
  145.     clr    cl$line            ; not using a TSX port any more
  146.     mov    sp    ,remote        ; we are now the remote system
  147.     br    60$
  148.  
  149. 50$:    strcpy    #ttname    ,argbuf        ; /62/ moved this here..
  150.     mov    cl.line    ,cl$line    ; save perm copy of TSX port #
  151.     clr    remote            ; no longer are we remote
  152. 60$:    tst    infomsg            ; SET TT QUIET?
  153.     beq    70$            ; ya
  154.     call    sho$line        ; no, display the new line
  155. 70$:    clr    r0            ; error handled above
  156. 80$:    return
  157.  
  158.  
  159.     .sbttl    Assign the link device
  160.  
  161. assdev::mov    @r5    ,r0        ; get the first character of the name
  162.     cmpb    #'T&137    ,(r0)+        ; a "T" ?
  163.     bne    10$            ; nope..
  164.     cmpb    #'T&137    ,(r0)+        ; a second "T" ?
  165.     bne    10$            ; nope..
  166.     tstb    @r0            ; "TT"
  167.     beq    40$            ; is okie..
  168.     cmpb    #':    ,(r0)+        ; so iz "TT:"
  169.     bne    10$            ; this ain't it
  170.     tstb    @r0            ; must be null
  171.     beq    40$            ; ok
  172.  
  173. 10$:    tst    r50dev            ; is something already in use?
  174.     beq    20$            ; no
  175.     mov    #er$140    ,r0        ; ya, got to drop it first
  176.     br    30$
  177. 20$:    call    x.assdev        ; try to talk to it
  178. 30$:    return
  179.  
  180. 40$:    mov    mready    ,-(sp)        ; save modem status
  181.     call    c$idle            ; reset modem, if need be..
  182.     tst    (sp)+            ; was there a modem?
  183.     beq    50$            ; nope
  184.     calls    suspend    ,<#0,settle>    ; ya, let it settle
  185. 50$:    call    xl.dump            ; drop handler interrupts
  186.     tst    tsxcl            ; was prior line a CL unit?
  187.     beq    60$            ; nope
  188.     call    cl.dump            ; dump possible CL cross-connect
  189.  
  190. 60$:    clr    r50dev            ; not a handler now..
  191.     clr    xkspeed            ; kludge, can't get from handler
  192.     clr    b4speed            ; hose any fallback reset speed
  193.     clr    tsxcl            ; can't be this now
  194.     mov    sp    ,tt$io        ; /62/ flag to do I/O via TT
  195.     tst    tsxsav            ; real TSX+ ?
  196.     bne    80$            ; /62/ ya, that's it..
  197.     tst    parity            ; /BBS/ parity already set up?
  198.     bne    70$            ; /39/ yes
  199.     mov    #par$space,parity    ; /39/ need 8-bit quoting also
  200. 70$:    mov    #60.    ,senlen        ; /62/ console port won't XOFF fast
  201.     movb    #60.    ,senpar+p.spsiz    ; /62/ enough, do receive size too
  202.     clr    dolong            ; need this too..
  203.     clr    reclng            ; and this just to be safe
  204. 80$:    clr    r0
  205.     return
  206.  
  207.  
  208.     .sbttl    Drop the comm handler
  209.  
  210. xl.dump::tst    r50dev            ; /BBS/ newer better way to bomb it
  211.     beq    30$            ; no device to hose
  212.     .spfun    #rtwork,#xc.control,#dtrdrv,#0,#0,#1 ; /62/ drop DTR and RTS
  213.     calls    suspend    ,<#0,settle>    ; let any external hardware settle..
  214.     mov    #offdrv    ,r1        ; preset for RT-11
  215.     tst    tsxcl            ; TSX and CL?
  216.     beq    10$            ; no
  217.     cmp    tsxver    ,#600.        ; ya, but is it V6.00 or above?
  218.     blo    10$            ; no
  219.     mov    #clhose    ,r1        ; ya
  220. 10$:    .spfun    #rtwork,#xc.control,r1,#0,#0,#1 ; /62/ disable interrupts
  221.     tst    xl.lock            ; /62/ can monitor .close the handler?
  222.     bne    20$            ; /62/ no
  223.     cmp    rt11ver    ,#5        ; /62/ is this RT-11 V5 or above?
  224.     blt    20$            ; /62/ no, V4 can't abort I/O..
  225. ; /62/    .abtio    #lun.xk            ; /62/ ya, dump any lingering data
  226.     MOV    #lun.xk+<11.*^o400>,R0    ; /62/ expanded for assy under V4
  227.     EMT    ^o374            ; /62/ even though V4 can't run it
  228.     .close    #lun.xk            ; /62/ close its chan
  229. ; /62/    .abtio    #xc.control        ; /62/ hose control chan
  230.     MOV    #xc.control+<11.*^o400>,R0 ; /62/ expanded for assy under V4
  231.     EMT    ^o374            ; /62/ even though V4 can't run it
  232.     .close    #xc.control        ; /62/ close it
  233.     clr    xcdone            ; /62/ handler read no longer pending
  234. 20$:    tst    tsxsav            ; running under TSX?
  235.     beq    30$            ; no
  236.     mov    r50dev    ,cl.r50        ; ya, copy name to
  237.     call    deallo            ; deallocate the device
  238. 30$:    return
  239.  
  240.  
  241.     .sbttl    Drop a CL unit
  242.  
  243. cl.dump::save    <r0>            ; /BBS/ added this..
  244.     mov    r50dev    ,cl.r50        ; copy for emt
  245.     mov    r50dev    ,r0        ; copy to extract CL unit number
  246.     sub    #^rCL    ,r0        ; got it
  247.     beq    10$            ; using "space' for "0" in unit number
  248.     sub    #36    ,r0        ; using existing unit number
  249. 10$:    mov    r0    ,cl.unit    ; save it
  250.     clr    cl.line            ; SET CLn LIN=0
  251.     tst    z.atch            ; did this pgm attach this line?
  252.     beq    20$            ; no
  253.     mov    #attcl    ,r0        ; try to
  254.     emt    375            ; deattach it
  255.     clr    z.atch            ; nothing is now attached..
  256. 20$:    call    deallo            ; DEALLOCATE even if not ALLOC'd by us
  257.     unsave    <r0>            ; restore caller's error
  258.     return
  259.  
  260.  
  261.     .sbttl    Deallocate the TSX+ comm handler
  262.  
  263. deallo:    movb    #1    ,d.allo        ; set to drop it
  264.     mov    #d.allo    ,r0        ; try to
  265.     emt    375            ; deallocate the device
  266.     return
  267.  
  268.  
  269.     .sbttl    Init the link device    ; /63/ merged opentt and ttyini
  270.  
  271. opentt::clr    r0            ; /BBS/ preset to no error
  272.     tst    linksts            ; already open?
  273.     bne    20$            ; yes, ignore it then
  274.     mov    #L999$    ,r0        ; load dispatch addresses pointer
  275.     calls    dispat    ,<#0>        ; /63/ clear a flag and call the init
  276.     tst    r0            ; did it work?
  277.     beq    10$            ; /63/ ya
  278.     direrr    r0            ; no, handle error here, right away..
  279.     call    incsts            ; /62/ flag there was an error
  280.     br    20$            ; /63/
  281. 10$:    mov    sp    ,linksts    ; ya, flag it as being open
  282. 20$:    return
  283.  
  284.     .save
  285.     .psect    $pdata
  286. L999$:    .word    x.ttyini,t.ttyini
  287.     .restore
  288.  
  289.  
  290.     .sbttl    Close the link device    ; /63/ moved this here..
  291.  
  292. clostt::save    <r0>
  293.     call    ttyfin            ; close the link
  294.     call    ttyrst            ; /62/ reset the terminal
  295.     clr    linksts            ; flag link is now closed
  296.     unsave    <r0>
  297.     return
  298.  
  299.  
  300.     .sbttl    Reset terminal after using it for file transfer or CONNECT
  301.  
  302. ttyrst::mov    ttparm    ,@#jsw        ; restore jsw
  303.     .rctrlo                ; force read of new jsw
  304.     tst    tsxsave            ; running under TSX?
  305.     bne    30$            ; ya, skip to TSX reset
  306.     .gval    #rtwork,#$tcfig        ; restore terminal configuration
  307.     cmp    rt11ver    ,#5        ; /62/ is this RT-11 V5 or above?
  308.     bge    10$            ; /62/ ya, .poke will work
  309.     tst    montyp            ; /62/ if XM and V4..
  310.     bgt    20$            ; /62/ ..tough luck
  311.     mov    ttpar2    ,(r0)        ; /62/ otherwise, this is it
  312.     br    20$
  313. 10$:    mov    r0    ,r1        ; copy as poke eats r0
  314. ; /62/    .poke    #rtwork,r1,ttpar2    ; stuff back into memory
  315.     MOV    #rtwork    ,R0        ; /62/ expanded to assemble under V4
  316.     MOV    #28.*^o400+3,@R0    ; /62/ even though V4 can't run it
  317.     MOV    r1    ,2.(R0)        ; /62/
  318.     MOV    ttpar2    ,4.(R0)        ; /62/
  319.     EMT    ^o375            ; /62/
  320. 20$:    .rctrlo                ; force update of $tcfig
  321.     br    60$            ; skip TSX stuff
  322.  
  323. 30$:    save    <r2,r1>
  324.     mov    #1    ,r1        ; offset to second byte
  325.     mov    #11.    ,r2        ; 11 of 'em to do
  326. 40$:    movb    #'P    ,limits(r1)    ; load deactivation prefix
  327.     add    #3    ,r1        ; bump to next string
  328.     sob    r2    ,40$        ; next one
  329.     wrtall    #limits            ; reset TSX activation chars
  330.  
  331.     tstb    vl$chr            ; if 0 windowing was left on
  332.     beq    50$            ; so no need to resume it here
  333.     mov    #w$resume,r0        ; resume TSX
  334.     emt    375            ; window processing
  335. 50$:    unsave    <r1,r2>
  336.  
  337. 60$:    clr    r0            ; success
  338.     return
  339.  
  340.  
  341.     .sbttl    I/O dispatch
  342.  
  343.     ENTRY    BINREAD            ; binary read, send XON if no char
  344.     ENTRY    BINWRITE        ; binary write
  345.     ENTRY    CANTYP            ; (try to) cancel type_ahead
  346.     ENTRY    HOSE            ; 100% hose the link device
  347.     ENTRY    DCDTST            ; /62/ check DCD during transfers
  348.     ENTRY    INQCD            ; is DCD there?
  349.     ENTRY    INQDTR            ; is DTR there? (CL/KM handlers only)
  350.     ENTRY    SETSPD            ; set speed
  351.     ENTRY    TTSPEED            ; get speed (CL/KM handlers only)
  352.     ENTRY    TTXON            ; clear local XOFF, send a ^Q
  353.     ENTRY    TTYFIN            ; finished with the link device
  354.     ENTRY    TTYHAN            ; hang up
  355.     ENTRY    XBINREAD        ; no-XON-if-no-char binary read
  356.  
  357. dispatch:tst    tt$io            ; /62/ talking to TT?
  358.     bne    tt.io            ; ya..
  359.     jmp    @(r0)            ; /62/ no, it's a handler
  360.  
  361. tt.io:    tst    (r0)+            ; bump to TT I/O address
  362.     jmp    @(r0)            ; /62/ and call it
  363.  
  364.  
  365.     .sbttl    Shared read for XL .close problem
  366.  
  367.     SRDDRV    =    203        ; special read, wc is max # of bytes
  368.                     ; to read, always returns at least one
  369.                     ; byte, up to max if data are there
  370.     STATE    =    2        ; <> flags scheduler to run the task
  371.  
  372. readxk::tst    xcdone            ; is there a read already queued?
  373.     bne    10$            ; /62/ ya, can't queue more than one
  374.     mov    sp    ,xcdone        ; /62/ no, but there is now..
  375.     mov    #xkbuff    ,xkpoint    ; reset buffer pointer now
  376.     clrb    xkbuff            ; and init it
  377.     .spfun    #xkrd1,#lun.xk,#srddrv,#xkbuff,#xksize,#1,#20$ ; read in data
  378. 10$:    return
  379.  
  380. 20$:    clr    xcdone            ; /62/ flag a read completion
  381.     tst    xk.con            ; here from CONNECT?
  382.     beq    30$            ; no
  383.     mov    sp    ,xkhead+state    ; /63/ ya, notify the scheduler
  384.     tst    suspnd            ; need to resume?
  385.     beq    30$            ; no
  386.     dec    suspnd            ; ya, make sure no one else does this
  387.     .rsum                ; resume mainline so xkproc can run
  388. 30$:    return
  389.  
  390.  
  391.     .sbttl    Get input from a printing terminal
  392.  
  393. kbread::save    <r2>            ; /BBS/ rewritten a bit..
  394.     bic    #<10000!100>,@#jsw    ; ditch single char input and nowait
  395.     .rctrlo                ; force read of new jsw
  396.     tst    tsxsav            ; running under TSX?
  397.     beq    10$            ; nope..
  398.     wrtall    #m.tsxr            ; if TSX, ensure LF echo is on
  399. 10$:    mov    @r5    ,r1        ; a buffer to put the chars
  400.     clrb    @r1            ; init buffer
  401.     mov    #ln$max    ,r2        ; size of the buffer here
  402.  
  403. ; /BBS/ NOTE: under TSX what actually happens here is the line is stored in
  404. ;    an internal to TSX buffer until an "activation" character is received,
  405. ;    in this case the return at the end of the line, then the whole thing
  406. ;    is dumped into the program via .ttyin in one fell swoop..  this limits
  407. ;    what might be done in advance of the return being typed, such as not
  408. ;    echoing chars destined to be truncated - however on the whole it is
  409. ;    all handled reasonably well by TSX as regards rubouts, retype, etc..
  410.  
  411. 20$:    .ttyin                ; read a character please
  412.     cmpb    r0    ,#'Z&37        ; ^Z ?
  413.     bne    30$            ; no
  414.     mov    #cmd$ex    ,r0        ; ya, distinguish it from ^C ..
  415.     br    60$            ; bail out
  416. 30$:    cmpb    r0    ,#'C&37        ; ^C ?
  417.     bne    40$            ; no
  418.     mov    #cmd$ab    ,r0        ; ya, say it's an abort
  419.     br    60$            ; bail out
  420. 40$:    cmpb    r0    ,#cr        ; carriage return?
  421.     beq    50$            ; ya, done
  422.     tst    r2            ; any room left in buffer?
  423.     ble    20$            ; nope, truncate the rest
  424.     movb    r0    ,(r1)+        ; return what we just got
  425.     dec    r2            ; decrement what's left counter
  426.     br    20$            ; and back for more
  427.  
  428. 50$:    emt    340            ; .ttinr to eat the LF after CR
  429.     clrb    @r1            ; null terminate the buffer
  430.     sub    @r5    ,r1        ; the length
  431.     clr    r0            ; no error..
  432. 60$:    unsave    <r2>
  433.     bis    #<10000!100>,@#jsw    ; restore single char & nowait input
  434.     save    <r0>            ; /62/ save error code
  435.     .rctrlo                ; force read of new jsw
  436.     unsave    <r0>            ; /62/ restore error code
  437.     tst    tsxsav            ; running under TSX?
  438.     beq    70$            ; no
  439.     wrtall    #m.tsxs            ; if TSX, kill LF echo
  440. 70$:    return
  441.  
  442.  
  443.     .sbttl    Get one char from TT
  444.  
  445. read1c::.ttinr                ; try to get a char
  446.     bcc    10$            ; got one
  447.     .twait    #rtwork,#tsxwai        ; nothing there, wait one tick
  448.     br    read1c            ; and try again
  449. 10$:    return
  450.  
  451.  
  452.     .sbttl    TT output in various ways ; /BBS/ heavily hacked
  453.  
  454. writ1ch::save    <r1>
  455.     .ttyou                ; dump char
  456.     mov    xprint    ,r1        ; send to LP?
  457.     beq    10$            ; no
  458.     save    <r0>
  459.     call    putcr0            ; channel is passed in r1
  460.     unsave    <r0>            ; ignore any error..
  461. 10$:    unsave    <r1>
  462.     return
  463.  
  464. wrtall::save    <r2,r1,r0>
  465.     mov    10(sp)    ,r2        ; get string address
  466. loop:    tstb    (r2)            ; done?
  467.     beq    10$            ; yes, exit
  468.     clr    r0            ; init reg to avoid sign extension
  469.     bisb    (r2)+    ,r0        ; the character to write out
  470.     .ttyou                ; no, dump a byte
  471.     mov    xprint    ,r1        ; dump to LP?
  472.     beq    loop            ; no, continue
  473.     call    putcr0            ; channel is passed in r1
  474.     br    loop            ; continue
  475. 10$:    unsave    <r0,r1,r2>
  476.     mov    (sp)+    ,(sp)        ; move return address up
  477.     return
  478.  
  479. l$nolf::save    <r1,r0>
  480.     tst    vttype            ; unless it's a hard copy term
  481.     beq    L10$            ; it is
  482.     .ttyou    #cr            ; it isn't, just a CR, no line feed..
  483.     br    L20$
  484.  
  485. l$pcrlf::save    <r1,r0>
  486. L10$:    .ttyou    #cr
  487.     .ttyou    #lf
  488. L20$:    mov    xprint    ,r1        ; dump to LP?
  489.     beq    L30$            ; no
  490.     mov    #cr    ,r0        ; ya, add in a return
  491.     call    putcr0
  492.     mov    #lf    ,r0        ; and LP always gets a line feed
  493.     call    putcr0
  494. L30$:    unsave    <r0,r1>
  495.     return
  496.  
  497.     .dsabl    lsb
  498.  
  499.  
  500.     .sbttl    Clear the console, hose all pending terminal input
  501.  
  502. clrcns::call    chkabo            ; try to get a byte of input
  503.     tst    r0            ; get it?
  504.     bne    clrcns            ; ya, loop until nothing is left
  505.     return
  506.  
  507.  
  508.     .sbttl    Check for abort, see if anything typed at the terminal
  509.  
  510. chkabo::.ttinr                ; nowait TT input
  511.     bcc    10$            ; got something
  512.     clr    r0            ; got nothing
  513. 10$:    return
  514.  
  515.     .end
  516.