bne 15$ ; no, don't bother setting the mode clr do8bit ; don't ever try to do it br 30$ ; 15$: cmpb r0 ,#'Y&137 ; has the other one required this mode? bne 20$ ; yes, set the mode up then cmpb parity ,#par$no ; no, but do we need to do it? beq 30$ ; no, don't waste the overhead movb #myqbin ,r0 ; yes, force this to the other side movb r0 ,p.qbin(r1) ; tell the other kermit we HAVE to do it 20$: mov sp ,snd8bit ; flag we need it for sending a file mov sp ,do8bit ; force 8bit prefixing then movb r0 ,ebquot ; and set ours to the same please movb r0 ,p.qbin(r1) ; /29/ fix this please 30$: tochar (r1)+ ,(r2)+ ; senpar.spsiz tochar (r1)+ ,(r2)+ ; senpar.time tochar (r1)+ ,(r2)+ ; senpar.npad ctl (r1)+ ,(r2)+ ; senpar.padc tochar (r1)+ ,(r2)+ ; senpar.eol movb (r1)+ ,(r2)+ ; senpar.qctl movb (r1)+ ,(r2)+ ; senpar.qbin movb (r1)+ ,(r2)+ ; senpar.chkt movb (r1)+ ,(r2)+ ; senpar.rept bicb #CAPA.L ,@r1 ; /42/ Assume NO long packet support tst dolong ; /42/ Do long packet crap? beq 35$ ; /42/ No bisb #CAPA.L ,@r1 ; /42/ Yes, insert it NOW 35$: bisb #CAPA.A ,@r1 ; /42/ Assume attribute support tst doattr ; /42/ Really do it ? bne 40$ ; /42/ Yes bicb #CAPA.A ,@r1 ; /42/ No, disable it now 40$: tochar (r1)+ ,(r2)+ ; senpar.capas tochar (r1)+ ,(r2)+ ; /42/ senpar.capas+1 (window size) tochar (r1)+ ,(r2)+ ; /42/ senpar.capas+2 (maxlen2) tochar (r1)+ ,(r2)+ ; /42/ senpar.capas+3 (maxlen1) clrb (r2)+ ; end unsave return fixchk::tstb setsen+p.chkt ; did the user ever set block-check? beq 100$ ; no cmpb setsen+p.chkt,#'1 ; insure that it's legit blo 100$ cmpb setsen+p.chkt,#'3 ; insure that it's legit bhi 100$ movb setsen+p.chkt,senpar+p.chkt 100$: return .sparsz == 15 ; /42/ 13 parameters to send over sparin::save ; save registers we may use mov #.sparsz,sparsz ; copy the send init packet size tst doattr ; attribute support disabled today? bne 10$ ; no tst dolong ; /42/ Doing long packets ? bne 10$ ; /42/ Yes mov #11 ,sparsz ; No, shorten the packet up 10$: mov #senpar ,r1 ; where to put them movb #maxpak ,(r1)+ ; maximum packet size movb #mytime ,(r1)+ ; my desired timeout movb #mypad ,(r1)+ ; how much padding movb #mypchar,(r1)+ ; whatever i use for padding movb #myeol ,(r1)+ ; line terminators (don't need it) movb #myquote,(r1)+ ; quoting ? movb #'Y&137 ,(r1)+ ; do quoting ? movb #mychkt ,@r1 ; /42/ checksum type ;- tst dolong ; /42/ Want to do long packet? 15$: inc r1 movb #40 ,@r1 ; assume no repeat processing tst setrpt ; really say we do repeat crap? beq 20$ ; no movb #myrept ,@r1 ; default on the rest of it 20$: inc r1 ; fix the pointer please movb #mycapa ,@r1 ; we can read attributes tst doattr ; /42/ No attrs but do long packets? bne 30$ ; /42/ Leave attribute support in bicb #CAPA.A ,@r1 ; /42/ Remove attribute support 30$: tst dolong ; /42/ Long packet support desired? bne 40$ ; /42/ Yes, leave the bit alone bicb #CAPA.L ,@r1 ; /42/ No, remove support bit 40$: bicb #1 ,@r1 ; /42/ Insure no more capas bytes inc r1 ; /42/ Next please clrb (r1)+ ; /42/ No window size to send over mov #maxpak ,r3 ; /42/ Setup to break the size into clr r2 ; /42/ two bytes div #95. ,r2 ; /42/ Done movb r2 ,(r1)+ ; /42/ maxl1 = buffersize / 95 movb r3 ,(r1)+ ; /42/ maxl2 = buffersize mod 95 clrb (r1)+ ; default on the rest of it clrb (r1)+ ; default on the rest of it movb #'& ,ebquot unsave return global global ; /42/ global ; /42/ .sbttl rpar read senders initialization parameters ; R P A R ; ; rpar( %loc msgpacket, %val size ) ; ; input: @r5 message packet to get data from ; 2(r5) packet length ; output: REMPAR[0..20] of parameters rpar:: save ; save registers we may use clr r3 ; /42/ Sending long paK11INIMAC[.050032]K11INI.MAC[.050032]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf%Warning - You have requested LONG packet support/ .asciz /but the other Kermit does not support this feature./ .even .restore .sbttl setup defaults for senders parameters and also check them rparin::save ; save registers we may use mov #conpar ,r1 ; where to put them movb #maxpak ,(r1)+ ; maximum packet size movb #mytime ,(r1)+ ; my desired timeout movb #mypad ,(r1)+ ; how much padding movb #mypchar,(r1)+ ; whatever i use for padding movb #myeol ,(r1)+ ; line terminators (don't need it) movb #myquote,(r1)+ ; quoting ? movb #'Y&137 ,(r1)+ ; do quoting ? movb #mychkt ,(r1)+ ; checksum type movb #40 ,(r1)+ ; assume no repeat count processing clrb (r1)+ ; default on the rest of it clrb (r1)+ ; default on the rest of it clrb (r1)+ ; default on the rest of it clrb (r1)+ ; default on the rest of it clrb (r1)+ ; default on the rest of it unsave return rparck: mov #conpar ,r0 ; /37/ address of senders parameters $chkb #maxpak ,r0 ; /37/ Be defensive about the senders $chkb #mytime ,r0 ; /37/ parameters please $chkb #mypad ,r0 $chkb #mypchar,r0 $chkb #myeol ,r0 $chkb #myquote,r0 $chkb #'Y ,r0 $chkb #mychkt ,r0 $chkb #40 ,r0 return ; /37/ exit to RPAR global .sbttl fillog log file opens/close to disk ; F I L L O G ; ; input: @r5 0 for open for read ; 1 for open for write ; 2(r5) filename .enabl lsb fillog::save bit #log$fi ,trace ; logging file activity to disk ? beq 100$ ; no calls putc ,<#cr,#lun.lo> ; insure buffers are flushed mov #200$ ,r1 ; assume a header of 'writing' tst @r5 ; perhaps writing ? beq 10$ ; no mov #210$ ,r1 ; yes 10$: movb (r1)+ ,r0 ; copy the byte over beq 20$ ; all done calls putc , ; next byte pleae br 10$ ; next 20$: mov 2(r5) ,r1 ; now for the filename 30$: movb (r1)+ ,r0 ; copy the byte over beq 40$ ; all done calls putc , ; next byte pleae br 30$ ; next 40$: calls putc ,<#cr,#lun.lo> ; dump the record 100$: unsave ; and exit return .save .psect $PDATA ,D 200$: .asciz /Receiving file / 210$: .asciz /Sending file / .even .restore .dsabl lsb .sbttl debug dump to disk ; D S K D M P ; ; input: @r5 name ('rpack' or 'spack') ; 2(r5) packet length ; 4(r5) packet type ; 6(r5) packet number ; 10(r5) packet address .enabl lsb dskdmp::save ; /42/ Save R0-R5 sub #120 ,sp ; allocate a formatting buffer mov sp ,r1 ; point to it mov #120 ,r0 ; and clear it out 10$: movb #40 ,(r1)+ ; simple sob r0 ,10$ mov sp ,r1 ; point back to the buffer mov (r5)+ ,r0 ; point to the routine name call 200$ ; and copy it mov #110$ ,r0 ; and a label ('LEN') call 200$ ; copy it mov (r5)+ ,r2 ; get the length saved deccvt r2,r1,#3 ; convert the length to decimal add #6 ,r1 ; and skip over it mov #120$ ,r0 ; another label ('TYP') call 200$ ; simple movb (r5)+ ,(r1)+ ; get the packet type movb #40 ,(r1)+ ; and some spaces cmpb @r1 ,#badchk ; checksum error ? bne 20$ ; no movb #'* ,-1(r1) ; yes, flag it please 20$: inc r5 ; point to the next arguement movb #40 ,(r1)+ ; and some spaces movb #40 ,(r1)+ ; and some spaces movb #40 ,(r1)+ ; and some spaces mov #130$ ,r0 ; and a label ('PAK') call 200$ ; copy it mov (r5)+ ,r0 deccvt r0,r1,#3 ; and convert to decimal add #4 ,r1 ; now point to the end clrb @r1 ; make it .asciz mov sp ,r1 ; point back to the start calls putrec , ; and put out to disk now mov @r5 ,r3 ; /42/ May have very large packets mov r2 ,r4 ; /42/ Save the length please 30$: mov r4 ,r0 ; /42/ Assume a reasonable size bmi 50$ ; /42/ Anything left over to do? cmp r0 ,#72. ; /42/ Will the leftovers fit? ble 40$ ; /42/ Yes mov #72. ,r0 ; /42/ No 40$: calls putrec ,; /42/ Dump a (partial) bufferfull add #72. ,r3 ; /42/ Move up to next partial sub #72K11INIMAC[.050032]K11INI.MAC[.050032]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf0>>,r1 ; get the sent NAK count /43/ cmp 2(r1) ,pcnt.n+2 ; /43/ Really need to update naks? beq 90$ ; no mov 2(r1) ,pcnt.n+2 ; /43/ Stuff low order 16 bits call nakpos call numout ; print the NAK count 90$: call dotmo ; /44/ DO timeouts print #$leftm 100$: return ; for sending files, log transactions here senlog::save call dolog bcs 100$ mov pcnt.s+2,r1 ; check for modulo on screen updates clr r0 ; setup for the divide div blip ,r0 ; do it tst r1 ; any remainder left over bne 100$ ; yes, simply exit mov vttype ,r0 asl r0 jsr pc ,@sendsp(r0) 100$: unsave return sentty: mov #pcnt.s ,r1 ; /43/ 32 bits now call numout print #$delim mov #pcnt.r+<4*<<'N&137>-100>>,r1 ; get the sent NAK count cmp 2(r1) ,pcnt.n+2 beq 100$ mov 2(r1) ,pcnt.n+2 call numout 100$: print #$leftm return senvt1: tst logini ; need the header? bne 10$ ; no call senhdr ; yes 10$: print #$pos1 ; position the cursor mov #pcnt.s ,r1 ; /43/ 32 bits now call numout mov #pcnt.r+<4*<<'N&137>-100>>,r1 ; get the sent NAK count cmp 2(r1) ,pcnt.n+2 beq 90$ mov 2(r1) ,pcnt.n+2 call nakpos call numout 90$: call dotmo ; /44/ Timeouts print #$leftm 100$: return .sbttl data for packet transfer logging .save .psect $vtdat ,ro,d,lcl,rel,con $sendh: .byte 33,'< .ascii <33>/[2KPackets sent : Naks: / .asciz / Timeouts: / $rech: .byte 33,'< .ascii <33>/[2KPackets received : Naks: / .asciz / Timeouts: / $pos1: .asciz <33>/[20C/ ; goto column 20 $pos2: .asciz <33>/[14C/ ; move over 14 please $leftm: .byte cr,0 ; goto left margin please $delim: .asciz #/# .even sendsp: .word sentty ,senvt1 ,senvt1 ,senvt1 ,senvt1 ,senvt1 ,senvt1 recdsp: .word rectty ,recvt1 ,senvt1 ,senvt1 ,senvt1 ,senvt1 ,senvt1 .assume tty eq 0 .assume vt100 eq 1 .restore numout: save ; /43/ Use $CDDMG from SYSLIB sub #20 ,sp ; /43/ Allocate a buffer please mov sp ,r0 ; /43/ Point to buffer for $CDDMG clr r2 ; /43/ We want leading zero and spaces call $cddmg ; /43/ out please clrb @r0 ; /43/ Make into .asciz mov sp ,r0 ; /43/ Reset pointer print r0 ; /43/ Dump the string and exit add #20 ,sp ; /43/ Pop buffer unsave ; /43/ Pop registers and exit return ; /43/ Exit global <$cddmg> ; /43/ From syslib.olb .sbttl decide what to do about logging .enabl lsb dovt: cmpb vttype,#vt100 ; a vt100 today? blo 90$ ; /39/ no, but allow vt220 type dolog: tst blip ; beq 90$ ; do not do this at all tst infomsg ; /51/ Don't do if SET QUIET beq 90$ ; /51/ tst remote ; a server? bne 90$ ; could be tst xmode ; text reply? bne 90$ ; yes br 100$ ; debug is ok then 90$: sec return 100$: clc return global .dsabl lsb nakpos: print #npos return .save .psect $PDATA ,D npos: .asciz <33>/[38C/ ; goto column 38 dpos: .asciz <33>/[59C/ ; /44/ For timeout count .even .restore dotmo: mov #pcnt.r+<4*<<'T&137>-100>>,r1 ; /44/ Get timeout count cmp 2(r1) ,pcnt.t+2 ; /44/ Timeout count has changed? beq 100$ ; /44/ No, just exit mov 2(r1) ,pcnt.t+2 ; /44/ Yes, update counter print #dpos ; /44/ Position cursor call numout ; /44/ Dump please 100$: return global global .sbttl 32 bit conversion from rsx syslib .GLOBL $CBTA ;Global reference .GLOBL $SAVRG ;Global reference .GLOBL $CDDMG $CDDMG: JSR R5,$SAVRG MOV R0,R3 MOV #23420,R4 MOV #12,R5 TST R2 BEQ C00024 C00022: BIS #1000,R5 C00024= C00022+2 CMP (R1),R4 BCC C00104 MOV (R1)+,R0 MOV (R1),R1 DIV R4,R0 MOV R1,-(SP) MOV R0,R1 BEQ C00064 MOV #24000,R2 CALL C00072 BIS #1000,R5 MOV R0,R3 C00064: MOV (SP)+,R1 MOV #20000,R2 C00072: MOV R3,R0 BIS R5,R2 CALL $CBTA BR C00116 C00104: MOV #5,R2 C00110: MOVB #52,(R0)+ SOB R2,C00110 C00116: RETURN .end K11INIMAC[.050032]K11INI.MAC[.050032]   X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\