

; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 1

;

;00100  0001	MODULE LIB$GET_INPUT (	! Library $GET on device SYS$INPUT

;00200  0002		IDENT = '0-19',

;00300  0003		LINKAGE (FORTRAN)

;00400  0004			) =

;00500  0005	BEGIN

;00600  0006	

;00700  0007	!

;00800  0008	!			  COPYRIGHT (c) 1977 BY

;00900  0009	!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

;01000  0010	!

;01100  0011	! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED

;01200  0012	! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE

;01300  0013	! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER

;01400  0014	! COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY

;01500  0015	! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY

;01600  0016	! TRANSFERRED.

;01700  0017	!

;01800  0018	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE

;01900  0019	! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT

;02000  0020	! CORPORATION.

;02100  0021	!

;02200  0022	! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS

;02300  0023	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

;02400  0024	!

;02500  0025	

;02600  0026	!++

;02700  0027	! FACILITY:  General Uitlity Library

;02800  0028	!

;02900  0029	! ABSTRACT:

;03000  0030	!

;03100  0031	!	Output a string as a record on device SYS$INPUT.

;03200  0032	!

;03300  0033	! ENVIRONMENT:  User Mode - AST re-entrant

;03400  0034	!

;03500  0035	! AUTHOR:  Thomas N. Hastings, CREATION DATE:  8-Aug-1977

;03600  0036	!

;03700  0037	! MODIFIED BY:

;03800  0038	!

;03900  0039	! 	Thomas N. Hastings, 8-Aug-1977: VERSION 0

;04000  0040	! 01	- original

;04100  0041	! 04	- change to SYS$INPUT

;04200  0042	! 05	- change to do OPEN at first time

;04300  0043	! 06	- change to set up RAB for GET_STRING

;04400  0044	! 0-7	- fix comment

;04500  0045	! 0-10	- Change to STARLET library.  DGP 20-Apr-78

;04600  0046	! 0-11	- Remove EXTERNAL RMS$_RTB.  TNH 24-Apr-78

;04700  0047	! 0-12	- Change REQUIRE files for VAX system build.  DGP 28-Apr-78

;04800  0048	! 0-13	- Change STARLET to RTLSTARLE to avoid conflicts.  DGP 1-May-78

;04900  0049	! 0-14	- Add LIB$GET_COMMAND entry point.  TNH 17-June-78

;05000  0050	!	  For now, just copy entire routine.

;05100  0051	! 0-15	- Make wait if record stream active so AST re-entrant.

;05200  0052	!	  Also allocate dynamic string if passed.  TNH 29-July-78

;05300  0053	! 0-18	- Make common routine.  TNH 29-July-78

;05310  0054	! 0-19	- Use LIB$SOPY_R_DX, not DD.  TNH 2-Aug-78

;05400  0055	!--



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 1-1

;



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 2

;

;00100  0056	!

;00200  0057	! TABLE OF CONTENTS:

;00300  0058	!

;00400  0059	

;00500  0060	FORWARD ROUTINE

;00600  0061		LIB$GET_INPUT,		! Get string from device SYS$INPUT

;00700  0062		LIB$GET_COMMAND,	! Get string from device SYS$COMMAND

;00800  0063		DO_GET;			! Common routine to do main part of above.

;00900  0064	

;01000  0065	!

;01100  0066	! INCLUDE FILES:

;01200  0067	!

;01300  0068		REQUIRE 'RTLIN:FMAC';		! Define macros

; %PRINT:	Filename: FMAC.B32; Version 1, edit 29, TNH, 7-JUN-78

; %PRINT:	 REQUIRE FILE: LPSECT.B32, VERSION 01-5, TNH, 27-Jun-78

;01400  0248		LIBRARY	'RTLSTARLE';	! STARLET library for macros and symbols

;01500  0249	!

;01600  0250	! MACROS:

;01700  0251	!

;01800  0252	

;01900  0253	!

;02000  0254	! EQUATED SYMBOLS:

;02100  0255	!

;02200  0256	

;02300  0257	    LITERAL

;02400  0258		K_DYN_STR_MAX = 256;		! Max. size of dynamic string which can be

;02500  0259						! handled before truncation

;02600  0260	!

;02700  0261	! PSECT DECLARATIONS:

;02800  0262	!

;02900  0263	

;03000  0264		DECLARE_PSECTS (LIB);		! declare PSECTs for LIB$ facility

;03100  0265	

;03200  0266	!

;03300  0267	! OWN STORAGE:

;03400  0268	!

;03500  0269	

;03600  0270	OWN

;03700  0271	    SYS_INPUT_ISI: WORD INITIAL (0),	! ISI for SYS$INPUT

;03800  0272	    SYS_COMMAND_ISI: WORD INITIAL (0);	! ISI for SYS$COMMAND

;03900  0273	

;04000  0274	!

;04100  0275	! EXTERNAL REFERENCES:

