home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pub / rt11 / krtini.mac < prev    next >
Text File  |  2020-01-01  |  31KB  |  877 lines

  1.     .title    KRTINI    Initialization and rarely used routines
  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. ;    dump FILLOG, as PRINTM now does this
  9. ;    provide for logfile errors
  10. ;    add current_block_pointer/size_of file to ^A stats display
  11. ;
  12. ;    check packet length in dskdmp, don't trap to 4 writing past end
  13. ;    of buffer due to line noise and/or modems retraining
  14. ;
  15. ;    major cleanup and maintenance update
  16.  
  17. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  18. ;
  19. ;    prompt set to KRT
  20. ;
  21. ;    call to an .INI file now tries INI, KRT then DK and finally
  22. ;    SY.  take file echo is disabled if krt.ini is found, then
  23. ;    enabled when the init file is closed (in readcmd, in krtcmd)
  24. ;    name of init file (if found) is displayed while reading same..
  25. ;
  26. ;    recdsp table fixed to call recvt1 (instead of senvt1 .. ) for
  27. ;    terminals >VT100
  28. ;
  29. ;    added warning message when 8-bit quoting is first forced on and
  30. ;    init stuff in fixchk so the need for 8-bit quoting is tested on
  31. ;    each xfr, thus one need not exit/restart Kermit to turn it off
  32. ;
  33. ;    packet length display in log files now accommodates four digit
  34. ;    numbers, as the max. packet is now 1024. bytes
  35. ;
  36. ;    kill normal packet stats display when logging to TT
  37. ;    reset parity found while set NONE warning before each transaction
  38. ;    fixed warning messages for unsupported/disabled long packets
  39. ;    dkname used to home, here it's init'd to physical DK at start-up
  40.  
  41. ;    03-Jul-84  09:34:32  Brian Nelson
  42. ;
  43. ;    Copyright 1984 Change Software, Inc.
  44. ;
  45. ;    Remove Kermit init code and routines like SPAR and RPAR that
  46. ;    are only called once per file transfer.  Placed into overlay
  47. ;    with KRTATR.  This was done to reduce the task size a bit.
  48.  
  49.  
  50.     .include "IN:KRTMAC.MAC"
  51.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  52.  
  53.     .mcall    .GTIM            ; /62/
  54.  
  55.  
  56.     .macro    $chkb    val ,reg ,?a    ; used to check received parameters
  57.     tstb    @reg            ; to be sure something is there
  58.     bne    a            ; if no default supplied
  59.     movb    val    ,@reg        ; stuff one in
  60. a:    inc    reg            ; next time, do next one
  61.     .endm    $chkb
  62.  
  63.  
  64.     .sbttl    Misc defaults        ; /63/ moved these here from KRTPAK
  65.  
  66.     DEFDLY    =      6.        ; secs delay before SENDing a file
  67.     IN$TRY    =      5.        ; /BBS/ number of times to retry init
  68.     MX$TRY    =     16.        ; number of times to retry packet
  69.     MYCHKT    =     '1        ; normal checksumming
  70.     MYEOL    =     cr        ; end-of-line
  71.     MYQUOTE    =     '#        ; control char quoting prefix char
  72.     MYPAD    =      0        ; no padding
  73.     MYPCHAR    =      0        ; thus no pad character
  74.     MYQBIN    =     '&        ; 8-bit quoting prefix char
  75.     MYREPT    =     tilde        ; tilde for repeat quoting
  76.     MYRTMO    =     10.        ; /62/ RECEIVE default time-out
  77.     MYSTMO    =     13.        ; /62/ SEND default time-out
  78.  
  79.  
  80.     .sbttl    Local data        ; /63/ consolidated here..
  81.  
  82.     .psect    $pdata
  83. ini.00:    .word    ini.01    ,ini.02    ,ini.03    ,ini.04    ,0 ; /63/ init file name list
  84. ini.01:    .asciz    "INI:KRT.INI"        ; /BBS/ try this logical first
  85. ini.02:    .asciz    "KRT:KRT.INI"        ; /BBS/ then this one, etc..
  86. ini.03:    .asciz    "DK:KRT.INI"
  87. ini.04:    .asciz    "SY:KRT.INI"
  88. ini.05:    .asciz    "Paknum"        ; /BBS/ PAK and LEN flipped
  89. ini.06:    .asciz    "Type"
  90. ini.07:    .asciz    "Length"
  91. ini.08:    .asciz    "    "            ; /62/ four blanks to indent
  92. ini.09:    .asciz    " Bytes "
  93. ini.10:    .asciz    ", open file: "        ; /62/
  94. ini.11:    .asciz    "sent"            ; /62/
  95. ini.12:    .asciz    "rec'd"            ; /62/
  96. ini.13:    .asciz    ", cur/max blk: "    ; /62/
  97. ini.14:    .asciz    "Reading "        ; /BBS/ display this while waiting..
  98. ini.15:    .asciz    " .."            ; /BBS/ ..for the file to load
  99. prefix:    .asciz    "The other Kermit "
  100. cando:    .asciz    "supports long packets, which are disabled locally"
  101. lmsg:    .asciz    "doesn't support or has disabled long packets"
  102. warn8m:    .asciz    "Eight-bit quoting forced on"
  103.  
  104. $delim:    .asciz    "/"            ; /63/ display format stuff
  105. $sendh:    .ascii    <cr><esc>"[2K"
  106.     .asciz    "Packets sent:            Naks:            Time-outs: "
  107. $rech:    .ascii    <cr><esc>"[2K"
  108.     .asciz    "Packets received:            Naks:            Time-outs: "
  109. $pos0:    .asciz    <cr><esc>"[15C"        ; /BBS/ cursor to column 15.
  110. $pos1:    .asciz    <cr><esc>"[19C"        ; /BBS/ col 19.
  111. npos:    .asciz    <cr><esc>"[36C"        ; /BBS/ col 36.
  112. npox:    .asciz    <cr><esc>"[32C"        ; /BBS/ col 32.
  113. dpos:    .asciz    <cr><esc>"[58C"        ; /BBS/ col 58.
  114. dpox:    .asciz    <cr><esc>"[54C"        ; /BBS/ col 54.
  115.     .even
  116.  
  117.  
  118.     .psect    $code
  119.     .sbttl    Initialize ourselves    ; /62/ rearranged for clarity..
  120.  
  121. kerini::mov    #rwdata    ,r0        ; first of all, clear all read/write
  122.     mov    #rwsize/2,r1        ; data out please
  123. 10$:    clr    (r0)+            ; for i := 1 to rwdata_size
  124.     sob    r1    ,10$        ;  do data[i] := 0
  125.  
  126.     mov    sp    ,doauto        ; default to checking file attributes
  127.     mov    #<at.all!at.on>    ,doattr    ; /63/ and doing all file attributes
  128.     mov    sp    ,setrpt        ; assume we will do repeat counts
  129.     mov    sp    ,dolong        ; /62/ we want long packets if doable
  130.     mov    #myrtmo    ,rectim        ; /62/ default receive time-out
  131.     mov    #mystmo    ,sentim        ; /62/ default send time-out
  132.     call    rparini            ; other Kermit's default sinit params
  133.     call    sparini            ; initialize my sinit parameters
  134.  
  135.     mov    #1    ,blip        ; assume logging all packets to TT
  136.     call    xinit            ; /42/ moved call forward, init memory
  137.  
  138.     mov    #soh    ,recsop        ; assume ^A please, for receive SOH
  139.     mov    #soh    ,sensop        ; ditto for sending..
  140.     mov    #defchk    ,chktyp        ; set the default checksum type
  141.     mov    #1    ,chksiz        ; and its size (length in bytes)
  142.     mov    #defchk    ,setchkt    ; /62/ init the SET BLO type too..
  143.     mov    #in$try    ,initry        ; /BBS/ init packet retry limit
  144.     mov    #mx$try    ,maxtry        ; all other packets retry limit
  145.     mov    sp    ,dowild        ; /63/ default to implicit wildcards
  146.     mov    sp    ,incfile    ; /BBS/ discard incomplete files
  147.     mov    #60.    ,serwait    ; /41/ SET SERVER [NO]WAIT default
  148.     mov    #defdly    ,sendly        ; init the delay for send command
  149.  
  150.     mov    #ctlflgs,r0        ; /63/ ctrl char processing list top
  151.     mov    #<1.+32.+1.+32.>,r1    ; /63/ list is this many bytes long
  152. 20$:    incb    (r0)+            ; /63/ init each one as must quote
  153.     sob    r1    ,20$        ; /63/
  154.  
  155.     mov    sp    ,infomsg    ; /BBS/ default to verbosity
  156.     mov    sp    ,qu.ini        ; /BBS/ save copy of infomsg for reset
  157.     mov    sp    ,rtvol        ; /BBS/ assume volume header checks
  158.     mov    #con$esc,conesc        ; /62/ default CONNECT escape char
  159.  
  160.     clrb    ininam            ; /62/ no init file found yet
  161.     mov    #ini.00    ,r3        ; try to open an init file somewhere
  162. 30$:    tst    @r3            ; any more to try?
  163.     beq    40$            ; no
  164.     calls    open    ,<(r3)+,#lun.ta,#text> ; ya, see if it's there
  165.     tst    r0            ; did the open work?
  166.     bne    30$            ; no, just ignore it
  167.     mov    #lun.ta    ,cmdlun        ; yes, setup for reading from init
  168.     mov    sp    ,sy.ini        ; flag an init file is now open
  169.     clr    infomsg            ; /BBS/ don't echo init file
  170.     strcpy    #indnam    ,-(r3)        ; /62/ stash a copy of file name
  171.     strcpy    #ininam    ,(r3)        ; /62/ and another for show file
  172.     wrtall    #ini.14            ; /63/ "Reading "
  173.     wrtall    (r3)            ; /BBS/ name of init file
  174.     wrtall    #ini.15            ; /63/ tag with " .."
  175.     call    l$nolf            ; /BBS/ just a CR unless TT is NOSCOPE
  176. 40$:    return
  177.  
  178.  
  179.     .sbttl    Setup defaults for our SINIT parameters
  180.  
  181. ; NOTE:    the SENPAR and CONPAR buffers are zeroed at the top of KERINI thus
  182. ;    unused bytes here and for RPARINI are assumed to be already cleared
  183.  
  184. sparini:mov    #senpar    ,r1        ; where to put them
  185.     movb    #maxpak    ,(r1)+        ; maximum packet size
  186.     mov    #maxpak    ,senlen        ; /62/ init SET SEND PAC limit
  187.     movb    #mystmo    ,(r1)+        ; /62/ send time-out default
  188.     movb    #mypad    ,(r1)+        ; how much padding
  189.     movb    #mypchar,(r1)+        ; whatever I use for padding
  190.     movb    #myeol    ,(r1)+        ; EOL char (not used by this program)
  191.     movb    #myquote,(r1)+        ; ctrl (<40) char quoting prefix char
  192.     movb    #'Y&137    ,(r1)+        ; do 8-bit quoting if need be..
  193.     movb    #mychkt    ,(r1)+        ; /BBS/ checksum type
  194.  
  195.     movb    #space    ,(r1)        ; assume no repeat processing
  196.     tst    setrpt            ; really do repeat encoding?
  197.     beq    10$            ; no
  198.     movb    #myrept    ,(r1)        ; ya, use this char to prefix it
  199.  
  200. 10$:    mov    #11    ,sparsz        ; /62/ spar packet size up to now..
  201.     mov    doattr    ,r0        ; /62/ if both attributes and
  202.     bis    dolong    ,r0        ; /62/ long-packets are not enabled
  203.     beq    30$            ; /62/ then this is all that's needed
  204.     add    #4    ,sparsz        ; /62/ more to come, make room for it
  205.  
  206.     inc    r1            ; /62/ bump pointer to capas byte
  207.     tst    doattr            ; /42/ are attributes enabled?
  208.     beq    20$            ; /62/ no
  209.     bisb    #capa.a    ,(r1)        ; /62/ ya, let the other Kermit know
  210.  
  211. 20$:    tst    dolong            ; /42/ long packets enabled?
  212.     beq    30$            ; /62/ no, done
  213.     bisb    #capa.l    ,(r1)+        ; /62/ set long packets support bit
  214.     inc    r1            ; /62/ no window size to send over
  215.     mov    #maxlng    ,r3        ; /62/ use long-packet max length
  216.     clr    r2            ; /42/ break the size
  217.     div    #95.    ,r2        ; /42/ into two bytes
  218.     movb    r2    ,(r1)+        ; /42/ p.mxl1 = buffer_size / 95.
  219.     movb    r3    ,(r1)        ; /62/ p.mxl2 = buffer_size mod 95.
  220.     mov    #maxlng    ,senlen        ; /62/ make SET SEND PAC the max too..
  221. 30$:    return
  222.  
  223.  
  224.     .sbttl    Setup defaults for other Kermit's SINIT parameters
  225.  
  226. rparini:mov    #conpar    ,r1        ; where to put them
  227.     movb    #maxpak    ,(r1)+        ;  0 maximum packet size
  228.     movb    #myrtmo    ,(r1)+        ;  1 /62/ default to receive time-out
  229.     movb    #mypad    ,(r1)+        ;  2 how much padding
  230.     movb    #mypchar,(r1)+        ;  3 pad char
  231.     movb    #myeol    ,(r1)+        ;  4 EOL char (not used by this pgm)
  232.     movb    #myquote,(r1)+        ;  5 control (<40) char quoting char
  233.     movb    #'Y&137    ,(r1)+        ;  6 do 8-bit quoting if asked
  234.     movb    #mychkt    ,(r1)+        ;  7 checksum type
  235.     movb    #space    ,(r1)        ; 10 assume no repeat count processing
  236.     return
  237.  
  238.  
  239.     .sbttl    Read other Kermit's SINIT parameters
  240.  
  241. ;    input:     (r5)    = address of packet
  242. ;        2(r5)    = packet length
  243. ;    output:    CONPAR[0..20] list of parameters
  244.  
  245. rpar::    save    <r0,r1,r2,r3,r4>
  246.     mov    #conpar    ,r2        ; /62/ pointer to conpar buffer
  247.     mov    #20    ,r0        ; /62/ its length
  248. 10$:    clrb    (r2)+            ; /62/ clear out any old data
  249.     sob    r0    ,10$        ; /62/ next please
  250.     mov    @r5    ,r1        ; incoming packet address
  251.     mov    2(r5)    ,r0        ; and its length
  252.     mov    #conpar    ,r2        ; save other Kermit's params here
  253.     clr    r3            ; /42/ init long-packet length reg
  254.     movb    #'N&137    ,p.qbin(r2)    ; /58/ assume worst for 8-bit quoting
  255.  
  256.     unchar    (r1)+    ,(r2)+        ; conpar.spsiz
  257.     dec    r0            ; if no more data
  258.     beq    20$            ; exit
  259.     unchar    (r1)+    ,(r2)+        ; conpar.time
  260.     dec    r0
  261.     beq    20$
  262.     unchar    (r1)+    ,(r2)+        ; conpar.npad
  263.     dec    r0
  264.     beq    20$
  265.     ctl    (r1)+    ,(r2)+        ; conpar.padc
  266.     dec    r0
  267.     beq    20$
  268.     unchar    (r1)+    ,(r2)+        ; conpar.eol
  269.     dec    r0
  270.     beq    20$
  271.     movb    (r1)+    ,(r2)+        ; conpar.qctl
  272.     dec    r0
  273.     beq    20$
  274.     movb    (r1)+    ,(r2)+        ; conpar.qbin
  275.     dec    r0
  276.     beq    20$
  277.     movb    (r1)+    ,(r2)+        ; conpar.chkt
  278.     dec    r0
  279.     beq    20$
  280.     movb    (r1)+    ,(r2)+        ; conpar.rept
  281.     dec    r0
  282.     beq    20$
  283.     unchar    (r1)+    ,(r2)+        ; /62/ conpar.capas
  284.     dec    r0
  285.     beq    20$
  286.     unchar    (r1)+    ,(r2)        ; /62/ conpar.winds
  287.     movb    (r2)+    ,senwin        ; /62/ save a copy here
  288.     dec    r0
  289.     beq    20$
  290.     unchar    (r1)+    ,r3        ; /42/ conpar.mxl1 (hi word)
  291.     bicb    #200    ,r3        ; /42/ ensure high bit off
  292.     movb    r3    ,(r2)+        ; /62/ copy to the conpar vector
  293.     mul    #95.    ,r3        ; /42/ and save it
  294.     dec    r0            ; /42/ get the next part please
  295.     beq    20$            ; /42/ nothing is left
  296.     unchar    (r1)+    ,r4        ; /42/ conpar.mxl2 (lo word)
  297.     bicb    #200    ,r4        ; /42/ ensure high bit off
  298.     movb    r4    ,(r2)+        ; /62/ copy to the conpar vector
  299.     add    r4    ,r3        ; /42/ add into long-packet length
  300. 20$:    clrb    (r2)            ; /62/ null terminate the conpar data
  301.  
  302.     mov    #conpar    ,r2        ; now clear parity please
  303.     mov    #15    ,r0        ; 13. of 'em to do
  304. 30$:    bicb    #200    ,(r2)+        ; simple
  305.     sob    r0    ,30$        ; next one
  306.  
  307.     mov    #conpar    ,r0        ; /37/ be defensive about the other
  308.     $chkb    #maxpak    ,r0        ; /37/ guy's parameters please..
  309.     inc    r0            ; /62/ allow time-out of zero value
  310.     $chkb    #mypad    ,r0
  311.     $chkb    #mypchar,r0
  312.     $chkb    #myeol    ,r0
  313.     $chkb    #myquote,r0
  314.     $chkb    #'Y    ,r0
  315.     $chkb    #defchk    ,r0        ; /62/ always default to type 1
  316.     $chkb    #space    ,r0
  317.  
  318.     mov    #senpar    ,r0        ; /43/ check to see if we need to
  319.     mov    #conpar    ,r1        ; override any of the sinit stuff
  320.  
  321.     movb    p.npad(r0),r2        ; /57/ check for SET SEND PADDING
  322.     beq    40$            ; /62/ not set, use rec'd values
  323.     movb    r2    ,p.npad(r1)    ; /57/ set, use that value along
  324.     movb    p.padc(r0),p.padc(r1)    ; /62/ with the local pad char
  325.  
  326. 40$:    movb    p.chkt(r1),senpar+p.chkt ; setup for type of checksum used
  327.  
  328.     mov    snd8bit    ,do8bit        ; in case spar decided WE need 8-bit
  329.     clr    snd8bit            ; prefixing to send a file over, but
  330.     cmpb    p.qbin(r1),#'Y&137    ; can the other end handle it?
  331.     bne    50$            ; maybe.. go find out
  332.     movb    #myqbin    ,ebquot        ; yes, use the default "&" prefix and
  333.     br    70$            ; do8bit as possibly set per the above
  334. 50$:    cmpb    p.qbin(r1),#'N&137    ; other end require 8-bit quoting?
  335.     bne    60$            ; yes, using its own prefix char
  336.     clr    do8bit            ; no, it doesn't want it
  337.     br    70$
  338. 60$:    mov    sp    ,do8bit        ; set flag for doing 8-bit prefixing
  339.     movb    p.qbin(r1),ebquot    ; set the quote character please
  340.     call    warn8            ; /BBS/ warn 8-bit prefixing forced on
  341.  
  342. 70$:    clr    senlng            ; /42/ clear write long buffer size
  343.     tst    dolong            ; /42/ really want long-packets today?
  344.     bne    80$            ; /42/ yes
  345.     bitb    #capa.l    ,p.capas(r1)    ; /BBS/ no, but can other end do them?
  346.     beq    120$            ; /BBS/ no
  347.     tst    msgtim            ; /BBS/ ya, is this a new transaction?
  348.     bne    120$            ; /62/ no, continue..
  349.     calls    printm    ,<#2,#prefix,#cando> ; /BBS/ ya, say it is possible..
  350.     br    110$            ; /62/ go set msg given flag, continue
  351.  
  352. 80$:    bitb    #capa.l    ,p.capas(r1)    ; /42/ can other end do long packets?
  353.     beq    100$            ; /42/ no
  354.     mov    r3    ,senlng        ; /42/ yes, load its passed pak length
  355.     bne    90$            ; /42/ something was there
  356.     mov    #maxpak    ,senlng        ; /BBS/ not there, use normal packets
  357. 90$:    cmp    senlng    ,#maxlng    ; /42/ is this bigger than our buffer?
  358.     ble    120$            ; /42/ no
  359.     mov    #maxlng    ,senlng        ; /42/ yes, please fix it then
  360.     br    120$            ; /43/ and continue
  361.  
  362. 100$:    cmp    reclng    ,#maxpak    ; /BBS/ is SET REC PAC > 94. here?
  363.     ble    120$            ; /BBS/ no
  364.     tst    msgtim            ; /43/ ya, say long-packets possible
  365.     bne    120$            ; /43/ but please, NOT for every file
  366.     calls    printm    ,<#2,#prefix,#lmsg> ; /BBS/ print a warning message
  367. 110$:    mov    sp    ,msgtim        ; /43/ flag we printed a warning
  368. 120$:    unsave    <r4,r3,r2,r1,r0>
  369.     return
  370.  
  371. warn8:    tst    warn8done        ; /BBS/ done this yet?
  372.     bne    10$            ; /BBS/ ya
  373.     calls    printm    ,<#1,#warn8msg>    ; /BBS/ warn 8-bit prefixing forced
  374.     mov    sp    ,warn8done    ; /BBS/ flag warning has been given
  375. 10$:    return
  376.  
  377.  
  378.     .sbttl    Fill a buffer with my initialization parameters
  379.  
  380. ;    input:    (r5)    = address of buffer to fill
  381.  
  382. spar::    save    <r0,r1,r2>
  383.     mov    @r5    ,r2        ; point to the destination
  384.     mov    #senpar    ,r1        ; and our local parameters
  385.  
  386.     tochar    (r1)+    ,(r2)+        ; senpar.spsiz
  387.     tochar    (r1)+    ,(r2)+        ; senpar.time
  388.     tochar    (r1)+    ,(r2)+        ; senpar.npad
  389.     ctl    (r1)+    ,(r2)+        ; senpar.padc
  390.     movb    (r1)    ,conpar+p.eol    ; /62/ in case SET and SENDing first..
  391.     tochar    (r1)+    ,(r2)+        ; senpar.eol
  392.     movb    (r1)+    ,(r2)+        ; senpar.qctl
  393.  
  394.     clr    snd8bit            ; assume we don't need 8-bit quoting
  395.     movb    #'Y&137    ,(r1)        ; /62/ but "if we must, ok"
  396.     movb    conpar+p.qbin,r0    ; get other Kermit's quote character
  397.     cmpb    r0    ,#'N&137    ; can it do 8-bit quoting?
  398.     bne    10$            ; possibly..
  399.     clr    do8bit            ; no, don't ever try to do it, but
  400.     br    30$            ; stuff the "Y" in our params anyway
  401. 10$:    cmpb    r0    ,#'Y&137    ; does the other end require quoting?
  402.     bne    20$            ; yes, set the mode up then
  403.     tst    parity            ; /BBS/ no, but do we need to do it?
  404.     beq    30$            ; no, don't waste the overhead
  405.     movb    #myqbin    ,r0        ; yes, force this to the other side
  406. 20$:    mov    sp    ,snd8bit    ; flag so rpar knows what's up here
  407.     mov    sp    ,do8bit        ; force 8-bit prefixing then
  408.     movb    r0    ,ebquot        ; and set ours to the same please
  409.     movb    r0    ,(r1)        ; /62/ update senpar data
  410.     call    warn8            ; /BBS/ warn 8-bit prefixing forced
  411.  
  412. 30$:    movb    (r1)+    ,(r2)+        ; senpar.qbin
  413.     movb    (r1)+    ,(r2)+        ; senpar.chkt
  414.     movb    (r1)+    ,(r2)+        ; senpar.rept
  415.  
  416.     mov    #11    ,sparsz        ; /62/ spar packet size up to now..
  417.     mov    doattr    ,r0        ; /62/ if both attributes and
  418.     bis    dolong    ,r0        ; /62/ long-packets are not enabled
  419.     beq    60$            ; /62/ then this is all that's needed
  420.     add    #4    ,sparsz        ; /62/ more to come, make room for it
  421.  
  422.     clrb    (r1)            ; /62/ init capas byte
  423.     tst    dolong            ; /42/ do long packets?
  424.     beq    40$            ; /42/ no
  425.     bisb    #capa.l    ,@r1        ; /42/ ya
  426. 40$:    tst    doattr            ; /42/ do attributes?
  427.     beq    50$            ; /62/ no
  428.     bisb    #capa.a    ,@r1        ; /62/ ya
  429.  
  430. 50$:    tochar    (r1)+    ,(r2)+        ; senpar.capas
  431.     tochar    (r1)+    ,(r2)+        ; /42/ senpar.capas+1 (window_size)
  432.     tochar    (r1)+    ,(r2)+        ; /42/ senpar.capas+2 (maxlen1)
  433.     tochar    (r1)+    ,(r2)+        ; /42/ senpar.capas+3 (maxlen2)
  434.  
  435. 60$:    clrb    (r2)            ; /62/ end, null terminate
  436.     unsave    <r2,r1,r0>
  437.     return
  438.  
  439.  
  440.     .sbttl    Restore set checksum type and init a few things
  441.  
  442. fixchk::movb    setchkt    ,senpar+p.chkt    ; /62/ put SET BLO value back
  443.     clr    do8bit            ; /BBS/ reset the 8-bit quoting flag
  444.     clr    warn8done        ; /BBS/ allow warn message again
  445.     clr    msgtim            ; /BBS/ and long packet messages
  446.     movb    #'Y&137    ,conpar+p.qbin    ; /BBS/ preset normal 8-bit quote bit
  447.     clr    incpar            ; /BBS/ reset parity warning counter
  448.     return
  449.  
  450.  
  451.     .sbttl    Dump a debug packet to disk
  452.  
  453. ;    D S K D M P
  454. ;
  455. ;    input:      (r5)    = function name (RPACK or SPACK)
  456. ;         2(r5)    = packet number    ; /BBS/ number and length flipped
  457. ;         4(r5)    = packet type
  458. ;         6(r5)    = packet length
  459. ;        10(r5)    = packet buffer address
  460.  
  461. dskdmp::save                ; /42/ save r0-r5
  462.     sub    #64    ,sp        ; /BBS/ allocate a formatting buffer
  463.     mov    sp    ,r1        ; point to it
  464.     mov    #64    ,r0        ; number of bytes in the buffer
  465. 10$:    movb    #space    ,(r1)+        ; /BBS/ fill it with blanks
  466.     sob    r0    ,10$        ; one byte at a time
  467.     mov    sp    ,r1        ; point back to the buffer
  468.     mov    (r5)+    ,r0        ; point to the routine name
  469.     call    160$            ; and copy it
  470.     dec    r1            ; /BBS/ format display
  471.     mov    #ini.05    ,r0        ; /BBS/ and a label, "PAK"
  472.     call    160$            ; copy it
  473.     inc    r1            ; /BBS/ a space
  474.     mov    (r5)+    ,r0        ; /BBS/ deccvt uses r5, so use r0 here
  475.     deccvt    r0    ,r1    ,#2    ; /BBS/ convert to decimal
  476.     add    #6    ,r1        ; /BBS/ and skip to next position
  477.     mov    #ini.06    ,r0        ; another label, "TYP"
  478.     call    160$            ; simple
  479.     inc    r1            ; /BBS/ a space
  480.     movb    (r5)+    ,(r1)        ; get the packet type
  481.     inc    r5            ; /62/ finish bumping r5 to next arg..
  482.     cmpb    (r1)    ,#badchk    ; /62/ checksum error?
  483.     bne    20$            ; /62/ no
  484.     movb    #'*    ,(r1)        ; /62/ yes, flag it please
  485.     br    40$            ; /62/ and continue
  486. 20$:    cmpb    (r1)    ,#'A&137    ; /62/ smaller than an "A" ?
  487.     blt    30$            ; /62/ ya..
  488.     cmpb    (r1)    ,#'Z&137    ; /62/ bigger than a "Z" ?
  489.     ble    40$            ; /62/ nope
  490. 30$:    movb    #'?    ,(r1)        ; /62/ indicate type is in la-la land
  491. 40$:    add    #5    ,r1        ; /62/ skip to next entry in line
  492.     mov    #ini.07    ,r0        ; and a label, "LEN"
  493.     call    160$            ; copy it
  494.     inc    r1            ; /BBS/ a space
  495.     mov    (r5)+    ,r2        ; /BBS/ save a copy of packet length
  496.     deccvt    r2    ,r1    ,#4    ; /BBS/ and convert to decimal
  497.     add    #4    ,r1        ; now point to the end
  498.     clrb    @r1            ; make it .asciz
  499.     mov    sp    ,r1        ; point back to the start
  500.     bit    #log$pa    ,trace        ; /BBS/ maybe only doing TT now?
  501.     beq    100$            ; /BBS/ ya..
  502.     strlen    r1            ; /BBS/ don't write extra blanks!
  503.     calls    putrec    ,<r1,r0,#lun.lo> ; and put out to disk now
  504.     tst    r0            ; /62/ did it work?
  505.     beq    50$            ; /62/ ya
  506.     call    logerr            ; /62/ no, handle the error
  507.     br    100$            ; /62/ that's it for this part..
  508. 50$:    mov    @r5    ,r3        ; /BBS/ get address of packet buffer
  509.     cmp    r2    ,#$allsiz-2    ; /62/ is this length for real?
  510.     ble    60$            ; /62/ should be..  else truncate to
  511.     mov    #$allsiz-2,r2        ; /62/ avoid trap to 4 past buff end!!
  512. 60$:    mov    r2    ,r4        ; /42/ save the length please
  513. 70$:    mov    r4    ,r0        ; /42/ assume a reasonable size
  514.     ble    100$            ; /BBS/ don't write null lines..
  515.     cmp    r0    ,#72.        ; /42/ will the leftovers fit?
  516.     ble    80$            ; /42/ yes
  517.     mov    #72.    ,r0        ; /42/ no
  518. 80$:    call    170$            ; /62/ indent 4 columns
  519.     calls    putrec    ,<r3,r0,#lun.lo> ; /42/ dump a (partial) bufferful
  520.     tst    r0            ; /62/ did it work?
  521.     beq    90$            ; /62/ ya
  522.     call    logerr            ; /62/ no, handle the error
  523.     br    100$            ; /62/ that's it for this part..
  524. 90$:    add    #72.    ,r3        ; /42/ move up to next partial
  525.     sub    #72.    ,r4        ; /42/ and try again
  526.     br    70$            ; /42/ next please
  527.  
  528. 100$:    bit    #log$de    ,trace        ; /62/ should we also dump to TT?
  529.     beq    150$            ; no
  530.     wrtall    r1            ; yes, dump the length and type
  531.     .newline            ; and a CR/LF
  532.     tst    r2            ; anything in the packet?
  533.     beq    150$            ; no
  534.     clr    r1            ; /BBS/ init a counter for newlines
  535.     mov    @r5    ,r3        ; /BBS/ get address of packet buffer
  536. 110$:    tst    tsxsav            ; /BBS/ running under TSX?
  537.     beq    120$            ; /BBS/ nope
  538.     cmpb    @r3    ,m.tsxr        ; /62/ ya, is this TSLICH?
  539.     beq    140$            ; /BBS/ ya, don't type it to TT
  540. 120$:    tst    r1            ; /62/ at the top of a line (col.1)?
  541.     bne    130$            ; /62/ nope
  542.     wrtall    #ini.08            ; /62/ ya, indent 4 columns..
  543. 130$:    movb    (r3)+    ,r0        ; /BBS/ get a byte
  544.     call    writ1char        ; /BBS/ send it to TT
  545.     inc    r1            ; /BBS/ increment the byte counter
  546.     cmp    r1    ,#72.        ; /BBS/ done 72. chars yet?
  547.     ble    140$            ; /BBS/ nope
  548.     .newline            ; /BBS/ ya, do a <cr><lf>
  549.     clr    r1            ; /BBS/ and reset the byte counter
  550. 140$:    sob    r2    ,110$        ; /BBS/ continue
  551.     tst    r1            ; /BBS/ need a newline?
  552.     beq    150$            ; /BBS/ nope
  553.     .newline            ; /BBS/ ya
  554. 150$:    add    #64    ,sp        ; /BBS/ pop the local buffer
  555.     unsave                ; /42/ unsave r5-r0
  556.     return
  557.  
  558. 160$:    movb    (r0)+    ,(r1)+        ; copy .asciz string to buffer
  559.     bne    160$            ; done yet?
  560.     dec    r1            ; /BBS/ back up to null
  561.     movb    #space    ,(r1)+        ; /BBS/ stuff a space where null was
  562.     return
  563.  
  564. 170$:    save    <r2,r1,r0>        ; /62/ added, dump 4 blanks to logfile
  565.     mov    #4    ,r2        ; loop 4 times
  566.     mov    #lun.lo    ,r1        ; write to this channel
  567. 180$:    mov    #space    ,r0        ; space is the char to write
  568.     call    putcr0            ; do it
  569.     sob    r2    ,180$        ; until done
  570.     unsave    <r0,r1,r2>
  571.     return
  572.  
  573.  
  574.     .sbttl    Init stats registers    ; /62/ now includes clrsta
  575.  
  576. inista::call    dcdtst            ; /63/ check DCD, report any change
  577.     mov    #pcnt.r    ,r1        ; packets received
  578.     mov    totp.r    ,r2        ; running count so far
  579.     mov    #34    ,r0        ; number of words to add/clear
  580. 10$:    add    2(r1)    ,2(r2)        ; /43/ add in the totals
  581.     adc    (r2)            ; /43/ the carryover also
  582.     add    (r1)    ,(r2)+        ; /43/ the high order of it
  583.     tst    (r2)+            ; /43/ get to the next one
  584.     clr    (r1)+            ; /43/ clear old stuff out
  585.     clr    (r1)+            ; /43/
  586.     sob    r0    ,10$        ; /43/ next please
  587.     mov    #pcnt.s    ,r1        ; now for the packets sent
  588.     mov    totp.s    ,r2        ; where to add them in
  589.     mov    #34    ,r0        ; number of words to do
  590. 20$:    add    2(r1)    ,2(r2)        ; /43/ add in the totals
  591.     adc    (r2)            ; /43/ the carryover also
  592.     add    (r1)    ,(r2)+        ; /43/ the high order of it
  593.     tst    (r2)+            ; /43/ get to the next one
  594.     clr    (r1)+            ; /43/ clear old stuff out
  595.     clr    (r1)+            ; /43/
  596.     sob    r0    ,20$        ; /43/ next please
  597.     clr    pcnt.n            ; NAKs count
  598.     clr    pcnt.n+2        ; /43/ rest of it
  599.     clr    pcnt.t            ; /44/ time-outs
  600.     clr    pcnt.t+2        ; /44/
  601.     clr    filein+0        ; /43/ file data stats
  602.     clr    filein+2        ; /43/
  603.     clr    fileout+0        ; /43/
  604.     clr    fileout+2        ; /43/
  605.     clr    charin+0        ; /43/ physical link stats
  606.     clr    charin+2        ; /43/
  607.     clr    charout+0        ; /43/
  608.     clr    charout+2        ; /43/
  609.     clr    rdrate+0        ; /BBS/ read rate, # chars hi word
  610.     clr    rdrate+2        ; /BBS/ # chars lo word
  611.     clr    rdrate+4        ; /BBS/ # of reads
  612.     clr    nakrec            ; /BBS/ anti-resonating NAK register
  613.     .gtim    #rtwork    ,#pkrate    ; /62/ start of init packet xmission
  614.     mov    #-1    ,pkrate+4    ; /62/ flag this is first time through
  615.     mov    #-1    ,pcnt.n+2    ; init so next bump makes it zero
  616.     clr    pcnt.n+0        ; /43/ clear high order bits
  617.     mov    #-1    ,pcnt.t+2    ; /44/ init time-out counter
  618.     clr    pcnt.t+0        ; /44/ 32. bits here too
  619.     .br    incsta            ; /63/
  620.  
  621.  
  622.     .sbttl    Increment stats
  623.  
  624. incsta::cmp    -(sp)    ,-(sp)        ; allocate two word buffer
  625.     mov    sp    ,r3        ; and point to the small buffer
  626.     .gtim    #rtwork    ,r3        ; get ticks past midnite
  627.     mov    (r3)+    ,r0        ; load time hi word and
  628.     mov    (r3)    ,r1        ; low word for double precision divide
  629.     cmp    (sp)+    ,(sp)+        ; pop the tiny buffer
  630.     mov    #40    ,r3        ; set iteration count in r3 (32. bits)
  631.     mov    clkflg    ,-(sp)        ; put divisor on the stack
  632.     clr    r2            ; set the remainder to zero
  633. 10$:    asl    r1            ; shift the entire dividend
  634.     rol    r0            ; ...
  635.     rol    r2            ; ... to left and into remainder
  636.     cmp    r2    ,(sp)        ; is remainder greater than divisor
  637.     blo    20$            ; no, skip to iteration control
  638.     sub    (sp)    ,r2        ; yes, subtract divisor out please
  639.     inc    r1            ; increment the quotient
  640. 20$:    dec    r3            ; repeat please
  641.     bgt    10$            ; not done    r0=hiword secs>midnite
  642.     tst    (sp)+            ; pop divisor    r1=loword secs>midnite
  643.     mov    #times+4,r2        ; /43/ midnight, moving old times
  644.     mov    r0    ,(r2)+        ; /43/ insert new times first
  645.     mov    r1    ,(r2)        ; /43/ then subtract off the old
  646.     sub    times+2    ,(r2)        ; /43/ times from it
  647.     sbc    -(r2)            ; /43/ ditto for the carry
  648.     sub    times+0    ,(r2)        ; /43/ incremental is in times+4..>>
  649.     bge    30$            ; /BBS/ didn't cross midnight
  650.     mov    #times+6,r2        ; /BBS/ did cross, add 24 hours to fix
  651.     add    #20864.    ,(r2)        ; /BBS/ low word of # secs in 24 hours
  652.     adc    -(r2)            ; /BBS/ add carry to 32-bit hi word
  653.     add    #1.    ,(r2)        ; /BBS/ hi word of # secs in 24 hours
  654. 30$:    mov    r1    ,times+2    ; /43/ <<..and times+6, new time is in
  655.     mov    r0    ,times+0    ; /43/ times+0 and times+2
  656.     return                ; /43/
  657.  
  658.  
  659.     .sbttl    Initialize repeat count for sending packets
  660.  
  661. inirep::save    <r0>
  662.     clr    dorpt            ; assume not doing repeat things
  663.     tst    setrpt            ; repeat count processing disabled?
  664.     beq    10$            ; yes
  665.     cmpb    #myrept    ,#space        ; am I doing it?
  666.     beq    10$            ; no, just exit then
  667.     clr    rptcount        ; size of repeat if zero
  668.     clr    rptlast            ; no last character please (a null)
  669.     mov    #-1    ,rptinit    ; need to prime the pump please
  670.     movb    conpar+p.rept,r0    ; check for doing so
  671.     beq    10$            ; no
  672.     cmpb    r0    ,#space        ; a space also?
  673.     beq    10$            ; yes
  674.     cmpb    r0    ,senpar+p.rept    ; same?
  675.     bne    10$            ; no
  676.     movb    r0    ,rptquo        ; yes, save it and
  677.     mov    sp    ,dorpt        ; /62/ we are indeed doing this
  678. 10$:    unsave    <r0>
  679.     return
  680.  
  681.  
  682.     .sbttl    Decide what to do about displaying packet counts
  683.  
  684. dolog:    call    dcdtst            ; /62/ check DCD, report any change
  685.     tst    blip            ; display at every "blip" # of counts
  686.     beq    10$            ; do not do this at all
  687.     tst    infomsg            ; /51/ if SET TT QUIET
  688.     beq    10$            ; /51/ don't do this
  689.     tst    remote            ; a server?
  690.     bne    10$            ; could be
  691.     tst    xmode            ; extended reply?  also clears carry..
  692.     bne    10$            ; yes
  693.     bit    #log$de    ,trace        ; /62/ debugging to TT?
  694.     bne    10$            ; /BBS/ ya, stop headers + etc..
  695.     bit    #log$rp    ,trace        ; /BBS/ this also writes to TT
  696.     beq    20$            ; /BBS/ except when equal to zero
  697. 10$:    sec                ; flag to skip stats display
  698. 20$:    return                ; /63/ or carry cleared by above tests
  699.  
  700.  
  701.     .sbttl    Display received packets stats
  702.  
  703. reclog::save    <r1>
  704.     call    dolog            ; decide what to do
  705.     bcs    10$            ; do nothing
  706.     mov    pcnt.r+2,r1        ; check for modulo on screen updates
  707.     clr    r0            ; setup for the divide
  708.     div    blip    ,r0        ; do it
  709.     tst    r1            ; any remainder left over?
  710.     bne    10$            ; yes, simply exit
  711.     mov    vttype    ,r0        ; no, dispatch to the correct routine
  712.     asl    r0            ; it's word indexing
  713.     jsr    pc    ,@recdsp(r0)    ; dispatch
  714. 10$:    unsave    <r1>
  715.     return
  716.  
  717.     .save
  718.     .psect    $pdata
  719. recdsp:    .word    rectty    ,rectty    ,recvt1    ,recvt1    ,recvt1
  720.     .restore
  721.  
  722. rectty:    mov    #pcnt.r    ,r1        ; /43/ pass address in r1
  723.     call    numout            ; write the number to the terminal
  724.     wrtall    #$delim            ; a "/" delimiter
  725.     mov    #pcnt.s+<4*<<'N&137>-100>>,r1 ; /43/ 32. bits this time
  726.     cmp    2(r1)    ,pcnt.n+2    ; /43/ unlikely that the NAK
  727.     beq    10$            ; /43/ count would ever be > 65535.
  728.     mov    2(r1)    ,pcnt.n+2    ; /43/ use low order 16 bits
  729. 10$:    call    numout            ; /BBS/ always refresh display
  730.     call    l$nolf            ; just a CR, unless TT is NOSCOPE
  731.     mov    sp    ,logini        ; /BBS/ flag this line has been used
  732.     return
  733.  
  734. recvt1:    tst    logini            ; need the header?
  735.     bne    20$            ; no
  736.     tst    pcnt.r+2        ; /62/ ya, but sent any packets yet?
  737.     bne    10$            ; /62/ ya
  738.     tst    pcnt.r+0        ; /62/ check hi word just in case
  739.     beq    50$            ; /62/ nothing to do yet
  740. 10$:    wrtall    #$rech            ; /62/ initial header please
  741.     mov    #-1    ,pcnt.n+2    ; /62/ force redisplay of NAKs
  742.     mov    #-1    ,pcnt.t+2    ; /62/ and time-outs
  743.     mov    sp    ,logini        ; /62/ flag it has been done
  744. 20$:    wrtall    #$pos1            ; position the cursor
  745.     mov    #pcnt.r    ,r1        ; /43/ received packet count
  746.     call    numout            ; dump it
  747.     mov    #pcnt.s+<4*<<'N&137>-100>>,r1 ; /43/ get the sent NAK count
  748.     cmp    2(r1)    ,pcnt.n+2    ; /43/ really need to update NAKs?
  749.     beq    30$            ; no
  750.     mov    2(r1)    ,pcnt.n+2    ; /43/ stuff low order 16 bits
  751.     wrtall    #npos            ; /62/ put cursor where NAK count goes
  752.     call    numout            ; print the NAK count
  753. 30$:    ; /BBS/ dotmo moved here
  754.     mov    #pcnt.r+<4*<<'T&137>-100>>,r1 ; /44/ get time-out count
  755.     cmp    2(r1)    ,pcnt.t+2    ; /44/ has time-out count changed?
  756.     beq    40$            ; /44/ no, just exit
  757.     mov    2(r1)    ,pcnt.t+2    ; /44/ yes, update counter
  758.     wrtall    #dpos            ; /44/ position cursor
  759.     call    numout            ; /44/ dump the number to TT please
  760. 40$:    call    l$nolf
  761. 50$:    return
  762.  
  763.  
  764.     .sbttl    Display sent packets stats
  765.  
  766. senlog::save    <r1>
  767.     call    dolog            ; decide what to do
  768.     bcs    10$            ; don't do anything
  769.     mov    pcnt.s+2,r1        ; check for modulo on screen updates
  770.     clr    r0            ; setup for the divide
  771.     div    blip    ,r0        ; do it
  772.     tst    r1            ; any remainder left over?
  773.     bne    10$            ; yes, simply exit
  774.     mov    vttype    ,r0        ; recover terminal type
  775.     asl    r0            ; word indexing here
  776.     jsr    pc    ,@sendsp(r0)    ; dispatch based on terminal type
  777. 10$:    unsave    <r1>
  778.     return
  779.  
  780.     .save
  781.     .psect    $pdata
  782. sendsp:    .word    sentty    ,sentty    ,senvt1    ,senvt1    ,senvt1
  783.     .restore
  784.  
  785. sentty:    mov    #pcnt.s    ,r1        ; /43/ 32. bits now
  786.     call    numout            ; write the number to the terminal
  787.     wrtall    #$delim            ; a "/" delimiter
  788.     mov    #pcnt.r+<4*<<'N&137>-100>>,r1 ; get the sent NAK count
  789.     cmp    2(r1)    ,pcnt.n+2    ; any change in count?
  790.     beq    10$            ; no
  791.     mov    2(r1)    ,pcnt.n+2    ; ya, update it
  792. 10$:    call    numout            ; /BBS/ always refresh display
  793.     call    l$nolf            ; just a CR, unless TT is NOSCOPE
  794.     mov    sp    ,logini        ; /BBS/ flag this line has been used
  795.     return
  796.  
  797. senvt1:    tst    logini            ; need the header?
  798.     bne    20$            ; no
  799.     tst    pcnt.r+2        ; /62/ ya, but sent any packets yet?
  800.     bne    10$            ; /62/ ya
  801.     tst    pcnt.r+0        ; /62/ check hi word just in case
  802.     beq    50$            ; /62/ nothing to do yet
  803. 10$:    wrtall    #$sendh            ; /62/ ya, dump it to TT
  804.     mov    #-1    ,pcnt.n+2    ; /62/ force redisplay of NAKs
  805.     mov    #-1    ,pcnt.t+2    ; /62/ and time-outs
  806.     mov    sp    ,logini        ; /62/ flag header now exists
  807. 20$:    wrtall    #$pos0            ; /BBS/ position the cursor
  808.     mov    #pcnt.s    ,r1        ; /43/ 32. bits now
  809.     call    numout            ; write number on terminal
  810.     mov    #pcnt.r+<4*<<'N&137>-100>>,r1 ; get the sent NAK count
  811.     cmp    2(r1)    ,pcnt.n+2    ; any change in count?
  812.     beq    30$            ; no
  813.     mov    2(r1)    ,pcnt.n+2    ; ya, update it
  814.     wrtall    #npox            ; /62/ for shortened send logging
  815.     call    numout            ; write number on terminal
  816. 30$:    ; /BBS/ dotmo moved here
  817.     mov    #pcnt.r+<4*<<'T&137>-100>>,r1 ; /44/ get time-out count
  818.     cmp    2(r1)    ,pcnt.t+2    ; /44/ has time-out count changed?
  819.     beq    40$            ; /44/ no, just exit
  820.     mov    2(r1)    ,pcnt.t+2    ; /44/ yes, update counter
  821.     wrtall    #dpox            ; /BBS/ position cursor for send
  822.     call    numout            ; /44/ dump the number to TT please
  823. 40$:    call    l$nolf            ; just a CR, unless TT is NOSCOPE
  824. 50$:    return
  825.  
  826.  
  827.     .sbttl    Display packet stats via ^A    ; 9-Dec-86 07:46:02
  828.  
  829. ; /56/    This is similar to the VMS Kermit's ^A status line, which is just like
  830. ; that in FTP.  Under KRT as it currently is however, the only time this test
  831. ; can be done is just after receiving a data packet, and there may be some lag
  832. ; until that occurs, especially when using long packets over a slow link.
  833.  
  834. cs$in::    mov    #ini.12    ,r0        ; pass to common code
  835.     mov    #filein    ,r1        ; address of data to print
  836.     mov    #lun.ou    ,-(sp)        ; /62/ save for blocks display
  837.     br    cs.com            ; /63/
  838.  
  839. cs$out::mov    #ini.11    ,r0        ; pass to common code
  840.     mov    #fileout,r1        ; address of data to print
  841.     mov    #lun.in    ,-(sp)        ; /62/ save for blocks display
  842. cs.com:    call    l$nolf            ; /62/ ensure stats are in the clear
  843.     call    numout            ; dump char count @r1
  844.     wrtall    #ini.09            ; /62/ some text
  845.     wrtall    r0            ; send or receive?
  846.     wrtall    #ini.10            ; /62/ some more text
  847.     wrtall    #filnam            ; name of the file
  848.     wrtall    #ini.13            ; /62/ "curblk/maxblk"
  849.     mov    (sp)+    ,r1        ; /62/ recover file's lun
  850.     asl    r1            ; /62/ word indexing here..
  851.     mov    blknum(r1),r0        ; /62/ current block number
  852.     call    L10266            ; /62/ display it
  853.     mov    #'/    ,r0        ; /62/ a slash
  854.     call    writ1char        ; /62/ display it
  855.     mov    sizof(r1),r0        ; /62/ this is how big file is
  856.     call    L10266            ; /62/ display it
  857.     .newline            ; /62/ done
  858.     clr    logini            ; retype the display header
  859.     return
  860.  
  861.  
  862.     .sbttl    Display a 32-bit number    ; /43/
  863.  
  864. numout:    save    <r0,r1,r2>
  865.     sub    #20    ,sp        ; allocate a buffer please
  866.     mov    sp    ,r0        ; point to buffer for $cddmg
  867.     clr    r2            ; kill leading zero and spaces
  868.     call    $cddmg            ; convert to ascii
  869.     clrb    @r0            ; make it .asciz
  870.     mov    sp    ,r0        ; reset pointer
  871.     wrtall    r0            ; dump the string
  872.     add    #20    ,sp
  873.     unsave    <r2,r1,r0>
  874.     return
  875.  
  876.     .end
  877.