
		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   1
								 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (1)

;	  0001	%title 'VAXHELP'
;	  0002	%sbttl 'VAX help routines'
;	  0003	MODULE VAXHELP (IDENT = '01.00'
;	  0004		,addressing_mode(external=general,nonexternal=general)) =
;	  0005	BEGIN
;	  0006	!+
;	  0007	!
;	  0008	!			  Free software BY
;	  0009	!		Project Software & Development, Inc.
;	  0010	!
;	  0011	! This  software  is  furnished  for  free and may be used and copied as
;	  0012	! desired.  This software or any other copies thereof may be provided or
;	  0013	! otherwise  made  available  to  any  other  person.  No  title  to and
;	  0014	! ownership of the software is hereby transferred or allowed. 
;	  0015	!
;	  0016	! The  information  in this software is subject to change without notice
;	  0017	! and  should  not  be  construed  as  a commitment  by PROJECT SOFTWARE
;	  0018	! AND DEVELOPMENT, INC.
;	  0019	!
;	  0020	! PROJECT SOFTWARE assumes no responsibility for the use or  reliability  
;	  0021	! of this software on any equipment whatsoever.
;	  0022	!
;	  0023	!	Project Software & Development, Inc.
;	  0024	!	14 Story St.
;	  0025	!	Cambridge, Ma. 02138
;	  0026	!	617-661-1444
;	  0027	!
;	  0028	!
;	  0029	! FACILITY:
;	  0030	!	
;	  0031	!	VAXNET
;	  0032	!
;	  0033	! ABSTRACT:
;	  0034	!
;	  0035	!	General routines to get help from help libraries.
;	  0036	!
;	  0037	! ENVIRONMENT:
;	  0038	!
;	  0039	!	VAX/VMS user mode, native code
;	  0040	!
;	  0041	! AUTHOR:	R. Miller,	CREATION: December 2, 1982
;	  0042	!
;	  0043	! MODIFIED BY:
;	  0044	!
;	  0045	! 	, : VERSION
;	  0046	! 01	- 
;	  0047	!--

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   2
01.00		VAX help routines				 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (2)

;	  0048	!
;	  0049	! TABLE OF CONTENTS:
;	  0050	!
;	  0051	
;	  0052	FORWARD ROUTINE
;	  0053		vax_get_help,
;	  0054		format_output;
;	  0055	
;	  0056	!
;	  0057	! INCLUDE FILES:
;	  0058	!
;	  0059	library
;	  0060		'SYS$LIBRARY:LIB';
;	  0061	
;	  0062	!
;	  0063	! MACROS:
;	  0064	!
;	  0065	
;	  0066	!
;	  0067	! EQUATED SYMBOLS:
;	  0068	!
;	  0069	
;	  0070	!
;	  0071	! EXTERNAL REFERENCES:
;	  0072	!
;	  0073	external routine
;	  0074		lib$get_input,
;	  0075		lib$put_output,
;	  0076		lbr$output_help;
;	  0077	
;	  0078	!
;	  0079	! OWN STORAGE:
;	  0080	!
;	  0081	own
;	  0082		help_flags : initial (hlp$m_process+
;	  0083					hlp$m_group+hlp$m_system+hlp$m_liblist),
;	  0084		line_count : initial (0),	! Used for counting lines output.
;	  0085		max_line_count : initial (24),	! Maximum number of lines to output.
;	  0086		library_ptr : initial (0);	! Pointer to library descriptor to use.
;	  0087	
;	  0088	bind
;	  0089		def_lib_nam = $descriptor('SYS$HELP:HELPLIB.HLB'),
;	  0090		lib_log_nam = $descriptor('HELPLIB');
;	  0091	

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   3
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (3)

