ALWAYS 23SEP6 HELP ;23SEP6 ;************************************************************************ ;* * ;* Module: HELP - Print HELP message * ;* and: ./$ - Pass command to CLI for execution * ;* * ;* Author: Chris Doran * ;* * ;* Date: 14-Jul-83 * ;* * ;* Input Parameters: * ;* * ;* R0 Points to the command line in process * ;* * ;* Output parameters: * ;* * ;* R0 points just beyond the last character of the line * ;* * ;* Process command HELP {topic} * ;* * ;* If parent/offspring tasking is available, use the HELP utility, * ;* by spawning: * ;* * ;* HELP HEX COMMAND {topic} * ;* * ;* In addition, the . command, which just sends the rest of the line * ;* to the current CLI, is available. * ;* * ;* If parent/offspring tasking is not available, HELP just prints a * ;* command syntax summary, and . does a suspend or stop, ignoring rest * ;* of line. * ;* * ;* MODIFICATIONS RECORD * ;* ==================== * ;* CJD Jan 84 * ;* Edit fixed HELP message to show Aug 83 additions. * ;* CJD 17-Feb-84 * ;* Re-format fixed HELP to fit on page w/o losing aaaa ... line. * ;* Move CR generation at end of processing to HEX main module. * ;* CJD 7-Mar-84 * ;* Update fixed HELP message. * ;* * ;* 17-APR-84 Scott Smith, Telex Computer Products, Raliegh, NC * ;17APR4 ;* Disabled "." command with no argument if VMS coditional * ;17APR4 ;* assembly symbol is defined. * ;17APR4 ;* * ;17APR4 ;* Reworked call to help so that default qualifier is still * ;17APR4 ;* "COMMANDS" but specific commands are not sub-qualifiers of the * ;17APR4 ;* "COMMANDS" qualifier. (So that outside of hex you can say * ;17APR4 ;* "HELP HEX READ" instead of "HELP HEX COMMANDS READ") * ;17APR4 ;* * ;* CJD 22-Mar-85 * ;27MAR5 ;* Merge Jan-Mar/84 mods with 17-Apr-84. * ;27MAR5 ;* Squeeze USE into built-in HELP message and add WITH to COMPARE. * ;27MAR5 ;* * ;* CJD 8-May-86 * ;08MAY86 ;* Add /NOPAGE/NOPROMPT to VMS HELP, since VAX-11 RSX AME can't * ;08MAY86 ;* handle prompt from spawned native process. * ;08MAY86 ;* * ;23SEP6 ;* CJD 23-Sep-86 * ;23SEP6 ;* Add $ to fixed help message. Change {/} to [/] for DEC compat. * ;23SEP6 ;* * ;************************************************************************ .MCALL DIR$,SPWN$,STSE$S,WTSE$S,GTSK$C,STOP$S,SPND$S,CALLR HELP:: QM:: ; Also invoked by '?' .IF NDF P$$OFF OUTPUT HLP ; Output command syntax summary CALLR EXTRA ; Warn about command argument and return .IFF .ENABL LSB MOV #SUFFIX,%2 ; Address space for suffix TSTB (%0) ; Is there a qualifier? ;17APR4 BHI 10$ ; YES - continue ;17APR4 MOV #COMMND,%0 ; NO - use default (COMMANDS) ;17APR4 10$: MOVB (%0)+,(%2)+ ; Copy byte BEQ 20$ ; Until end of HELP argument CMP %2,#CMDMAX ; or end of command line space BLO 10$ 20$: MOV #HLPCMD,%0 ; Address start of command SUB %0,%2 ; Compute command length ; (less null, & allowing for following DEC) ; . (=CLI) command. STOP or SUSPEND if null. .IFT ; . (=CLI) command. Ignore rest of line, STOP or SUSPEND for user to issue ; CLI commands directly. .IFF ; Entry value of %2 is length of command, including "." .IFTF CLI:: DEC %2 ; Don't count . command introducer .IFF BLE 60$ ; Stop/suspend if all blank line 40$: MOV %0,SPWN+S.PWCA ; Store address of start of command MOV %2,SPWN+S.PWCL ; and length CLR SPWN+S.PWVT ;17APR4 DIR$ #SPWN ; and spawn command BCC 50$ ; OK if accepted OUTPUT SPE ; Else output error message SEC ; Set carry RETURN ; and return as if done 50$: .IF DF S$$TOP STSE$S #5 ; STOP for spawned task .IFF WTSE$S #5 ; Wait for spawned task .ENDC .DSABL LSB .IFF RETURN ; and return (s/b cc from wait) .IFTF ; Stop or suspend for user to issue multiple commands to CLI. First print out ; restart message, giving our task name for restart. 60$: .IFTF ;**-3 .ENABLE LSB ;17APR4 .IF DF VMS ;17APR4 OUTPUT NSV ; 'Command not supported by VMS' ;17APR4 BR 250$ ; and take error exit ;17APR4 .ENDC ;17APR4 .IFT ;17APR4 CALL EXTRA ; Complain if end of line not blank ; Stop anyway to let user issue command manually .IFTF GTSK$C RECORD,HELP ; Get task info, inc name, to RECORD MOV #RECORD+G.TSTN,%3 ; Address Radix-50 task name MOV #STP+STPLEN-11.,%0 ; and space for ASCII name .REPT 2 MOV (%3)+,%1 ; Get word CALL $C5TA ; Convert Radix-50 to ASCII .ENDR ; Twice OUTPUT STP ; Print stop or pause message .IF DF S$$TOP STOP$S ; STOP until UNS'd .IFF SPND$S ; PAUSE until RES'd .ENDC 250$: ;17APR4 255$: RETURN ; Then return to caller ;17APR4 .IFTF ;17APR4 .DSABL LSB ;17APR4 .PSECT DATA RW,D .IFF HLPCMD: .ASCII "HELP" ; HELP command starter ;08MAY86 .IIF DF VMS, .ASCII "/NOPAGE/NOPROMPT" ; Can't pause at screen end ;08MAY86 .ASCII " " ;08MAY6 HLPNAM::.ASCII "HEX " ; Global so that "HEX" can be patched ;08MAY6 SUFFIX: .BLKB 20. ; Space for longest HEX command name CMDMAX: .BYTE 0 ; Sentinel byte COMMND: .ASCIZ "COMMANDS" ;17APR4 .IFTF .IF DF S$$TOP DEFM STP ^/Stopping. To continue type UNS / .IFF DEFM STP ^/Pausing. To continue type RES / .ENDC .EVEN .IF DF VMS SPWN: SPWN$ DCL...,,,,,5 ; Spawn DCL .IFF .IF DF A$$CLI SPWN: SPWN$ CLI...,,,,,5 ; Spawn current CLI .IFF SPWN: SPWN$ MCR...,,,,,5 ; Spawn MCR .ENDC .ENDC ; {multi-}CLI support .PSECT PURE RO,D .IFF DEFM SPE .IFT ; Command syntax summary message for use when HELP can't be spawned. ; Create this message from the COMMAND section of HEX.HLP. HLP: .BYTE 15 .ASCII "AND range WITH pp MULTIPLY [SIGNED] range BY pp"<15><12> .ASCII "APPEND range [PARTIAL] [WIDTH vv/vvvv] FILE f NAME [nnnnnnnn]"<15><12> .ASCII "COMPARE [range] FILE f/WITH aaaa NEGATE range"<15><12> .ASCII "COMPLEMENT range [NO]ECHO"<15><12> .ASCII "COPY range TO cccc [REPEAT vvvv] OFFSET [aaaa]"<15><12> .ASCII "CRC range [TO ****] OR range WITH pp"<15><12> .ASCII "CSUM range READ [range] FILE filespec"<15><12> .ASCII "DECREMENT range [BY pp] REMAINDER [SIGNED] range BY pp"<15><12> .ASCII "DISPLAY [ASCII] range [FILE f] REVERSE range"<15><12> .ASCII "DIVIDE [SIGNED] range BY pp ROTATE LEFT/RIGHT [SIGNED] range [BY pp]"<15><12> .ASCII "EDIT aaaa [STEP ww] SEARCH range FOR pp/qqqq"<15><12> .ASCII "EXIT (or ctrl/Z) SHIFT LEFT/RIGHT [SIGNED] range [BY pp]"<15><12> .ASCII "FILL range WITH pp SUM range [TO ****]"<15><12> .ASCII "FORMAT [type [char]] TRANSFER [aaaa]"<15><12> .ASCII "HELP [command] USE vv OF vv FOR READ"<15><12> .ASCII "INCREMENT range [BY pp] WRITE range [PARTIAL] [WIDTH vv/vvvv] FILE f"<15><12> .ASCII "INIT [WITH pp] XOR range WITH pp"<15><12> .ASCII "MOVE BYTE/WORD FROM **** TO **** . or $ [CLI-command]"<15><12> .BYTE 12 .ASCII "aaaa is an address, vv/vvvv is an n-digit value, pp is a hex byte or 'char,"<15><12> .ASCII "**** is an address or pseudo-register (%vv), f is a filename,"<15><12> .ASCII "type is format: INTEL/MOTOROLA/ROCKWELL/RCA/TEKHEX/EXTENDED/TEXAS/MOSTEK/"<15><12> .ASCII " WHITESMITHS/RIM/BIN/HEX/OCTAL" .IIF DF TCI,.ASCII "/TCI" .ASCII "FAIRCHILD/SIRA/OBJECT/ABSOLUTE" .IIF DF TASK,.ASCII "/TASK" HLPLEN=.-HLP .ENDC .IIF DF VMS,DEFM NSV ;17APR4 .EVEN .END