;04200  0276	!

;04300  0277	EXTERNAL

;04400  0278		LIB$SCOPY_R_DX,					! Copy to dynamic string

;04500  0279		LIB$_INVARG: ADDRESSING_MODE(GENERAL),		! LIB -- INVALID ARGUMENT

;04600  0280		LIB$_INPSTRTRU: ADDRESSING_MODE(GENERAL);	! LIB -- INPUT STRING TRUNCATED

;04700  0281	!

;04800  0282	



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 3

;

;00100  0283	GLOBAL ROUTINE LIB$GET_INPUT (	! Input string from SYS$INPUT

;00200  0284		GET_STRING,		! Adr. of string descriptor

;00300  0285		PROMPT_STRING)			! Adr. of optional PROMPT_STRING string descriptor

;00400  0286		=			! Value returned is RMS completion code

;00500  0287	!++

;00600  0288	! FUNCTIONAL DESCRIPTION:

;00700  0289	! 

;00800  0290	!      A line from the current controlling input device,  SYS$INPUT,  is

;00900  0291	!      obtained.   If an optional PROMPT_STRING is given, output will appear on

;01000  0292	!      the device, SYS$INPUT, if the device is  a  terminal;   otherwise

;01100  0293	!      the  PROMPT_STRING  is  ignored.   No  CRLF  is  appended  to the record

;01200  0294	!      obtained from RMS.  On first call, devics SYS$INPUT is opened.

;01300  0295	!      Thus the user can assign the logical name SYS$INPUT to any file name

;01400  0296	!      in order to redirect I/O.

;01500  0297	! 

;01600  0298	! CALLING SEQUENCE:

;01700  0299	! 

;01800  0300	!      RET_STATUS.wlc.v      =      LIB$GET_INPUT      (get_string.wt.dx

;01900  0301	!      [,prompt_string.rt.dx])

;02000  0302	! 

;02100  0303	! INPUT PARAMETERS:

;02200  0304	! 

;02300  0305	!      prompt_string  is the address of a string  descriptor  specifying

;02400  0306	!                     an  optional prompt which is output to the

;02500  0307	!                     controlling input device.  Where other conventions

;02600  0308	!                     are   not   established,  it  is  recommended  for

;02700  0309	!                     consistency  to  make  prompts be an English  word

;02800  0310	!                     followed  by  a  colon(:),  one  (1) space, and no

;02900  0311	!                     CRLF.

;03000  0312	! 

;03100  0313	! OUTPUT PARAMETERS:

;03200  0314	! 

;03300  0315	!      get_string     is the address of string descriptor  of  any  type

;03400  0316	!                     (unspecified,   static,  dynamic,  or  varying  as

;03500  0317	!                     specified by the DSC$B_CLASS  field)  which  is  to

;03600  0318	!                     receive  the string.  (See Chapter 2 -- Section on

;03700  0319	!                     passing  strings  as  output  parameters  for  the

;03800  0320	!                     semantics of each string type.)

;03900  0321	! 

;04000  0322	! IMPLICIT INPUTS:

;04100  0323	! 

;04200  0324	!      SYS_INPUT_ISI	Set on first call to RMS internal stream identifier.

;04300  0325	! 

;04400  0326	! IMPLICIT OUTPUTS:

;04500  0327	! 

;04600  0328	!      SYS_INPUT_ISI	Set to RMS internal stream identifier

;04700  0329	! 			on first call when SYS$INPUT is OPENed.

;04800  0330	! 

;04900  0331	! 

;05000  0332	! COMPLETION STATUS:

;05100  0333	! 

;05200  0334	!      SS$_NORMAL if success.

;05300  0335	!

;05400  0336	!      For static or varying strings, if RMS error RMS$_RTB

;05500  0337	!      (RECORD TOO BIG) occurs, the truncated string is returned



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 3-1

;

;05600  0338	!      with an error status of LIB$_INPSTRTRU (INPUT STRING TRUNCATED).

;05700  0339	!      If any other RMS error occurs, the RMS error codes is returned.

;05800  0340	!      If the descriptor class field is not a recognized code or 0,

;05900  0341	!      LIB$_INVARG (INVALID ARGUMENT) is returned.

;06000  0342	! 

;06100  0343	! SIDE EFFECTS:

;06200  0344	!

;06300  0345	!     Opens file SYS$INPUT on first call and remembers ISI for subsequent calls.

;06400  0346	!--

;06500  0347	

;06600  0348	    BEGIN

;06700  0349	    RETURN DO_GET (.GET_STRING,

;06800  0350		    IF NULLPARAMETER (2) THEN 0 ELSE .PROMPT_STRING,

;06900  0351		    SYS_INPUT_ISI,		! internal stream id for SYS$INPUT

;07000  0352		    9,				! length of SYS$INPUT stirng

;07100  0353		    UPLIT ('SYS$INPUT'));	! name to open first time

