beq 10$ ; /54/ Yes STRCPY r4 ,r2 ; /54/ No, copy as is. clr r0 ; /54/ No errors br 100$ ; /54/ And exit 10$: tst r1 ; current state is zero ? beq 80$ ; yes, exit then clr r3 ; get the next ch please bisb (r2)+ ,r3 ; simple bic #^C177 ,r3 ; insure in range 0..127 dec r1 ; use previous state to get the mul #10 ,r1 ; index into the state table movb chtype(r3),r0 add r0 ,r1 ; add in the character class movb ptable(r1),r1 ; and get the new state of system beq 80$ ; all done if new state is zero bmi 90$ ; error exit if < 0 clr r0 ; now mask off the action index from div #10. ,r0 ; the new state asl r0 ; action index times 2 for addressing jsr pc ,@paction(r0) ; simple br 10$ ; next please 80$: clr r0 ; no errors clrb @r4 ; .asciz for output br 100$ ; bye 90$: mov #-1 ,r0 ; error, bye 100$: unsave ; pop registers and exit return .sbttl action routines for the filename parser null: return init: mov 2(r5) ,r4 ; re-init the output string address return copy: movb r3 ,(r4)+ ; copy a byte clrb @r4 ; terminate the string return ; next please fin: save ; all done, look for a '.' mov 2(r5) ,r0 ; if there isn't any, add one at 10$: tstb @r0 ; end of the line yet ? beq 20$ ; yes cmpb @r0 ,#'. ; a dot hanging around today? beq 30$ ; yes, exit inc r0 ; no, try again please br 10$ 20$: movb #'. ,r3 ; no dot, stuff one in please call copy ; simple 30$: unsave ; pop temps and exit return .sbttl check_extension check filetype to presume binary file ; C H K E X T ; ; input: @r5 filename ; output: r0 = 0 assume not a binary file ; r0 <> 0 assume it's a binary file ; ; side effects: call to NAMCVT to get Kermit 'normal' filename .enabl lsb chkext::save ; save scratch registers we will use sub #100 ,sp ; allocate a temp buffer for the mov sp ,r1 ; parsed filename and point to it. calls namcvt ,<@r5,r1> ; convert host name to normal name. strlen r1 ; how much is left ? tst r0 ; if nothing, then presume not binary beq 290$ ; nothing to do, exit add r0 ,r1 ; point to the end of the filename 210$: cmpb -(r1) ,#'. ; look for a dot which will delimit the beq 220$ ; filetype sob r0 ,210$ ; not found, try again please br 290$ ; never found a '.' (can't happen) 220$: strlen r1 ; how many chars are in the filetype? cmp r0 ,#4 ; must be exactly four to match? bne 290$ ; no, exit without binary mode mov bintyp ,r2 ; ok, get listhead of filetypes 230$: mov r2 ,r3 ; get next filetype address tstb @r3 ; end of the list ? beq 290$ ; if null, then all done mov r1 ,r4 ; not done, get pointer to passed type call 310$ ; convert to upper case please cmpb r0 ,(r3)+ ; look for match on filetype bne 240$ ; not today call 310$ ; convert to upper case please cmpb r0 ,(r3)+ ; again please bne 240$ ; not bloody likely call 310$ ; convert to upper case please cmpb r0 ,(r3)+ ; and so on bne 240$ ; you know call 310$ ; convert to upper case please cmpb r0 ,(r3)+ ; one more time beq 280$ ; a match, return (BINARY) 240$: add #4 ,r2 ; get the next one please br 230$ ; no match, try the next one 280$: mov #1 ,r0 ; return (BINARY) br 300$ ; and exit 290$: clr r0 ; not binary 300$: add #100 ,sp ; pop local buffer and exit unsave ; pop registers that we used return ; and exit 310$: movb (r4)+ ,r0 ; get the next character and convert to cmpb r0 ,#'A!40 ; upper case blo 320$ ; no cmpb r0 ,#'Z!40 ; well......? bhi 320$ ; not lower case bicb #40 ,r0 ; lower, convert to upper 320$: return .dsabl lsb .sbttl filetypes that are likely to be binary binini::strcpy bintyp ,#binl return global ; list of filetypes that will almost always be binary for all exec's .save .psect $pdata .dsabl lc binl: .ascii /.TSK/ ; rsx/ias/rstsK11CVTMAC[.050032]K11CVT.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|bddfLETYPE mov sp ,r3 ; And flag that we altered name inc r1 ; Next please br 60$ ; Go to it ; 70$: mov #4 ,r0 ; At most 4 characters in FILETYPE 80$: movb (r1)+ ,(r2)+ ; Finish off with the filetype sob r0 ,80$ ; Next please ; 90$: clrb (r2)+ ; Insure .asciz add #FILSIZ ,sp ; Pop local buffer ; End of RT11 filename truncation. ; 100$: mov r3 ,r0 ; return status clrb @r2 ; insure .asciz return unsave ; pop registers and exit return .save .psect $pdata .even .enabl lc okchr: .ascii /0123456789./ .ascii /abcdefghijklmnopqrstuvwxyz/ .ascii /ABCDEFGHIJKLMNOPQRSTUVWXYZ/ .byte 0 .even .restore .sbttl PRSARG ; Convert strings of form abcde<15> or abcde\015 ; to binary format. prsarg::save ; /45/ Save regs mov argbuf ,r3 ; /41/ Argbuf address mov r0 ,r4 ; /41/ Where to return parsed string 10$: movb (r3)+ ,r2 ; /41/ While ( *argbuf ) beq 100$ ; /41/ Exit with success cmpb r2 ,#'\ ; /45/ "C" style notation? beq 50$ ; /45/ Yes cmpb r2 ,#'< ; /41/ Start of an octal sequence? bne 40$ ; /41/ No. clr r1 ; /41/ Init accumulator 20$: movb (r3)+ ,r2 ; /41/ While ( *argbuf++ ) beq 90$ ; /41/ Error, No terminator cmpb r2 ,#'> ; /41/ Octal number terminator? beq 30$ ; /41/ Yes, exit loop cmpb r2 ,#'0 ; /41/ Check for legitimate value blo 90$ ; /41/ Not an octal digit, error cmpb r2 ,#'7 ; /41/ Check again please bhi 90$ ; /41/ Not legit, error sub #'0 ,r2 ; /41/ Yes, convert to octal until '>' asl r1 ; /41/ Shift over a bit asl r1 ; /41/ ..shift asl r1 ; /41/ ....shift, total of 3 bits add r2 ,r1 ; /41/ Add in current digit br 20$ ; /41/ No 30$: mov r1 ,r2 ; /41/ Yes, get set to insert value 40$: movb r2 ,(r4)+ ; /41/ Place current char or value in br 10$ ; /41/ Next please 50$: clr r1 ; /45/ "C" style notation clr -(sp) ; /45/ Trip counter 60$: movb (r3) ,r2 ; /45/ Copy a character beq 70$ ; /45/ EOS, exit next time cmpb r2 ,#'0 ; /45/ Octal characters? blo 70$ ; /45/ No, exit this loop cmpb r2 ,#'7 ; /45/ ... bhi 70$ ; /45/ Copy the character inc (sp) ; /45/ Been here at least once sub #'0 ,r2 ; /45/ Yes, convert to octal asl r1 ; /45/ Shift over a bit asl r1 ; /45/ ..shift asl r1 ; /45/ ....shift, total of 3 bits add r2 ,r1 ; /45/ Add in current digit inc r3 ; /45/ Next please br 60$ ; /45/ Do it 70$: tst (sp)+ ; /45/ Did we really get a number? beq 75$ ; /45/ No, ignore then movb r1 ,(r4)+ ; /45/ Done, copy the data br 80$ ; /45/ And get next please 75$: tstb r2 ; /45/ No number, perhaps "\\" or beq 80$ ; /45/ or "\<" was present? movb r2 ,(r4)+ ; /45/ Must have had "\x" inc r3 ; /45/ Point to NEXT please 80$: br 10$ ; /45/ Next please 90$: mov #-1 ,r0 ; /41/ Failed br 110$ ; /41/ exit 100$: clr r0 ; /41/ Success 110$: clrb @r4 ; /41/ Insure LOGSTR is .asciz unsave ; /45/ Pop return .sbttl Unfmts Inverse of PRSARG .Save .psect UDATA,RW,D,LCL,REL,CON ubuf: .blkb 80. .Restore Unfmts::Save ; Save registers please mov r0 ,r5 ; Copy the address of the data mov #ubuf ,r4 ; Target buffer 10$: movb (r5)+ ,r1 ; Get the data beq 100$ ; All done cmpb r1 ,#40 ; Control character? blo 20$ ; Yes movb r1 ,(r4)+ ; No, just copy as is br 40$ ; And do the next one 20$: movb #'\ ,(r4)+ ; Control character, insert '\' clr r0 ; Get setup for conversion div #10 ,r0 ; Got it movb r1 ,r2 ; Save the LSB mov r0 ,r1 ; And get the last two out clr r0 ; .... div #10 ,r0 ; Do it add #'0 ,r0 ; Convert to ascii add #'0 ,r1 ; ..Ditto add #'0 ,r2 ; ....Ditto movb r0 ,(r4)+ ; Insert the data movb r1 ,(r4)+ ; Insert the data movb r2 ,(r4)+ ; Insert the data 40$: br 10$ ; Next please 100$: clrb @r4 ; Insure .ASCIZ mov #ubuf ,r0 ; Return a buffer address Unsave ; Pop registers and exit return ; Bye .end K11CVTMAC[.050032]K11CVT.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]