prompt out now calls kbread ,<#ttbuff> ; Read a line from KB: tst r0 ; Successful terminal read? bne 100$ ; No, exit asap calls cvt$$ ,<#ttbuff,r1,#CVTARG> ; Remove garbage, LC to UC. tst r0 ; Anything left over ? beq 100$ ; No, exit please clrb ttbuff(r0) ; It was successfull, insure .ASCIZ strcat r4 ,#ttbuff ; Append the data just read please. jmp 10$ ; And parse the command all over again ; ; 100$: call hlpclo ; Close up the file and exit return .dsabl lsb .sbttl Parse HELP's command line ; PARSE ; ; Passed: r5 Command line, minus 'HELP', assumed to be .asciz ; Return: In topics, addresses to each topic/subtopic ; ; Extra imbedded spaces are removed parse: save ; Save temp please mov #topbuf ,r4 ; Where to copy the text to mov #topics ,r3 ; Where to place the pointers clr @r3 ; Assume nothing was passed ; 10$: tstb @r5 ; All done ? beq 100$ ; Yes, exit this routine cmpb @r5 ,#40 ; While (*ch && *ch == 40) ch++ ; bne 15$ ; Not a space, exit inc r5 ; A space found, check next one br 10$ ; Next 15$: mov r4 ,(r3)+ ; Insert current address clr @r3 ; Insure NEXT is cleared out 20$: tstb @r5 ; All done with this line ? beq 30$ ; Yes, exit cmpb @r5 ,#40 ; Space delimiter found ? beq 30$ ; Yes, setup for next one movb (r5)+ ,(r4)+ ; No, copy some data over br 20$ ; Next please 30$: clrb (r4)+ ; Insure .asciz please br 10$ ; Next subtopic 100$: unsave ; Pop registers and exit return .sbttl find the topic in the help file .enabl lsb ; Input: topics list of addresses of text to match ; Return: R0 zero for success, 1 for not found, else RMS error code ; two for match and wildcarded topic/subtopic hfind: save ; Save registers we may trash here calls rewind ,<#LUN.IN> ; Rewind to start of the file mov #topics ,r5 ; Point to the help topic list mov #'1 ,r2 ; Current topic level clrb htopic ; Clear header out ; 10$: tst @r5 ; Anything to look for ? beq 100$ ; No, just leave pointing at beginning mov #hlpbuf ,r4 ; Pointer to buffer to use tst cccnt ; Control C typed? bne 90$ ; Yes, please exit this loop clrb @r4 ; Preset to a null string calls getrec , ; Read a record from the file tst r0 ; Errors on the read ? beq 20$ ; no cmp r0 ,#ER$EOF ; End of file reached ? beq 90$ ; Yes, return(1) 20$: clrb hlpbuf(r1) ; Insure .asciz please cmpb @r4 ,r2 ; Topic levels match up? bne 80$ ; No, read another record then inc r4 ; Skip over the level flag now 30$: tstb @r4 ; End of the line beq 80$ ; Yes, read another record cmpb @r4 ,#40 ; No, skip over spaces now bne 40$ ; No more spaces, time to check topic inc r4 ; Spaces, skip over please br 30$ ; Next please 40$: mov (r5) ,r3 ; Get pointer to text to match up cmpb (r3) ,#'* ; Wildcarding ? beq 85$ ; Yes, return(2) ; 50$: tstb (r3) ; Found the end of the desired topic? beq 70$ ; Yes, check for next level topic needed tstb (r4) ; End of the line yet ? beq 80$ ; Yes. movb (r4)+ ,r0 ; Convert to upper case cmpb r0 ,#'a!40 ; Is this a lower case letter blo 55$ ; No cmpb r0 ,#'z!40 ; Keep checking... bhi 55$ ; No bicb #40 ,r0 ; Convert to upper case 55$: cmpb (r3)+ ,r0 ; No, do the characters match up? beq 50$ ; Yes, keep checking them br 80$ ; No, read another record. ; 70$: inc r2 ; Match, increment level number and read tst (r5)+ ; another record from the help file. strcat #htopic ,#hlpbuf+1 ; Build up a header record 80$: br 10$ ; Next please 85$: mov #2 ,r0 ; Match with wildcarding mov r2 ,toplev ; Save the topic level and exit br 110$ ; Exit ; 90$: mov #1 ,r0 ; Not found (reached end of file) br 110$ ; Exit ; 100$: mov r2 ,toplev ; Save topic level dec toplev ; It will be off by one clr r0 ; Found the topic 110$: unsave ; Pop registers and exit reK11HLPMAC[.050032]K11HLP.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(sp) ; Allocate some buffers clr -(sp) ; Allocate some buffers mov sp ,idxdmp ; Flag that we have been here mov sp ,r5 ; And a pointer to such movb 2+<6*2>(sp),2(r5) ; Get the topic level passed. mov #idxbuf ,r3 ; Get a buffer to store names in mov #hlpbuf ,r4 ; Point to the help buffer now cmpb 2(r5) ,#'1 ; Is this the MAIN menu today? bhi 10$ ; No, don't reposition the file calls rewind ,<#LUN.IN> ; It is the main, reset the file clrb hlpbuf ; Flag that nothings there 10$: Message < Additional information is available on:>,cr Message ; An extra CR/LF Message ; CRLF please strcpy r3 ,#fill5 ; Move over a bit mov #4 ,(r5) ; Number of topic names per line clr cccnt ; Insure control C count is zapped ; 30$: tstb @r4 ; Do we need to load the buffer? bne 40$ ; No calls getrec , ; Yes, preload the buffer now. tst r0 ; Did we reach end of file? bne 80$ ; Yes, exit please clrb hlpbuf(r1) ; Always .asciz please 40$: tst cccnt ; If control C then exit bne 90$ ; Exit then cmpb @r4 ,#40 ; Is this a null line or a text line? blos 60$ ; If so, ignore it. cmpb @r4 ,2(r5) ; Must be a topic line, check the level bhi 60$ ; Higher level, ignore it blo 80$ ; Lower level, we need to exit clrb 21(r4) ; Insure no more than 16 characters inc r4 ; Skip the level number on the line strcat r3 ,r4 ; Add on the current topic now strlen r4 ; Now compute the number of spaces dec r4 ; Fix the pointer up to startofline mov #22 ,r2 ; Assume worst case of 18 spaces needed sub r0 ,r2 ; We now have the number of spaces. 50$: strcat r3 ,#filler ; Loop adding the spaces in sob r2 ,50$ ; Terribly inefficient, but so what. dec (r5) ; Is there room left for the next one? bne 60$ ; Yes, go and get some more print r3 ; No, we have to dump and reset things message ; A cr/lf mov #4 ,(r5) ; Reset the counter now strcpy r3 ,#fill5 ; Reset the line buffer ; 60$: clrb @r4 ; Force a read next time br 30$ ; Next please 80$: print r3 ; End of file, dump whats left over message ; And exit. clr r0 ; Success br 100$ ; Bye ; 90$: mov #-1 ,r0 ; Failure exit ; 100$: cmp (sp)+ ,(sp)+ ; Pop some local buffers... unsave ; Pop registers and exit mov (sp)+ ,(sp) ; Pop return address up and exit return ; Exit now .dsabl lsb .sbttl open and close the kermit-11 help file up .enabl lsb ; This code was taken verbatim from the old K11HLP.MAC hlpclo: calls close ,<#lun.in> return hlpopn: call getprv ; seems to be needed mov #hnames ,r1 ; the list of help file names call getsys ; if this is RT11 use something cmpb r0 ,#sy$rt ; reasonable please bne 10$ ; not RT mov #rtname ,r1 ; RT11, try DK: and SY: 10$: mov r1 ,r2 ; Save it 20$: tst @r1 ; end of the list as of yet ? beq 70$ ; yes, can't find the help file calls fopen ,<@r1,#lun.in,#text,#2>; try hard to open the help file tst r0 ; did it work ? beq 100$ ; yes tst (r1)+ ; no, try the next help filename br 20$ ; next please 70$: message <%Kermit-11-W Cannot find the Kermit-11 help files or>,cr message ,cr message ,cr message ; 80$: tst @r2 ; Any more left beq 90$ ; No print @r2 ; Yes, print the name of the file message ; A crlf tst (r2)+ ; Point to next br 80$ ; Next please 90$: mov #ER$FNF ,r0 ; return file not found 100$: call drpprv ; please no more privs return ; return with it open or not found .dsabl lsb .save .psect rodata ,ro,d,lcl,rel,con hnames::.word 10$,20$,30$,40$,0 10$: .asciz /LB:[1,2]K11HLP.HLP/ 20$: .asciz /SY:[1,2]K11HLP.HLP/ 30$: .asciz /KERMIT:K11HLP.HLP/ 40$: .asciz /HELP:K11HLP.HLP/ .even rtname: .word 10$,20$,0 10$: .asciz /DK:K11HLP.HLP/ 20$: .asciz /SY:K11HLP.HLP/ .even .restore global .end K11HLPMAC[.050032]K11HLP.MAC[.050032]l   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\\\\\