;	  0092	%sbttl 'vax_get_help'
;	  0093	GLOBAL ROUTINE vax_get_help	(outrtn_adr
;	  0094					,line_width
;	  0095					,max_count
;	  0096					,key_desc) =
;	  0097	
;	  0098	!++
;	  0099	!
;	  0100	! FUNCTIONAL DESCRIPTION:
;	  0101	!	
;	  0102	!	General Help Utility interface
;	  0103	!
;	  0104	! FORMAL PARAMETERS:
;	  0105	!
;	  0106	!	outrtn_adr	Optional address of an output routine (linkage call)
;	  0107	!			the output routine must return a status value.
;	  0108	!	line_width	Optional address of a value specifying the width
;	  0109	!			of the output line.
;	  0110	!	max_count	Optional address of a value specifying the number
;	  0111	!			of times the output routine gets called before
;	  0112	!			a pause occurs.
;	  0113	!	key_desc	Help string descriptor to pass to lbr$output_help.
;	  0114	!
;	  0115	! IMPLICIT INPUTS:
;	  0116	!
;	  0117	!	NONE
;	  0118	!
;	  0119	! IMPLICIT OUTPUTS:
;	  0120	!
;	  0121	!	NONE
;	  0122	!
;	  0123	! ROUTINE VALUE:
;	  0124	! COMPLETION CODES:
;	  0125	!
;	  0126	!	returns lbr status return values
;	  0127	!
;	  0128	! SIDE EFFECTS:
;	  0129	!
;	  0130	!	signals all lbr errors
;	  0131	!
;	  0132	!--
;	  0133	
;	  0134	BEGIN
;	  0135	
;	  0136	builtin
;	  0137		actualcount,
;	  0138		nullparameter;
;	  0139	literal
;	  0140		buflen = 128;
;	  0141	own
;	  0142		rslog_buf  : vector[buflen,byte],
;	  0143		rslog_desc : vector[2];
;	  0144	
;	  0145	local
;	  0146		outrtn,
;	  0147		width,
;	  0148		status;

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   4
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (3)

;	  0149	
;	  0150		status = ss$_normal;		! Assume success.
;	  0151	
;	  0152	!	Return failure if not enough parameters.
;	  0153	
;	  0154		if (actualcount() neq 4) then return (0);
;	  0155	
;	  0156		if .library_ptr eql 0 then
;	  0157		begin
;	  0158		rslog_desc[0] = buflen;		! Maximum length of logical name.
;	  0159		rslog_desc[1] = rslog_buf;	! Store translated name here.
;	  0160	
;	  0161	!	Setup a pointer to the help library to use.
;	  0162	
;	P 0163		if ($trnlog	(lognam = lib_log_nam
;	P 0164				,rsllen = rslog_desc
;	  0165				,rslbuf = rslog_desc) eql ss$_normal)
;	  0166		then
;	  0167			library_ptr = rslog_desc
;	  0168		else
;	  0169			library_ptr = def_lib_nam;
;	  0170		end;
;	  0171	
;	  0172		outrtn =(if not nullparameter(1) then .outrtn_adr else format_output);
;	  0173		width = (if not nullparameter(2) then .line_width else 80);
;	  0174		max_line_count = (if not nullparameter(3) then .max_count else 24);
;	  0175	
;	  0176		line_count = 0;			! Initialize starting line count.
;	  0177	
;	  0178		if not (status = lbr$output_help (
;	  0179				.outrtn		! Output routine.
;	  0180				,width		! Maximum line width.
;	  0181				,.key_desc	! Address of string descriptor.
;	  0182				,.library_ptr	! Pointer to library descriptor.
;	  0183				,help_flags	! Help flags.
;	  0184				,0
;	  0185				)
;	  0186			) then signal (.status);
;	  0187	
;	  0188		return .status;
;	  0189	
;	  0190	END;			!End of vax_get_help


									  .TITLE  VAXHELP VAXHELP
									  .IDENT  \01.00\

									  .PSECT  $PLIT$,NOWRT,NOEXE,2