;07200  0354	    END;			! End of LIB$GET_INPUT routine





							    .TITLE  LIB$GET_INPUT

							    .IDENT  \0-19\



							    .PSECT  LIB$DATA,NOEXE,  PIC,2



					0000  00000 SYS_INPUT_ISI:

							    .WORD   0							      ;

					0000  00002 SYS_COMMAND_ISI:

							    .WORD   0							      ;



							    .PSECT  LIB$CODE,NOWRT,  SHR,  PIC,2



  00  00  54  55  50  4E  49  24  53  59  53  00000 P.AAA:  .ASCII  \SYS$INPUT\<0><0><0>				      ;

					  00  0000B									      ;



							    .EXTRN  LIB$SCOPY_R_DX, LIB$_INVARG, LIB$_INPSTRTRU



					 0000 0000C 	    .ENTRY  LIB$GET_INPUT, Save nothing				      ; 0283

				  EF   AF  9F 0000E 	    PUSHAB  P.AAA						      ; 0353

				       09  DD 00011 	    PUSHL   #9							      ; 0349

			    00000000'  EF  9F 00013 	    PUSHAB  SYS_INPUT_ISI					      ;

		         02 	       6C  91 00019 	    CMPB    (AP), #2						      ; 0350

				       05  1F 0001C 	    BLSSU   1$							      ;

				  08   AC  D5 0001E 	    TSTL    8(AP)						      ;

				       04  12 00021 	    BNEQ    2$							      ;

				       7E  D4 00023 1$:     CLRL    -(SP)						      ;

				       03  11 00025 	    BRB     3$							      ;

				  08   AC  DD 00027 2$:     PUSHL   PROMPT_STRING					      ;

				  04   AC  DD 0002A 3$:     PUSHL   GET_STRING						      ; 0349

		  0000V  CF	       05  FB 0002D 	    CALLS   #5, DO_GET						      ;

					   04 00032 	    RET     							      ; 0283



; Routine Size:  39 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 4

;

;00100  0355	GLOBAL ROUTINE LIB$GET_COMMAND (	! Input string from SYS$COMMAND

;00200  0356		GET_STRING,		! Adr. of string descriptor

;00300  0357		PROMPT_STRING)			! Adr. of optional PROMPT_STRING string descriptor

;00400  0358		=			! Value returned is RMS completion code

;00500  0359	!++

;00600  0360	! FUNCTIONAL DESCRIPTION:

;00700  0361	! 

;00800  0362	!      A line from the current controlling input device,  SYS$COMMAND,  is

;00900  0363	!      obtained.   If an optional PROMPT_STRING is given, output will appear on

;01000  0364	!      the device, SYS$COMMAND, if the device is  a  terminal;   otherwise

;01100  0365	!      the  PROMPT_STRING  is  ignored.   No  CRLF  is  appended  to the record

;01200  0366	!      obtained from RMS.  On first call, devics SYS$COMMAND is opened.

;01300  0367	!      Thus the user can assign the logical name SYS$COMMAND to any file name

;01400  0368	!      in order to redirect I/O.  Note: Generally LIB$GET_INTPUT should be

;01500  0369	!      used rather than LIB$GET_COMMAND.  LIB$GET_COMMAND should only be used

;01600  0370	!      when the user has indicated that the terminal is explicitly wnated

;01700  0371	!      when in an indirect file.  For example, $INQUIRE or /COMFIRM qualifier.

;01800  0372	!      Normally, SYS$INPUT and SYS$COMMAND are the same file (interactive

;01900  0373	!      and batch).  It is only when an interactive user uses an indirect file

;02000  0374	!      that the devices are different (SYS$INPUT = indirect file, SYS$COMMANND

;02100  0375	!      remaining associated with the terminal).

;02200  0376	! 

;02300  0377	! CALLING SEQUENCE:

;02400  0378	! 

;02500  0379	!      RET_STATUS.wlc.v      =      LIB$GET_COMMAND      (get_string.wt.dx

;02600  0380	!      [,prompt_string.rt.dx])

;02700  0381	! 

;02800  0382	! INPUT PARAMETERS:

;02900  0383	! 

;03000  0384	!      prompt_string  is the address of a string  descriptor  specifying

;03100  0385	!                     an  optional prompt which is output to the

;03200  0386	!                     controlling input device.  Where other conventions

;03300  0387	!                     are   not   established,  it  is  recommended  for

;03400  0388	!                     consistency  to  make  prompts be an English  word

;03500  0389	!                     followed  by  a  colon(:),  one  (1) space, and no

;03600  0390	!                     CRLF.

;03700  0391	! 

;03800  0392	! OUTPUT PARAMETERS:

;03900  0393	! 

;04000  0394	!      get_string     is the address of string descriptor  of  any  type

;04100  0395	!                     (unspecified,   static,  dynamic,  or  varying  as

;04200  0396	!                     specified by the DSC$B_CLASS  field)  which  is  to

