.title MISCUTL Miscellaneous routines for IAF .ident /V1.01/ .sbttl Documentation ; ; These are the IAF subroutines that implement the ; EXIT, QUIT, HELP, and SPAWN commands ; ; Eric F. Richards ; 23-Apr-86 ; Gould OSD VAXcluster VAX/VMS V4.3 ; .sbttl Macros, constants, and other rot .enable suppression ; clean up the listing file .disable traceback, debug ; hands off with the debugger .macro clrsp space, fill=#0 ; macro for clearing space subl space, sp ; on stack for a data area. movc5 #0, (sp), fill, - ; data area is init'd to space, (sp) ; nulls by this macro .endm clrsp ; that's it! bufsiz = 132 ; size of internal character buffer .psect $code, long, exe, pic, shr, nowrt .sbttl HELP code .page ; ; This subroutine looks up the HELP information ; .entry help, ^m clrsp #bufsiz ; clear buffer for commadn line pushl sp ; build descriptor for it pushl #bufsiz ; ...length for descriptor movl sp, r5 ; save a pointer to the descr pushal topic ; build a descriptor for the pushl s^#topic_len ; ...topic label movl sp, r4 ; save a pointer to that one, too pushal libname ; build a descriptor for the lib name pushl #libname_len ; ...for the help to reference movl sp, r3 ; save a pointer to that desc, too! pushl r5 ; get the help topic to look up pushl r5 ; ...and write it (truncated) here pushl r4 ; ...label is TOPIC calls #3, g^cli$get_value ; get the value blbs r0, 10$ ; on success skip the error handler clrl (r5) ; set the descr length to 0 10$: pushal w^get_input ; call the help routine -- input here pushl #0 ; use default flags, too pushl r3 ; help library name pushl r5 ; parameter line to give it pushl #0 ; use default terminal width pushal w^put_output ; write the output with this calls #6, g^lbr$output_help ; go into help ret ; go back to caller .sbttl SPAWN command code .page .align long .entry SPAWN, ^m clrsp #bufsiz ; build a buffer for the command line pushl sp ; build a descriptor for said buffer pushl #bufsiz ; see above movl sp, r5 ; save a pointer to the command buffer pushal cmd ; build descriptor for the label pushl s^#cmd_len ; ... COMMAND for returning cmd line movl sp, r4 ; save a pointer to the label descr pushl r5 ; write length of command line here pushl r5 ; write command line here pushl r4 ; this is the label to evaluate calls #3, g^cli$get_value ; get that command line blbs r0, 100$ ; on error go away clrl (r5) ; set the string to null-length 100$: pushl r5 ; here is the command to spawn calls #1, g^lib$spawn ; spawn it! ret ; return with whatever error .sbttl Data areas for above code .page .psect $pdata, long, noexe, nowrt, pic, shr topic: .ascii /TOPIC/ ; label for HELP topics topic_len = . - topic ; length .align long ; cmd: .ascii /COMMAND/ ; label for SPAWN command cmd_len = . - cmd ; and its length .end ; that's it!