May-84 01-May-84 10:17 AM 4 ...RSX 3493 ; RF:VAR=132 FO:SEQ USED:1:98 RECSI:46 CC:IMP ; ; ; ;SPACK - Length 78 Type A Paknum 3 ;0001002 000056 000000 000001 000000 000001 000142 000000 000204 000000 000000 sn.fab: calls getatr ,<2(r5),#at$fab>; get the ifab stuff now tst r0 ; but did it work? bmi 100$ ; no, it crapped out movb #'0 ,(r4)+ ; return sys type attr code movb #<13*7>+40,(r4)+ ; Length of data to follow. mov r4 ,r0 ; fill it with spaces first mov #13*7 ,r1 ; simple 5$: movb #40 ,(r0)+ ; sob r1 ,5$ ; next mov #at$fab ,r2 ; where we store such things mov #13 ,r0 ; number of words to send 10$: calls l$otoa , ; do it add #7 ,r4 ; skip over it sob r0 ,10$ ; next clr r0 ; say that it worked clrb @r4 ; .asciz 100$: return .sbttl send file type (ascii,binary), protection and size ; SN.FTY added /52/ .enabl lsb sn.fty: movb #'0 ,(r4)+ ; Attribute type (SYS type) movb #42 ,(r4)+ ; Length of data to follow. movb #42 ,(r4)+ ; Sending extended filetype mov image ,r0 ; Index into it movb 200$(r0),(r4)+ ; Insert it clrb @r4 ; .Asciz clr r0 ; Success return ; Exit .ASSUME TEXT EQ 0 .ASSUME BINARY EQ 1 .ASSUME DECNAT EQ 2 .save ; Save, start a DATA psect .psect $pdata ,d 200$: .byte 'A&137 ,'I&137 ,'N&137 ,'A&137 .even .restore ; Pop old psect .dsabl lsb ; And drop local symbol block sn.cdt: movb #'0 ,(r4)+ ; System dependent data following movb #41+<6*4>,(r4)+ ; Amount of data to follow movb #43 ,(r4)+ ; Date of creation, 64bit format CALLS getcdt ,<2(r5)> ; Get address of data mov r0 ,r2 ; Successful (ie, not RT11) beq 90$ ; No mov #4 ,r3 ; Number of words 10$: CALLS l$otoa , ; Do it add #6 ,r4 ; Move over sob r3 ,10$ ; Next please clrb @r4 ; .ASCIZ clr r0 ; Success br 100$ ; Exit 90$: mov #-1 ,r0 ; Failure 100$: return ; Exit sn.typ: movb #42 ,(r4)+ ; attribute type movb #41 ,(r4)+ ; /49/ Length of what follows movb #'A&137 ,@r4 ; assume ascii cmpb image ,#binary ; already decided that it's binary? bne 10$ ; no movb #'I&137 ,@r4 ; yes, say it's image mode today 10$: clrb 1(r4) ; insure .asciz clr r0 ; flag success and exit return ; bye sn.pr0: sn.pr1: mov #-1 ,r0 return sn.len: calls getsiz ,<2(r5)> ; get the size of the file please tst r0 ; did this work ? bne 100$ ; no inc r1 ; try to accomodate rounding asr r1 ; in 1024 blocks, not 512 bic #100000 ,r1 ; insure no sign bits now movb #41 ,(r4)+ ; attribute type (file size) movb #45 ,(r4)+ ; length of the number deccvt r1,r4,#5 ; convert to ascii mov #5 ,r0 ; convert leading spaces to '0' 10$: cmpb @r4 ,#40 ; if a space, then make it a '0' bne 20$ ; no movb #'0 ,@r4 ; yes, stuff a space in 20$: inc r4 ; next please sob r0 ,10$ ; next please clrb @r4 ; insure .asciz clr r0 ; to be safe 100$: return ; bye .sbttl dispatch on the type of attribute packet received .psect $code ; R $ A T T R ; ; input: @r5 the packet address ; output: r0 error code, zero for success r$attr::save ; just to be safe mov @r5 ,r5 ; /49/ Get packet data address 10$: movb (r5)+ ,r0 ; /49/ Attribute type code beq 90$ ; /49/ Nothing there ??? movb (r5)+ ,r1 ; /49/ Get length field next beq 90$ ; /49/ Nothing there ? cmpb r0 ,#'. ; /49/ If this is an OLD kermit-11 bne 20$ ; /49/ with the invalid packet fmt cmpb r1 ,#'D&137 ; /49/ then we will have to make a bne 20$ ; /49/ note of it and try to fix it mov sp ,oldatt ; /49/ up. 20$: call 200$ ; /49/ Perhaps fix packets from old K11 sub #40 ,r1 ; /49/ Convert length to integer bmi 90$ ; /49/ Again, nothing was there mov #curatr ,r2 ; /49/ Copy current attribute argument 40$: movb (r5)+ ,(r2)+ ; /49/ over to a save area now. sob r1 ,40$ ; /49/ Next please clrb (r2)+ ; /49/ Insure .asciz please mov r5 ,-(sp) ; /49/K11ATRMAC[.050032]K11ATR.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|bddflsb fabsiz = 7*13 ; need at least this many at.fab: mov #curatr ,r5 ; /49/ Save area for current attr's call ispdp ; are we compatible today? tst r0 ; no if eq beq 100$ ; no, ignore the system dep attr's strlen r5 ; packet size ok cmp r0 ,#fabsiz ; well.... bge 40$ ; Ok, must be a IFAB mov r5 ,r3 ; /53/ Not an IFAB, perhaps other sys cmpb (r3) ,#43 ; /54/ Date info? bne 30$ ; /54/ No inc r3 ; /54/ Yes, process 4 octal words mov sp ,at$cdt ; /54/ Flag we have been here mov #4 ,-(sp) ; /54/ Number of words mov #at$klu ,r2 ; /54/ Destination 10$: clr r1 ; /54/ Accumulator mov #6 ,r0 ; /54/ Number of itmes 20$: movb (r3)+ ,r4 ; /54/ The next character sub #'0 ,r4 ; /54/ Convert to a number asl r1 ; /54/ Multiply by 8 asl r1 ; /54/ ... asl r1 ; /54/ ...... add r4 ,r1 ; /54/ Put in current result sob r0 ,20$ ; /54/ Next please mov r1 ,(r2)+ ; /54/ Copy the word dec (sp) ; /54/ More to do bne 10$ ; /54/ Yep tst (sp)+ ; /54/ All done br 100$ ; /54/ Exit ; 30$: cmpb (r3)+ ,#42 ; /53/ File type subfunction? bne 100$ ; /53/ No, ignore for now movb (r3)+ ,r0 ; /53/ Get the file type SCAN r0 ,#200$ ; /53/ Look for it asl r0 ; /53/ Word addressing mov 210$(r0),image ; /53/ Set it mov 210$(r0),at$typ ; /53/ Here also. br 100$ ; /53/ Exit 40$: mov #at$fab ,r4 ; copy the packet over now mov r5 ,r3 ; and the source please mov #-1 ,(r4)+ ; flag that the attributes are for real mov #13 ,r2 ; number of words to convert back 50$: clrb 6(r3) ; insure .asciz now calls octval , ; simple tst r0 ; successfull? bne 90$ ; no, clear flag and exit mov r1 ,(r4)+ ; and save the value now add #7 ,r3 ; point to the next octal number sob r2 ,50$ ; next please mov sp ,at$val ; it's ok to use the attributes br 100$ ; bye 90$: clr at$fab ; error exit (conversion error) message ,cr; /49/ 100$: clr r0 ; always flag success and exit return .save .psect $pdata ,d 200$: .byte 'A ,'I ,'N ,0 210$: .word TEXT .word TEXT ,BINARY ,DECNAT ,0 .even .restore .dsabl lsb .sbttl utility routines pd$rsx = '8 pd$ias = '9 pd$rsts = 'A&137 pd$rt = 'B&137 pd$pos = 'C&137 ; I S P D P ; ; input: nothing ; output: r0 <> 0 if the other system is a KERMIT-11 system ; errors: none .psect $pdata pdplst: .byte pd$rsx ,pd$ias ,pd$rsts,pd$rt ,pd$pos ,0 .even .psect $code ispdp:: clr r0 ; presume failure cmpb at$sys ,#'D&137 ; a DEC system ? bne 100$ ; no, exit scan ,#pdplst 100$: return clratr::clr at$len clr at$typ clr at$cre clr at$id clr at$bil clr at$area clr at$pas clr at$bsiz clr at$acc clr at$enc clr at$dis clr at$pr0 clr at$pr1 clr at$sys clr at$for clr at$fab clr atrctx clr at$klu+0 clr at$klu+2 clr at$klu+4 clr at$klu+6 clr at$cdt return .sbttl finish up the update of rms file attributes to output ; A T R F I N ; ; If the file was send in image mode, and we have been sent ; valid attributes (basically, the sender's IFAB), then call ; PUTATR to place these attributes into our output file's ; IFAB so they will get updated. ; ; ; Note: 11-Jul-84 17:12:49 BDN, edit /19/ ; ; Note that for RSTS/E, we have an unusual problem in that if ; the sender sent a stream ascii file (most likely a file with ; NO attributes) over and the sender said it's binary, then ; RMS-11 sends GARBAGE for the VFC header size. When this data ; is wriiten into the output file's IFAB, RMS11 finds invalid ; data in the IFAB and writes attributes to disk with the last ; block field (F$HEOF and F$LEOF) equal to ZERO. Such a file ; would thus be unreadable to PIP, RMS and other programs that ; look at the file attributes. The fix is one of two things. ; One, we can clear the invalid VFC size and fudge the record ; size and maximum record size to something usable (like 512), ; or we can simply ignore the senders attributes and let K11ATRMAC[.050032]K11ATR.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|bddfthe ; file stand as a FIXED, NO CC, recordsize 512 file. Rather ; than to try to fix the attributes, we will simple ignore the ; attributes if the sender said that the file is stream ascii ; with a garbage VFC. Since the attributes are only used if ; the transfer was in image moed, this will not affect normal ; files, only files like DMS-500 files that have no attributes ; but must be sent in image mode. ; Of course, the sending Kermit-11 can always be given the SET ; ATT OFF and SET FIL BIN and the receiving Kermit-11 be given ; the SET FIL BIN and the issue will never arise. ; ; The mods are noted with /19/ after the statement. atrfin::save ; just in case please tst @r5 ; lun zero ? beq 100$ ; yep tst at$val ; valid attributes to write ? beq 100$ ; no tst at$cdt ; Ever set the creation date/time? beq 10$ ; No calls putcdt ,<@r5,#at$klu> ; Yes, update it 10$: cmpb at$typ ,#binary ; did we get this as a binary file? bne 100$ ; no mov #at$fab ,r1 ; yes tst (r1)+ ; valid data present ? beq 100$ ; no cmp @r1 ,#2000 ; /19/ stream ascii ? bne 30$ ; /19/ no cmp 16(r1) ,#177400 ; /19/ garbage for the vfc header size? beq 90$ ; /19/ yes, forget about the attributes 30$: calls putatr ,<@r5,r1> ; /19/ update the ifab for the file 90$: clr at$typ ; /19/ no longer valid please clr at$fab ; no longer valid please clr at$val ; no longer valid please 100$: clr at$cdt unsave ; output file and exit return .sbttl 32 bit arithmetic modules from RSX Syslib.olb $DMUL: MOV R0,-(SP) CLR R0 CLR R1 10$: TST (SP) BEQ 30$ ROR (SP) BCC 20$ ADD R3,R1 ADC R0 ADD R2,R0 20$: ASL R3 ROL R2 BR 10$ 30$: TST (SP)+ RETURN $DDIV: MOV R3,-(SP) MOV #40,R3 MOV R0,-(SP) CLR R0 10$: ASL R2 ROL R1 ROL R0 CMP R0,(SP) BCS 20$ SUB (SP),R0 INC R2 20$: DEC R3 BGT 10$ TST (SP)+ MOV (SP)+,R3 RETURN .end