;04300  0397	!                     receive  the string.  (See Chapter 2 -- Section on

;04400  0398	!                     passing  strings  as  output  parameters  for  the

;04500  0399	!                     semantics of each string type.)

;04600  0400	! 

;04700  0401	! IMPLICIT INPUTS:

;04800  0402	! 

;04900  0403	!      SYS_COMMAND_ISI	Set on first call to RMS internal stream identifier.

;05000  0404	! 

;05100  0405	! IMPLICIT OUTPUTS:

;05200  0406	! 

;05300  0407	!      SYS_COMMAND_ISI	Set to RMS internal stream identifier

;05400  0408	! 			on first call when SYS$COMMAND is OPENed.

;05500  0409	! 



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 4-1

;

;05600  0410	! 

;05700  0411	! COMPLETION STATUS:

;05800  0412	! 

;05900  0413	!      SS$_NORMAL if success.

;06000  0414	!

;06100  0415	!      For static or varying strings, if RMS error RMS$_RTB

;06200  0416	!      (RECORD TOO BIG) occurs, the truncated string is returned

;06300  0417	!      with an error status of LIB$_INPSTRTRU (INPUT STRING TRUNCATED).

;06400  0418	!      If any other RMS error occurs, the RMS error codes is returned.

;06500  0419	!      If the descriptor class field is not a recognized code or 0,

;06600  0420	!      LIB$_INVARG (INVALID ARGUMENT) is returned.

;06700  0421	! 

;06800  0422	! SIDE EFFECTS:

;06900  0423	!

;07000  0424	!     Opens file SYS$COMMAND on first call and remembers ISI for subsequent calls.

;07100  0425	!--

;07200  0426	

;07300  0427	    BEGIN

;07400  0428	    RETURN DO_GET (.GET_STRING,

;07500  0429		    IF NULLPARAMETER (2) THEN 0 ELSE .PROMPT_STRING,

;07600  0430		    SYS_COMMAND_ISI,		! internal stream id for SYS$COMMAND

;07700  0431		    11,				! length of SYS$COMMAND string

;07800  0432		    UPLIT ('SYS$COMMAND'));	! name to open first time

;07900  0433	    END;				! End of LIB$GET_COMMAND routine







					      00033	    .BLKB   1

  44  4E  41  4D  4D  4F  43  24  53  59  53  00034 P.AAB:  .ASCII  \SYS$COMMAND\<0>					      ;

					  00  0003F									      ;







					 0000 00040 	    .ENTRY  LIB$GET_COMMAND, Save nothing			      ; 0355

				  EF   AF  9F 00042 	    PUSHAB  P.AAB						      ; 0432

				       0B  DD 00045 	    PUSHL   #11							      ; 0428

			    00000000'  EF  9F 00047 	    PUSHAB  SYS_COMMAND_ISI					      ;

		         02 	       6C  91 0004D 	    CMPB    (AP), #2						      ; 0429

				       05  1F 00050 	    BLSSU   1$							      ;

				  08   AC  D5 00052 	    TSTL    8(AP)						      ;

				       04  12 00055 	    BNEQ    2$							      ;

				       7E  D4 00057 1$:     CLRL    -(SP)						      ;

				       03  11 00059 	    BRB     3$							      ;

				  08   AC  DD 0005B 2$:     PUSHL   PROMPT_STRING					      ;

				  04   AC  DD 0005E 3$:     PUSHL   GET_STRING						      ; 0428

		  0000V  CF	       05  FB 00061 	    CALLS   #5, DO_GET						      ;

					   04 00066 	    RET     							      ; 0355



; Routine Size:  39 bytes





;08000  0434	



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5

;

;08100  0435	ROUTINE DO_GET (	! Input string from SYS$INPUT or SYS$COMMAND

;08200  0436		GET_STRING,		! Adr. of string descriptor

;08300  0437		PROMPT_STRING,		! Adr. of optional PROMPT_STRING string descriptor

;08310  0438		GET_ISI,		! Adr. of ISI word for this file

;08320  0439		DEVICE_NAME_LEN,	! Length of device name string

;08330  0440		DEVICE_NAME)		! Adr. of device name string

;08400  0441		=			! Value returned is RMS completion code

;08500  0442	!++

;08600  0443	! FUNCTIONAL DESCRIPTION:

;08700  0444	! 

;08800  0445	!      A line from the current controlling input device,  DEVICE_NAME,  is

;08900  0446	!      obtained.   If an optional PROMPT_STRING is given, output will appear on

;09000  0447	!      the device, DEVICE_NAME, if the device is  a  terminal;   otherwise

;09100  0448	!      the  PROMPT_STRING  is  ignored.   No  CRLF  is  appended  to the record

;09200  0449	!      obtained from RMS.  On first call, devics DEVICE_NAME is opened.