49  4C  50  4C  45  48  3A  50  4C  45  48  24  53  59  53  00000 P.AAB:  .ASCII  \SYS$HELP:HELPLIB.HLB\		      ;
					42  4C  48  2E  42  0000F							      ;
						  00000014  00014 P.AAA:  .LONG   20					      ;
						  00000000' 00018 	  .ADDRESS P.AAB				      ;
				42  49  4C  50  4C  45  48  0001C P.AAD:  .ASCII  \HELPLIB\				      ;
							    00023	  .BLKB   1
						  00000007  00024 P.AAC:  .LONG   7					      ;
						  00000000' 00028 	  .ADDRESS P.AAD				      ;

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   5
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (3)


									  .PSECT  $OWN$,NOEXE,2

						  0000001E  00000 HELP_FLAGS:
									  .LONG   30					      ;
						  00000000  00004 LINE_COUNT:
									  .LONG   0					      ;
						  00000018  00008 MAX_LINE_COUNT:
									  .LONG   24					      ;
						  00000000  0000C LIBRARY_PTR:
									  .LONG   0					      ;
							    00010 RSLOG_BUF:
									  .BLKB   128
							    00090 RSLOG_DESC:
									  .BLKB   8

								  DEF_LIB_NAM=	      P.AAA
								  LIB_LOG_NAM=	      P.AAC
									  .EXTRN  LIB$GET_INPUT, LIB$PUT_OUTPUT
									  .EXTRN  LBR$OUTPUT_HELP
									  .EXTRN  SYS$TRNLOG

									  .PSECT  $CODE$,NOWRT,2

						       000C 00000 	  .ENTRY  VAX_GET_HELP, Save R2,R3		      ; 0093
				       53 00000000'  00  9E 00002 	  MOVAB   LIBRARY_PTR, R3			      ;
				       5E	     04  C2 00009 	  SUBL2   #4, SP				      ;
				       52	     01  D0 0000C 	  MOVL    #1, STATUS				      ; 0150
				       04	     6C  91 0000F 	  CMPB    (AP), #4				      ; 0154
						     03  13 00012 	  BEQL    1$					      ;
						   00AC  31 00014 	  BRW     11$					      ;
						     63  D5 00017 1$:	  TSTL    LIBRARY_PTR				      ; 0156
						     38  12 00019 	  BNEQ    3$					      ;
				0084   C3	80   8F  9A 0001B 	  MOVZBL  #128, RSLOG_DESC			      ; 0158
				0088   C3	04   A3  9E 00021 	  MOVAB   RSLOG_BUF, RSLOG_DESC+4		      ; 0159
						     7E  7C 00027 	  CLRQ    -(SP)					      ; 0165
						     7E  D4 00029 	  CLRL    -(SP)					      ;
					      0084   C3  9F 0002B 	  PUSHAB  RSLOG_DESC				      ;
					      0084   C3  9F 0002F 	  PUSHAB  RSLOG_DESC				      ;
					  00000000'  00  9F 00033 	  PUSHAB  LIB_LOG_NAM				      ;
			    00000000G  00	     06  FB 00039 	  CALLS   #6, SYS$TRNLOG			      ;
				       01	     50  D1 00040 	  CMPL    R0, #1				      ; 0163
						     07  12 00043 	  BNEQ    2$					      ;
				       63     0084   C3  9E 00045 	  MOVAB   RSLOG_DESC, LIBRARY_PTR		      ; 0167
						     07  11 0004A 	  BRB     3$					      ; 0163
				       63 00000000'  00  9E 0004C 2$:	  MOVAB   DEF_LIB_NAM, LIBRARY_PTR		      ;
						     6C  95 00053 3$:	  TSTB    (AP)					      ; 0172
						     0B  1B 00055 	  BLEQU   4$					      ;
						04   AC  D5 00057 	  TSTL    4(AP)					      ;
						     06  13 0005A 	  BEQL    4$					      ;
				       51	04   AC  D0 0005C 	  MOVL    OUTRTN_ADR, OUTRTN			      ;
						     07  11 00060 	  BRB     5$					      ;
				       51 00000000V  00  9E 00062 4$:	  MOVAB   FORMAT_OUTPUT, OUTRTN			      ;
				       02	     6C  91 00069 5$:	  CMPB    (AP), #2				      ; 0173
						     0B  1F 0006C 	  BLSSU   6$					      ;
						08   AC  D5 0006E 	  TSTL    8(AP)					      ;
						     06  13 00071 	  BEQL    6$					      ;

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   6
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (3)

				       50	08   AC  D0 00073 	  MOVL    LINE_WIDTH, R0			      ;
						     04  11 00077 	  BRB     7$					      ;
				       50	50   8F  9A 00079 6$:	  MOVZBL  #80, R0				      ;
				       6E	     50  D0 0007D 7$:	  MOVL    R0, WIDTH				      ;
				       03	     6C  91 00080 	  CMPB    (AP), #3				      ; 0174
						     0B  1F 00083 	  BLSSU   8$					      ;
						0C   AC  D5 00085 	  TSTL    12(AP)				      ;
						     06  13 00088 	  BEQL    8$					      ;
				       50	0C   AC  D0 0008A 	  MOVL    MAX_COUNT, R0				      ;
						     03  11 0008E 	  BRB     9$					      ;
				       50	     18  D0 00090 8$:	  MOVL    #24, R0				      ;
				  FC   A3	     50  D0 00093 9$:	  MOVL    R0, MAX_LINE_COUNT			      ;
						F8   A3  D4 00097 	  CLRL    LINE_COUNT				      ; 0176
						     7E  D4 0009A 	  CLRL    -(SP)					      ; 0178
						F4   A3  9F 0009C 	  PUSHAB  HELP_FLAGS				      ;
						     63  DD 0009F 	  PUSHL   LIBRARY_PTR				      ;
						10   AC  DD 000A1 	  PUSHL   KEY_DESC				      ;
						10   AE  9F 000A4 	  PUSHAB  WIDTH					      ;
						     51  DD 000A7 	  PUSHL   OUTRTN				      ;
			    00000000G  00	     06  FB 000A9 	  CALLS   #6, LBR$OUTPUT_HELP			      ;
				       52	     50  D0 000B0 	  MOVL    R0, STATUS				      ;
				       09	     52  E8 000B3 	  BLBS    STATUS, 10$				      ;
						     52  DD 000B6 	  PUSHL   STATUS				      ; 0186
			    00000000G  00	     01  FB 000B8 	  CALLS   #1, LIB$SIGNAL			      ;
				       50	     52  D0 000BF 10$:	  MOVL    STATUS, R0				      ; 0134
							 04 000C2 	  RET     					      ;
						     50  D4 000C3 11$:	  CLRL    R0					      ; 0093
							 04 000C5 	  RET     					      ;

