	.TITLE	HELP
	.IDENT	"V1.8"
	.NLIST	BEX
;
;   Author:	D. Mischler	15-JUN-87
;
;   This module displays helpful text upon request.
;
CR	=	'M-100
LF	=	'J-100

	.MCALL	QIOW$S

	.PSECT	CODE,I,RO
;
;   Analyze remainder of command line for parameters.
;
HELP::
	MOV	#GENHLP,R2	; Point to general help text.
	CALL	U$FNXT		; Find next parameter, OK?
	BCS	10$		; No, dump general help text.
	MOV	#HLPTBL,R1	; Point to help dispatching table.
	CALL	U$DCOD		; Attempt to decode parameter keyword, OK?
	BCS	30$		; No, complain.
10$:	MOV	R2,R0		; Copy text address.
20$:	TSTB	(R0)+		; Found end of text yet?
	BNE	20$		; No, keep looking.
	DEC	R0		; Fix end pointer.
	SUB	R2,R0		; Get text length.
	QIOW$S	#IO.WVB,#TI,#IOEFN,,,,<R2,R0>
	RETURN

;   Here if an unknown parameter is passed.
30$:	CALLR	ERROR		; Dump error message and exit.
	.PAGE
	.PSECT	RODATA,D,RO
;
;   Help keyword table.
;
HLPTBL:
	KEYWRD	CANCEL,CANHLP
	KEYWRD	DEFINE,DEFHLP
	KEYWRD	DEPOSIT,DEPHLP
	KEYWRD	EVALUATE,EVAHLP
	KEYWRD	EXAMINE,EXAHLP
	KEYWRD	EXIT,EXIHLP
	KEYWRD	EXPRESSIONS,EXPHLP
	KEYWRD	GO,GOHLP
	KEYWRD	HELP,HLPHLP
	KEYWRD	LOAD,LODHLP
	KEYWRD	MODES,MODHLP
	KEYWRD	RANGES,RNGHLP
	KEYWRD	SET,SETHLP
	KEYWRD	SHOW,SHOHLP
	KEYWRD	STEP,STPHLP
	KEYWRD	TYPES,TYPHLP
	KEYWRD	UNDEFINE,UNDHLP
	.WORD	0

	.PSECT	STRING,D,RO
;
;   General help text.
;
GENHLP:	.BYTE	LF
.ASCII <CR><LF>"Help is available on the following commands and features:"<LF>
.ASCII <CR><LF>"CANCEL	DEFINE	DEPOSIT	EVALUATE  EXAMINE  EXIT"
.ASCII <CR><LF>"expressions	GO	HELP	LOAD	modes"
.ASCII <CR><LF>"ranges	SET	SHOW	STEP	types	UNDEFINE"
	.BYTE	LF,0

;
;   CANCEL help text.
;
CANHLP:	.BYTE	LF
 .ASCII	<CR><LF>"Eliminates one or more break, trace, or watchpoints,"
 .ASCII	<CR><LF>"or all profile ranges."<LF>
 .ASCII	<CR><LF>"Cancel[/All] [Break,Trace,Watch] (address list)"
 .ASCII	<CR><LF>"Cancel Profile"
 .BYTE	LF,0

;
;   DEFINE help text.
;
DEFHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Defines a symbol with the specified value."<LF>
	.ASCII	<CR><LF>"DEFine symbol=value"
	.BYTE	LF,0

;
;   DEPOSIT help text.
;
DEPHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Deposits one or more values in memory.  Types are"
	.ASCII	<CR><LF>"Byte, Instruction (separate with ;), Word (default)."
	.ASCII	<CR><LF><LF>"DEPosit[/type] address=value[,value]"
	.BYTE	LF,0

;
;   EVALUATE help text.
;
EVAHLP:	.BYTE	LF
 .ASCII	<CR><LF>"Evaluates an expression and displays the value in signed and"
 .ASCII	<CR><LF>"unsigned decimal, binary, octal, hexadecimal, RAD50 and ASCII."
 .ASCII	<LF><CR><LF>"EValuate expression"
	.BYTE	LF,0

;
;   EXAMINE help text.
;
EXAHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Displays the specified value(s) or range(s)."<LF>
	.ASCII	<CR><LF>"EXAmine[/mode][/type] range[,range]"
	.BYTE	LF,0

;
;   EXIT help text.
;
EXIHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Terminates the debugging session."<LF>
	.ASCII	<CR><LF>"EXIt"
	.BYTE	LF,0

;
;   Expressions help text.
;
EXPHLP:
 .ASCII	<CR><LF>"All addresses and numeric values in a command are represented"
 .ASCII	<CR><LF>"by expressions.  Expressions may contain constants, symbols,"
 .ASCII	<CR><LF>"and operators.  Constants are normally interpreted according"
 .ASCII	<CR><LF>"to the current radix, but this may be overridden by a monadic"
 .ASCII <CR><LF>"operator.  A constant is assumed to be decimal if it is fol-"
 .ASCII <CR><LF>"lowed by a period.  Symbols may consist of the letters A-Z,"
 .ASCII <CR><LF>"the digits 0-9, and the special characters '.', and '$'."
 .ASCII <CR><LF>"Symbols may not begin with a decimal digit.  There are two"
 .ASCII <CR><LF>"kinds of operators: monadic and dyadic.  Monadic operators"
 .ASCII <CR><LF>"take only a single value, and are right-associative.  Dyadic"
 .ASCII <CR><LF>"operators require two values and are left-associative.  Angle"
 .ASCII <CR><LF>"brackets '<>' may be used to specify evaluation order."<LF>
 .ASCII <CR><LF>"The following monadic operators exist:"<LF>
 .ASCII <CR><LF>/' = ASCII byte   " = ASCII word   @ = indirect   - = negation/
 .ASCII <CR><LF>"^B = binary   ^C = 1's complement   ^D = decimal   ^O = octal"
 .ASCII <CR><LF>"^R or % = RAD50   ^X = hexadecimal"<LF>
 .ASCII <CR><LF>"The following dyadic operators exist:"<LF>
 .ASCII <CR><LF>"+ = add   & = and   / = divide   * = multiply   ! = or"
 .ASCII <CR><LF>"- = subtract"
	.BYTE	0