;09300  0450	!      Thus the user can assign the logical name DEVICE_NAME to any file name

;09400  0451	!      in order to redirect I/O.

;10200  0452	! 

;10300  0453	! CALLING SEQUENCE:

;10400  0454	! 

;10500  0455	!      ret_status.wlc.v = DO_GET (get_string.wt.dx, [prompt_string.rt.dx],

;10510  0456	!	   get_isi.mw.r, device_name_len.rl.v, device_name.rt.r)

;10700  0457	! 

;10800  0458	! INPUT PARAMETERS:

;10900  0459	! 

;11000  0460	!      prompt_string  is the address of a string  descriptor  specifying

;11100  0461	!                     an  optional prompt which is output to the

;11200  0462	!                     controlling input device.  Where other conventions

;11300  0463	!                     are   not   established,  it  is  recommended  for

;11400  0464	!                     consistency  to  make  prompts be an English  word

;11500  0465	!                     followed  by  a  colon(:),  one  (1) space, and no

;11600  0466	!                     CRLF.

;11610  0467	!

;11620  0468	! 

;11630  0469	!      get_isi		Set on first call to RMS internal stream identifier.

;11640  0470	!

;11650  0471	!      device_name_len	is the length of the device_name string in bytes.

;11660  0472	!

;11670  0473	!      device_name	is the adr. of the device name to be opened the first time.

;11680  0474	!

;11800  0475	! OUTPUT PARAMETERS:

;11900  0476	! 

;12000  0477	!      get_string     is the address of string descriptor  of  any  type

;12100  0478	!                     (unspecified,   static,  dynamic,  or  varying  as

;12200  0479	!                     specified by the DSC$B_CLASS  field)  which  is  to

;12300  0480	!                     receive  the string.  (See Chapter 2 -- Section on

;12400  0481	!                     passing  strings  as  output  parameters  for  the

;12500  0482	!                     semantics of each string type.)

;12600  0483	! 

;12700  0484	! IMPLICIT INPUTS:

;13000  0485	! 

;13010  0486	!	NONE

;13020  0487	!

;13100  0488	! IMPLICIT OUTPUTS:

;13200  0489	! 



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5-1

;

;13300  0490	!	NONE

;13500  0491	! 

;13700  0492	! COMPLETION STATUS:

;13800  0493	! 

;13900  0494	!      SS$_NORMAL if success.

;14000  0495	!

;14100  0496	!      For static or varying strings, if RMS error RMS$_RTB

;14200  0497	!      (RECORD TOO BIG) occurs, the truncated string is returned

;14300  0498	!      with an error status of LIB$_INPSTRTRU (INPUT STRING TRUNCATED).

;14400  0499	!      If any other RMS error occurs, the RMS error codes is returned.

;14500  0500	!      If the descriptor class field is not a recognized code or 0,

;14600  0501	!      LIB$_INVARG (INVALID ARGUMENT) is returned.

;14700  0502	! 

;14800  0503	! SIDE EFFECTS:

;14900  0504	!

;15000  0505	!     Opens file DEVICE_NAME on first call and remembers ISI for subsequent calls

;15010  0506	!     by storing ISI in get_isi.

;15100  0507	!--

;15110  0508	

;15120  0509	    BEGIN

;15200  0510	    LOCAL

;15300  0511		RET_STATUS,			! RMS status or LIB$SCOPY return status

;15400  0512		FAB: $FAB_DECL,			! FAB

;15500  0513		RAB: $RAB_DECL,			! RAB

;15600  0514		DYNAMIC_STR_BUF: VECTOR [K_DYN_STR_MAX, BYTE, UNSIGNED];	! temporary buffer for dynamic string case.

;15700  0515	    MAP

;15800  0516		GET_STRING: REF DSC$DESCRIPTOR,	! String descriptor

;15900  0517		PROMPT_STRING: REF DSC$DESCRIPTOR,	! String descriptor

;15910  0518		GET_ISI: REF VECTOR [1, WORD, UNSIGNED];	! Place to remember ISI in static storage

;16000  0519	

;16100  0520	    IF .GET_ISI[0] EQL 0

;16200  0521	    THEN

;16300  0522	

;16400  0523		!+

;16500  0524		! First call, initialize FAB

;16600  0525		!-

;16700  0526	

;16800  0527		BEGIN

;16900  0528		$FAB_INIT (

;17000P 0529		    FAB = FAB,

;17100P 0530		    FAC = GET,			! file access: GET

;17200P 0531		    FNA = .DEVICE_NAME,		! file name: DEVICE_NAME (SYS$INPUT or SYS$COMMAND)

;17300P 0532		    FNS = .DEVICE_NAME_LEN);	! file name size: 9 or 11 bytes

;17400  0533	

;17500  0534		!+

;17600  0535		! Open DEVICE_NAME, remember RMS internal stream identifier

;17700  0536		!-

;17800  0537	

