.title k11cm1 overlay for some command dispatching .ident /2.23/ ; 16-Oct-84 15:38:31 Brian Nelson ; ; Creation: 16-Oct-84 15:38:44 ; ; ; Copyright (C) 1983 1984 Change Software, Inc. ; ; ; This software is furnished under a license and may ; be used and copied only in accordance with the ; terms of such license and with the inclusion of ; the above copyright notice. This software or any ; other copies thereof may not be provided or other- ; wise made available to any other person. No title ; to and ownership of the software is hereby trans- ; ferred. ; ; The information in this software is subject to ; change without notice and should not be construed ; as a commitment by the author. ; .include /IN:K11MAC.MAC/ .include /IN:K11CDF.MAC/ .enabl gbl .psect .psect $code .sbttl the set command .enabl lsb c$set:: $name call loaset calls getcm0 ,<#argbuf,r0> mov r0 ,r2 bmi 110$ call loaset calls getcm1 ,<#argbuf,r0,r2> tst r0 bmi 110$ jsr pc ,@r1 tst r0 beq 100$ message ,cr 100$: return 110$: message ,cr return .dsabl lsb .sbttl the connect command c$conn::$name tstb argbuf ; anything in the arg buffer? beq 5$ ; no call set$li ; set the line then 5$: tst conesc ; an escape character set ? bne 10$ ; yes movb #con$esc,conesc ; no, set the default in 10$: copyz #ttdial ,#ttname ; insure correct name clr remote ; insure remote flag set call doconn ; do it message ; a cr/lf return ; back to command parser .sbttl the local directory and type commands .enabl lsb c$dir:: $name tstb defdir beq 10$ message print #defdir message 10$: calls dodir ,<#argbuf,#0> ; get the passed filespec for dir tst r0 ; do the directoty. did it work ? beq 100$ ; yes direrr r0 ; no, print the error 100$: return ; bye .dsabl lsb c$who:: calls systat ,<#0> return c$tran::calls transf ,<#argbuf,#0> return .sbttl the take command .enabl lsb c$take::$name sub #filsiz ,sp ; save current def dir mov sp ,r1 ; point to it copyz #defdir ,r1 ; done tst cmdlun ; indirect file already open ? beq 10$ ; no tst sy.ini ; during init from INI file? bne 5$ ; yes, don't bother with message message ,cr 5$: clr sy.ini ; not in an init file anymore calls close ,<#lun.ta> ; yes, please close it now clr cmdlun ; assume the next open will fail? 10$: copyz #200$ ,#defdir ; stuff take defaults in now calls open ,<#argbuf,#lun.ta,#text> tst r0 ; did the open for command file work? bne 90$ ; no, print error and exit 20$: mov #lun.ta ,cmdlun ; yes, stuff the unit number in br 100$ ; bye 90$: direrr r0 ; print a error message and exit clr cmdlun ; force input from KB: 100$: mov sp ,r1 ; restore old default directory copyz r1 ,#defdir ; simple add #filsiz ,sp ; copy def dir save area back return ; bye 200$: .asciz /SY:*.CMD/ .even .sbttl the SYSTEM command .enabl lsb c$sys:: $name tstb argbuf ; need something in ARGBUF bne 10$ ; oops message ,cr return 10$: strlen #argbuf ; get the current length so we add #argbuf ,r0 ; can stuff a carriage return movb #cr ,(r0)+ ; and a null in clrb @r0 ; all set now mov #200$ ,r5 ; call the PK driver call runjob ; simple tst r0 ; did it work ? beq 100$ ; yes message decout r0 message 100$: message return ; ierr = runjob(buffer,mode,10,timout) ; ; All parameters for RSTS are used so we can use the ; generalized PK code used also in MINITAB (C) and TED. ; For RSX11M/M+, only the first argument is needed. 200$: .word 4,argbuf,220$,230$,240$ ; parameter list 220$: .word 100305 ; internal mode for running on the PK 230$: .word 10. ; first free logical unit number 240$: .word 10. ; ten minutes and i kill the PK's job .dsabl lsb global c$spac::$name sub #120 ,sp ; allocate space for a buffer mov sp ,r1 ; point to it calls dskuse , ; get the usage string print r1 ; print it message ; a crlf add #120 ,sp ; pop the local buffer return ; and exit .end