;
;   GO help text.
;
GOHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Begins or resumes program execution."<LF>
	.ASCII	<CR><LF>"Go [address]"
	.BYTE	LF,0

;
;   HELP help text.
;
HLPHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Displays brief help text on various topics."
	.ASCII	<CR><LF>/For a list of topics type "HELP" with no topic./<LF>
	.ASCII	<CR><LF>"Help [topic]"
	.BYTE	LF,0

;
;   LOAD help text.
;
LODHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Loads a symbol table file into the symbol table."<LF>
	.ASCII	<CR><LF>"Load file"
	.BYTE	LF,0

;
;   Modes help text.
;
MODHLP:	.BYTE	LF
.ASCII <CR><LF>"There are several mode parameters that may be set by the user."
.ASCII <CR><LF>"The SET MODE command may be used to permanently set these"
.ASCII <CR><LF>"parameters.  In addition, several commands permit qualifiers"
.ASCII <CR><LF>"which set the parameters for that command only."<LF>
.ASCII <CR><LF>"The following mode parameters currently exist:"<LF>
.ASCII <CR><LF>"Leading zeroes		- Leading, NOLeading"
.ASCII <CR><LF>"Radix			- Binary, Decimal, Hexadecimal, Octal"
.ASCII <CR><LF>"Signed values		- SIGned, Unsigned"
.IF DF I$MTPS
.ASCII <CR><LF>"Simulation of stepped	- SIMulate, NOSIMulate"
.ASCII <CR><LF>"	instructions"
.ENDC
.ASCII <CR><LF>"Single value/line	- SINgle, NOSINgle"
.ASCII <CR><LF>"Symbolic values 	- SYmbolic, NOSYmbolic"
	.BYTE	LF,0

;
;   Ranges help text.
;
RNGHLP:	.BYTE	LF
 .ASCII <CR><LF>"Several commands allow an address range as a parameter."
 .ASCII <CR><LF>"Such a range is normally specified by a start address and"
 .ASCII <CR><LF>"an end address separated by a colon with no intervening"
 .ASCII <CR><LF>"spaces.  If no colon or end address is specified then the"
 .ASCII <CR><LF>"start and end addresses will be the same."<LF>
 .ASCII <CR><LF>"(start address)[:(end address)]"
	.BYTE	LF,0

;
;   SET help text.
;
SETHLP:	.BYTE	LF
 .ASCII	<CR><LF>"Sets various debugger parameters."<LF>
 .ASCII	<CR><LF>"SEt Break (address list)"
.IF DF I$MTPS
 .ASCII <CR><LF>"SEt History (# of instructions)"
.ENDC
 .ASCII	<CR><LF>"SEt Log (log file name)"
 .ASCII	<CR><LF>"SEt Mode mode [mode]"
 .ASCII	<CR><LF>"SEt Output [(NO)Attach] [(NO)Log] [(NO)Term] [(NO)Verify]"
 .ASCII	<CR><LF>"SEt Profile range [compression factor]"
 .ASCII	<CR><LF>"SEt TRace (address list)"
 .ASCII	<CR><LF>"SEt TYpe type"
 .ASCII	<CR><LF>"SEt Watch (address list)"
 .BYTE	LF,0

;
;   SHOW help text.
;
SHOHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Displays various debugger parameters."
	.ASCII	<CR><LF>"The following parameters may be shown:"<LF>
.IF DF I$MTPS
	.ASCII	<CR><LF>"Break	History[/Instructions][/Registers][ Count]"
	.ASCII	<CR><LF>"Mode	Output	Profile[/Counters]"
.IFF
	.ASCII	<CR><LF>"Break	Mode	Output	Profile[/Counters]"
.ENDC
	.ASCII	<CR><LF>"Symbol	TRace	TYpe	Watch"
	.BYTE	LF,0

;
;   STEP help text.
;
STPHLP:	.BYTE	LF
	.ASCII	<CR><LF>"Executes one or more machine instructions."<LF>
	.ASCII	<CR><LF>"STep [step count]"
	.BYTE	LF,0

;
;   Types help text.
;
TYPHLP:	.BYTE	LF
.ASCII <CR><LF>"Several data types are understood by the debugger.  The"
.ASCII <CR><LF>"default data type may be set with the SET TYPE command."
.ASCII <CR><LF>"In addition, several commands allow type qualifiers."
.ASCII <CR><LF>"The following data types are recognized:"<LF>
.ASCII <CR><LF>"ADdress	AScii	Byte	Instruction	Rad50	Word"
	.BYTE	LF,0

;
;   UNDEFINE help text.
;
UNDHLP:	.BYTE	LF
.ASCII	<CR><LF>"Removes one or more symbols from the symbol table."<LF>
.ASCII	<CR><LF>"Undefine symbol[,symbol]"
	.BYTE	LF,0

	.END