;17900  0538		RET_STATUS = $OPEN (FAB = FAB);		! fab addr : FAB

;18000  0539		IF NOT .RET_STATUS THEN RETURN .RET_STATUS;	! if open fail

;18100  0540								! then return with RMS status code

;18200  0541		$RAB_INIT (FAB = FAB, RAB = RAB);

;18300  0542		RET_STATUS = $CONNECT (RAB = RAB);	! connect RAB to the file

;18400  0543		IF NOT .RET_STATUS THEN RETURN .RET_STATUS;

;18500  0544		GET_ISI[0] = .RAB[RAB$W_ISI];	! remember ISI



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5-2

;

;18600  0545		END

;18700  0546	

;18800  0547	    !+

;18900  0548	    ! file already open, just initialize RAB

;19000  0549	    ! including internal stream identifier returned from first $OPEN

;19100  0550	    !-

;19200  0551	

;19300  0552	    ELSE

;19400  0553		BEGIN

;19500  0554		$RAB_INIT (FAB = FAB, RAB = RAB);

;19600  0555		RAB[RAB$W_ISI] = .GET_ISI[0];

;19700  0556		END;

;19800  0557	

;19900  0558	    !+

;20000  0559	    ! Setup user buffer address and length on first and subsequent $GETs

;20100  0560	    ! Use user string if fixed length, else use stack temp for dynamic string

;20200  0561	    !-

;20300  0562	

;20400  0563	    CASE .GET_STRING[DSC$B_CLASS] FROM 0 TO DSC$K_CLASS_D OF

;20500  0564		SET

;20600  0565		[0, DSC$K_CLASS_S]:

;20700  0566		    BEGIN

;20800  0567		    RAB[RAB$L_UBF] = .GET_STRING[DSC$A_POINTER];

;20900  0568		    RAB[RAB$W_USZ] = .GET_STRING[DSC$W_LENGTH];

;21000  0569		    END;

;21100  0570	

;21200  0571		[DSC$K_CLASS_D]:

;21300  0572		    BEGIN

;21400  0573		    RAB[RAB$L_UBF] = DYNAMIC_STR_BUF;

;21500  0574		    RAB[RAB$W_USZ] = K_DYN_STR_MAX;

;21600  0575		    END;

;21700  0576	

;21800  0577		[OUTRANGE]:

;21900  0578		    RETURN LIB$_INVARG;		! INVALID ARGUEMENT

;22000  0579		TES;

;22100  0580	

;22200  0581	    !+

;22300  0582	    ! Setup PROMPT_STRING string if present

;22400  0583	    !-

;22500  0584	

;22600  0585	    IF NOT NULLPARAMETER (2)

;22700  0586	    THEN

;22800  0587		BEGIN

;22900  0588		RAB[RAB$V_PMT] = 1;

;23000  0589		RAB[RAB$L_PBF] = .PROMPT_STRING[DSC$A_POINTER];

;23100  0590		RAB[RAB$B_PSZ] = .PROMPT_STRING[DSC$W_LENGTH];

;23200  0591		END;

;23300  0592	

;23400  0593	    !+

;23500  0594	    ! Input the string as a single record 

;23600  0595	    ! Return RMS error status if not RECORD TOO BIG or RECORD STREAM ACTIVE.

;23700  0596	    ! On record stream active, wait and try again.

;23800  0597	    !-

;23900  0598	

;24000  0599	    RET_STATUS = $GET (RAB = RAB);



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5-3

;

;24100  0600	    IF NOT .RET_STATUS AND .RET_STATUS NEQ RMS$_RTB 

;24200  0601	    THEN 

;24300  0602		BEGIN

;24400  0603		WHILE .RAB[RAB$L_STS] EQL RMS$_RSA DO

;24500  0604		    BEGIN

;24600  0605		    $WAIT (RAB=RAB);

;24700  0606		    $PUT (RAB=RAB);

;24800  0607		    END;

;24900  0608		IF NOT .RAB[RAB$L_STS] THEN RETURN .RAB[RAB$L_STS];

;25000  0609		END;

;25100  0610	

;25200  0611	    !+

;25300  0612	    ! Space fill with trailing blanks if class of descriptor is

;25400  0613	    ! unspecified or is Static.  Copy string if dynamic.

;25500  0614	    ! Return SS$_NORMAL (=00000001) if success, not RMS$_NORMAL (=00010001)

;25600  0615	    !-

;25700  0616	

;25800  0617	    IF .GET_STRING[DSC$B_CLASS] EQLU DSC$K_CLASS_D

;25900  0618		THEN

;26000  0619		    RETURN LIB$SCOPY_R_DX (RAB[RAB$W_RSZ], DYNAMIC_STR_BUF, .GET_STRING)

;26100  0620		ELSE

;26200  0621		    BEGIN

