.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. ; ; 12-Sep-86 10:39:27 BDN Convert for I/D space .if ndf, K11INC .ift .include /IN:K11MAC.MAC/ .include /IN:K11CDF.MAC/ .endc .enabl gbl .psect .psect $code .sbttl the set command .enabl lsb ; Note: For edit /41/ the call to GETPRV for MicroRSX has been ; placed in ASSDEV, which is ONLY called from SET LINE (SET$LI) c$set:: $name call loaset calls getcm0 , mov r0 ,r2 bmi 110$ call loaset calls getcm1 , tst r0 bmi 110$ jsr pc ,@r1 tst r0 beq 100$ message ,cr inc status 100$: return 110$: message ,cr inc status return .dsabl lsb .sbttl the connect command c$conn::$name tst con$dsp ; /44/ SET [RSX] [CONNECT] done? bne 1$ ; /44/ Yes mov #doconn ,con$dsp ; /44/ No, insert default routine 1$: 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 mov recdlm ,-(sp) ; /56/ Save RMS record delimiter mov #12 ,recdlm ; /56/ Change to write on line feeds call @con$dsp ; /44/ Call the user's choice mov (sp)+ ,recdlm ; /56/ Restore put$ trigger char message ; a cr/lf return ; back to command parser GLOBAL ; /44/ GLOBAL ; /44/ GLOBAL ; /56/ .sbttl the local directory and type commands .enabl lsb c$dir:: $name tstb defdir beq 10$ message print #defdir message 10$: calls dodir , ; 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 , 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 tst infomsg ; /41/ How verbose are we today? beq 5$ ; /41/ Not very 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 , 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 .save .psect $PDATA ,D 200$: .asciz /SY:*.CMD/ .even .restore .dsabl lsb global .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 argbuf ,200$+2 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. .save .psect $PDATA ,D 200$: .word 4,0,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 .restore .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 .sbttl the local type command .enabl lsb .save .psect buffer ,rw,d,lcl,rel,con buffer: .blkb 1000 .restore c$type::$name mov #buffer ,r4 ; and point to it of course calls fparse , ; parse the filename please tst r0 ; did the $parse work ok ? bne 90$ ; no print r4 ; yes, print the expanded name out message 5$: clr r2 ; assume file not open calls open ,; try to open passed filename tst r0 ; but did the open work out ? bne 90$ ; no com r2 ; flag it as being open please 10$: tst cccnt ; control C typed ? bne 90$ ; yes, abort this calls getrec , ; get the next record tst r0 ; did it work ? bne 90$ ; no 20$: tst r1 ; null record (ie, cr/lf only) ? beq 30$ ; yep print r4,r1 ; dump the record 30$: message ; a cr/lf br 10$ ; next record please 90$: tst r0 ; forced exit ? beq 95$ ; yes cmp r0 ,#ER$EOF ; end of file ? beq 95$ ; yes, its ok direrr r0 ; no, print the error out 95$: tst r2 ; is the type file open ? beq 100$ ; no 96$: calls close ,<#lun.in> ; yes, please close it up now 100$: return global .dsabl lsb .sbttl print command c$prin::calls qspool , direrr r0 return .end