; Routine Size:  198 bytes,    Routine Base:  $CODE$ + 0000



VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   7
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (4)

;	  0191	routine format_output(hlptxt,flags,data,keylev) =
;	  0192	begin
;	  0193	!++
;	  0194	!
;	  0195	!  This is the default output routine used when the caller does not
;	  0196	!  specify his own output routine.
;	  0197	!
;	  0198	!--
;	  0199	bind
;	  0200		txtdesc = .hlptxt : vector;
;	  0201	
;	  0202		line_count = .line_count + 1;		! Count this line of text.
;	  0203	
;	  0204	!	If the screen is full, pause until the user types something.
;	  0205	
;	  0206		if .line_count geq .max_line_count then 
;	  0207		    begin
;	  0208		    literal bufsiz = 80;
;	  0209		    local resp_str : vector[bufsiz,byte],
;	  0210			  resp_desc: vector[2];
;	  0211		    resp_desc[0] = bufsiz;
;	  0212		    resp_desc[1] = resp_str;
;	  0213		    ch$fill (%C' ',.resp_desc[0],.resp_desc[1]);
;	  0214		    lib$get_input(resp_desc,$descriptor(''));
;	  0215		    line_count = 0;
;	  0216		    if .resp_str[0] eql %C'E' or .resp_str[0] eql %C'e' then return 0;
;	  0217		    end;
;	  0218	
;	  0219	!	Output the help text.
;	  0220	
;	  0221		lib$put_output(txtdesc);
;	  0222		return ss$_normal;
;	  0223	end;



									  .PSECT  $PLIT$,NOWRT,NOEXE,2

							    0002C P.AAF:  .BLKB   0					      ;
						  00000000  0002C P.AAE:  .LONG   0					      ;
						  00000000' 00030 	  .ADDRESS P.AAF				      ;



									  .PSECT  $CODE$,NOWRT,2

						       007C 00000 FORMAT_OUTPUT:
									  .WORD   Save R2,R3,R4,R5,R6			      ; 0191
				       56 00000000'  00  9E 00002 	  MOVAB   LINE_COUNT, R6			      ;
				       5E	A8   AE  9E 00009 	  MOVAB   -88(SP), SP				      ;
						     66  D6 0000D 	  INCL    LINE_COUNT				      ; 0202
				  04   A6	     66  D1 0000F 	  CMPL    LINE_COUNT, MAX_LINE_COUNT		      ; 0206
						     30  19 00013 	  BLSS    1$					      ;
				       6E	50   8F  9A 00015 	  MOVZBL  #80, RESP_DESC			      ; 0211
				  04   AE	08   AE  9E 00019 	  MOVAB   RESP_STR, RESP_DESC+4			      ; 0212
	   6E	         20	       6E	     00  2C 0001E 	  MOVC5   #0, (SP), #32, RESP_DESC, @RESP_DESC+4      ; 0213
						04   BE     00023							      ;

VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   8
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (4)

					  00000000'  00  9F 00025 	  PUSHAB  P.AAE					      ; 0214
						04   AE  9F 0002B 	  PUSHAB  RESP_DESC				      ;
			    00000000G  00	     02  FB 0002E 	  CALLS   #2, LIB$GET_INPUT			      ;
						     66  D4 00035 	  CLRL    LINE_COUNT				      ; 0215
				  45   8F	08   AE  91 00037 	  CMPB    RESP_STR, #69				      ; 0216
						     15  13 0003C 	  BEQL    2$					      ;
				  65   8F	08   AE  91 0003E 	  CMPB    RESP_STR, #101			      ;
						     0E  13 00043 	  BEQL    2$					      ;
						04   AC  DD 00045 1$:	  PUSHL   HLPTXT				      ; 0221
			    00000000G  00	     01  FB 00048 	  CALLS   #1, LIB$PUT_OUTPUT			      ;
				       50	     01  D0 0004F 	  MOVL    #1, R0				      ; 0192
							 04 00052 	  RET     					      ;
						     50  D4 00053 2$:	  CLRL    R0					      ; 0191
							 04 00055 	  RET     					      ;

; Routine Size:  86 bytes,    Routine Base:  $CODE$ + 00C6



VAXHELP		VAXHELP						28-Feb-1983 15:14:42	VAX-11 Bliss-32 V3-711		    Page   9
01.00		vax_get_help					 3-Dec-1982 11:00:39	USER2:[ROBIN.VAXNET]VAXHELP.BLI;1 (5)

;	  0224	END				!End of module
;	  0225	ELUDOM




									  .EXTRN  LIB$SIGNAL

;				       PSECT SUMMARY
;
;	Name			 Bytes			       Attributes
;
;  $OWN$			      152  NOVEC,  WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)
;  $PLIT$			       52  NOVEC,NOWRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)
;  $CODE$			      284  NOVEC,NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  SYS$SYSROOT:[SYSLIB]LIB.L32;7	     10834         7         0       397







;					COMMAND QUALIFIERS

;	BLISS /LIST/DEBUG VAXHELP

; Size:		284 code + 204 data bytes
; Run Time:	   00:07.3
; Elapsed Time:	   00:58.6
; Memory Used:	434 pages
; Compilation Complete