;26300  0622		    CH$FILL (%C' ', .GET_STRING[DSC$W_LENGTH] - .RAB[RAB$W_RSZ],

;26400  0623			.GET_STRING[DSC$A_POINTER] + .RAB[RAB$W_RSZ]);

;26500  0624		    RETURN (IF .RET_STATUS THEN SS$_NORMAL ELSE LIB$_INPSTRTRU);

;26600  0625		    END;

;26700  0626	

;26800  0627	    END;			! End of routine DO_GET







							    .EXTRN  SYS$OPEN, SYS$CONNECT, SYS$GET, SYS$WAIT, SYS$PUT



					 00FC 00067 DO_GET: .WORD   Save R2,R3,R4,R5,R6,R7				      ; 0435

		         5E 	FE6C   CE  9E 00069 	    MOVAB   -404(SP), SP					      ;

				  0C   BC  B5 0006E 	    TSTW    @GET_ISI						      ; 0520

				       67  12 00071 	    BNEQ    3$							      ;

		         56 	  B0   AD  9E 00073 	    MOVAB   FAB, $RMS_PTR					      ; 0532

	   00 	         6E 	       00  2C 00077 	    MOVC5   #0, (SP), #0, #80, ($RMS_PTR)			      ;

		         66 	0050   8F     0007B									      ;

		         66 	5003   8F  B0 0007F 	    MOVW    #20483, ($RMS_PTR)					      ;

		    16   A6	       02  90 00084 	    MOVB    #2, 22($RMS_PTR)					      ;

		    1F   A6	       02  90 00088 	    MOVB    #2, 31($RMS_PTR)					      ;

		    2C   A6	  14   AC  D0 0008C 	    MOVL    DEVICE_NAME, 44($RMS_PTR)				      ;

		    34   A6	  10   AC  90 00091 	    MOVB    DEVICE_NAME_LEN, 52($RMS_PTR)			      ;

				  B0   AD  9F 00096 	    PUSHAB  FAB							      ; 0538

	      00000000G  9F	       01  FB 00099 	    CALLS   #1, @#SYS$OPEN					      ;

		         57 	       50  D0 000A0 	    MOVL    R0, RET_STATUS					      ;

		         28 	       57  E9 000A3 	    BLBC    RET_STATUS, 1$					      ; 0539

		         56 	FF6C   CD  9E 000A6 	    MOVAB   RAB, $RMS_PTR					      ; 0541

	   00 	         6E 	       00  2C 000AB 	    MOVC5   #0, (SP), #0, #68, ($RMS_PTR)			      ;

		         66 	0044   8F     000AF									      ;

		         66 	4401   8F  B0 000B3 	    MOVW    #17409, ($RMS_PTR)					      ;

		    3C   A6	  B0   AD  9E 000B8 	    MOVAB   FAB, 60($RMS_PTR)					      ;

				FF6C   CD  9F 000BD 	    PUSHAB  RAB							      ; 0542



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5-4

;

	      00000000G  9F	       01  FB 000C1 	    CALLS   #1, @#SYS$CONNECT					      ;

		         57 	       50  D0 000C8 	    MOVL    R0, RET_STATUS					      ;

		         04 	       57  E8 000CB 	    BLBS    RET_STATUS, 2$					      ; 0543

		         50 	       57  D0 000CE 1$:     MOVL    RET_STATUS, R0					      ;

					   04 000D1 	    RET     							      ;

		    0C   BC	FF6E   CD  B0 000D2 2$:     MOVW    RAB+2, @GET_ISI					      ; 0544

				       1D  11 000D8 	    BRB     4$							      ; 0520

		         56 	FF6C   CD  9E 000DA 3$:     MOVAB   RAB, $RMS_PTR					      ; 0554

	   00 	         6E 	       00  2C 000DF 	    MOVC5   #0, (SP), #0, #68, ($RMS_PTR)			      ;

		         66 	0044   8F     000E3									      ;

		         66 	4401   8F  B0 000E7 	    MOVW    #17409, ($RMS_PTR)					      ;

		    3C   A6	  B0   AD  9E 000EC 	    MOVAB   FAB, 60($RMS_PTR)					      ;

		  FF6E   CD	  0C   BC  B0 000F1 	    MOVW    @GET_ISI, RAB+2					      ; 0555

		         52 	  04   AC  D0 000F7 4$:     MOVL    GET_STRING, R2					      ; 0563

	   02 	         00 	  03   A2  8F 000FB 	    CASEB   3(R2), #0, #2					      ;

	 0019 	       000E 	     000E     00100 5$:     .WORD   6$-5$,-						      ;

								    6$-5$,-						      ;

								    7$-5$						      ;

		         50 00000000G  00  9E 00106 	    MOVAB   LIB$_INVARG, R0					      ; 0578

					   04 0010D 	    RET     							      ;

		    90   AD	  04   A2  D0 0010E 6$:     MOVL    4(R2), RAB+36					      ; 0567

		    8C   AD	       62  B0 00113 	    MOVW    (R2), RAB+32					      ; 0568

				       0A  11 00117 	    BRB     8$							      ; 0563

		    90   AD	       6E  9E 00119 7$:     MOVAB   DYNAMIC_STR_BUF, RAB+36				      ; 0573

		    8C   AD	0100   8F  B0 0011D 	    MOVW    #256, RAB+32					      ; 0574

		         02 	       6C  91 00123 8$:     CMPB    (AP), #2						      ; 0585

				       18  1F 00126 	    BLSSU   9$							      ;

				  08   AC  D5 00128 	    TSTL    8(AP)						      ;

				       13  13 0012B 	    BEQL    9$							      ;

		  FF73   CD	  40   8F  88 0012D 	    BISB2   #64, RAB+7						      ; 0588

		         50 	  08   AC  D0 00133 	    MOVL    PROMPT_STRING, R0					      ; 0589

		    9C   AD	  04   A0  D0 00137 	    MOVL    4(R0), RAB+48					      ;

		    A0   AD	       60  90 0013C 	    MOVB    (R0), RAB+52					      ; 0590

				FF6C   CD  9F 00140 9$:     PUSHAB  RAB							      ; 0599

	      00000000G  9F	       01  FB 00144 	    CALLS   #1, @#SYS$GET					      ;

		         57 	       50  D0 0014B 	    MOVL    R0, RET_STATUS					      ;

		         37 	       57  E8 0014E 	    BLBS    RET_STATUS, 12$					      ; 0600

	      000181A8   8F	       57  D1 00151 	    CMPL    RET_STATUS, #98728					      ;

				       2E  13 00158 	    BEQL    12$							      ;

	      000182DA   8F	FF74   CD  D1 0015A 10$:    CMPL    RAB+8, #99034					      ; 0603

				       18  12 00163 	    BNEQ    11$							      ;

				FF6C   CD  9F 00165 	    PUSHAB  RAB							      ; 0605

	      00000000G  9F	       01  FB 00169 	    CALLS   #1, @#SYS$WAIT					      ;

				FF6C   CD  9F 00170 	    PUSHAB  RAB							      ; 0606

	      00000000G  9F	       01  FB 00174 	    CALLS   #1, @#SYS$PUT					      ;

				       DD  11 0017B 	    BRB     10$							      ; 0603

		         06 	FF74   CD  E8 0017D 11$:    BLBS    RAB+8, 12$						      ; 0608

		         50 	FF74   CD  D0 00182 	    MOVL    RAB+8, R0						      ;

					   04 00187 	    RET     							      ;

		         02 	  03   A2  91 00188 12$:    CMPB    3(R2), #2						      ; 0617

				       0E  12 0018C 	    BNEQ    13$							      ;

				       52  DD 0018E 	    PUSHL   R2							      ; 0619

				  04   AE  9F 00190 	    PUSHAB  DYNAMIC_STR_BUF					      ;

				  8E   AD  9F 00193 	    PUSHAB  RAB+34						      ;

		  0000G  CF	       03  FB 00196 	    CALLS   #3, LIB$SCOPY_R_DX					      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 19:33:29	DBB3:[RTL.SRC]LGETIN.B32;11					Page 5-5

;

					   04 0019B 	    RET     							      ;

		         51 	       62  3C 0019C 13$:    MOVZWL  (R2), R1						      ; 0622

		         50 	  8E   AD  3C 0019F 	    MOVZWL  RAB+34, R0						      ;

		         51 	       50  C2 001A3 	    SUBL2   R0, R1						      ;

		         50 	  8E   AD  3C 001A6 	    MOVZWL  RAB+34, R0						      ; 0623

		         50 	  04   A2  C0 001AA 	    ADDL2   4(R2), R0						      ;

	   20 	         6E 	       00  2C 001AE 	    MOVC5   #0, (SP), #32, R1, (R0)				      ; 0622

		         60 	       51     001B2									      ;

		         04 	       57  E9 001B4 	    BLBC    RET_STATUS, 14$					      ; 0624

		         50 	       01  D0 001B7 	    MOVL    #1, R0						      ;

					   04 001BA 	    RET     							      ;

		         50 00000000G  00  9E 001BB 14$:    MOVAB   LIB$_INPSTRTRU, R0					      ;

					   04 001C2 	    RET     							      ; 0435



; Routine Size:  348 bytes





;26900  0628	END				!End of module LIB$GET_INPUT/COMMAND

;27000  0629	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  LIB$DATA       	     4    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,  PIC,ALIGN(2)

;  LIB$CODE       	   451  NOWRT,  RD ,  EXE,  SHR,  LCL,  REL,  CON,  PIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]STARLET.L32;1		      2688        74         2       150











; Size:		426 code + 29 data bytes

; Run Time:	00:13.4

; Elapsed Time:	00:48.6

; Memory Used:	238 pages

; Compilation Complete

