TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      60  TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TER

   (3)     255  TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TE

   (4)     400  TTY$FDTSETM -- FUNCTION DECISION ROUTINE FOR TE

   (5)     431  TTY$FDTSETC - FUNCTION DECISION ROUTINE FOR TER

   (6)     483  SENSE MODE OR CHARACTERISTICS

   (7)     550  CARRAIGE CONTROL INTERPRETATION

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   1

V06                                                                                                                              (1)



                                     0000     1 	.TITLE TTYFDT - TERMINAL FUNCTION DECISION ROUTINES

                                     0000     2 	.IDENT	/V06/		

                                     0000     3 ;

                                     0000     4 ; COPYRIGHT (C) 1978

                                     0000     5 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000     6 ;

                                     0000     7 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000     8 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000     9 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000    10 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000    11 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000    12 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000    13 ; REMAIN IN DEC.

                                     0000    14 ;

                                     0000    15 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

                                     0000    16 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000    17 ; CORPORATION.

                                     0000    18 ;

                                     0000    19 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000    20 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    21 ;++

                                     0000    22 ; FACILITY:

                                     0000    23 ;

                                     0000    24 ;	VAX/VMS TERMINAL DRIVER

                                     0000    25 ;

                                     0000    26 ; ABSTRACT: THIS MODULE CONTAINS THE FUNCTION DECISION ROUTINES FOR TERMINAL

                                     0000    27 ; RELATED I/O FUNCTIONS.

                                     0000    28 ;

                                     0000    29 ; AUTHOR: R.HEINEN 23-SEPT-76 VERSION V06

                                     0000    30 ;--

                                     0000    31 ;

                                     0000    32 ; EXTERNAL SYMBOLS:

                                     0000    33 ;

                                     0000    34 	$DYNDEF				; DEFINE DYNAMIC MEMORY BLOCK TYPES

                                     0000    35 	$IODEF				; DEFINE I/O FUNCTION CODES

                                     0000    36 	$IPLDEF				; DEFINE IPL CONSTANTS

                                     0000    37 	$IRPDEF				; DEFINE I/O PACKET OFFSETS

                                     0000    38 	$PCBDEF				; DEFINE PCB OFFSETS

                                     0000    39 	$PRVDEF				; DEFINE PRIVILEGES

                                     0000    40 	$PSLDEF				; DEFINE PSL OFFSETS

                                     0000    41 	$UCBDEF				; DEFINE UCB

                                     0000    42 	$TTYDEF				; DEFINE TERMINAL DRIVER SYMBOLS

                                     0000    43 	$TTDEF				; DEFINE TERMINAL CHARACTERISTICS

                                     0000    44 	$TTYUCBDEF			; DEFINE TERMINAL DRIVER SYMBOLS

                                     0000    45 	TTYMACS				; TERMINAL MACROS

                                     0000    46 ;

                                     0000    47 ; LOCAL DEFINITIONS

                                     0000    48 ;

                                     0000    49 ; QIO ARGUMENT LIST OFFSETS

                                     0000    50 ;

                           00000000  0000    51 P1 = 0

                           00000004  0000    52 P2 = 4

                           00000008  0000    53 P3 = 8

                           0000000C  0000    54 P4 = 12

                           00000010  0000    55 P5 = 16

                           00000014  0000    56 P6 = 20

                                     0000    57  

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   2

V06                                                                                                                              (1)



                                 00000000    58 	.PSECT	Y$EXEPAGED

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   3

V06             TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TER                                                                  (2)



                                     0000    60 	.SBTTL	TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TERMINAL READ FUNCTIONS

                                     0000    61 ;++

                                     0000    62 ; TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TERMINAL READ

                                     0000    63 ;

                                     0000    64 ; FUNCTIONAL DESCRIPTION:

                                     0000    65 ;

                                     0000    66 ; THIS ROUTINE IS THE FUNCTION DECISION ACTION ROUTINE FOR TERMINAL READS.

                                     0000    67 ;

                                     0000    68 ; THE TERMINAL READ QIO PARAMETERS ARE:

                                     0000    69 ;

                                     0000    70 ;	P1 = ADDRESS OF THE BUFFER TO RECEIVE THE DATA RECORD

                                     0000    71 ;	P2 = SIZE OF THE P1 BUFFER

                                     0000    72 ;	P3 = NUMBER OF SECONDS TO WAIT FOR CHARACTERS (IO$M_TIMED ONLY)

                                     0000    73 ;	P4 = ADDRESS OF TERMINATOR CLASS BITMASK OR 0 IF STANDARD

                                     0000    74 ;	P5 = ADDRESS OF PROMPT STRING FOR IO$_READPROMPT

                                     0000    75 ;	P6 = SIZE OF PROMPT STRINT FOR IO$_READPROMPT

                                     0000    76 ;

                                     0000    77 ; THE FUNCTION PARAMETERS ARE VALIDATED AND IF CORRECT, THE PACKET IS

                                     0000    78 ; QUEUED ON THE UNIT I/O QUEUE.

                                     0000    79 ; THE PACKET CONTAINS THE FOLLOWING:

                                     0000    80 ;

                                     0000    81 ;	1. IRP$L_MEDIA IS SET UP TO BE THE NEW TERMINAL STATES AT THE

                                     0000    82 ;	   TIME THE READ OPERATION IS STARTED.

                                     0000    83 ;	2. IRP$L_SVAPTE CONTAINS THE ADDRESS OF THE READ BUFFER

                                     0000    84 ;	   FORMATTED AS FOLLOWS.

                                     0000    85 ;

                                     0000    86 ;		.LONG	ADDRESS TO STORE DATA

                                     0000    87 ;		.LONG	USER BUFFER VIRTUAL ADDRESS

                                     0000    88 ;		.WORD	SIZE

                                     0000    89 ;		.WORD	TYPE

                                     0000    90 ;		.WORD	STORAGE FOR STARTING CURSOR POSITION

                                     0000    91 ;		.WORD TIMEOUT COUNT	

                                     0000    92 ;		PROMPT STRING

                                     0000    93 ;		READ BUFFER

                                     0000    94 ;		TERMINATOR MASK FOR NONSTANDARD CLASSES

                                     0000    95 ;

                                     0000    96 ;	3. IRP$L_TT_TERM ADDRESSES THE TERMINATOR BITMASK

                                     0000    97 ;	4. IRP$W_FUNC<0:6> ARE SET FOR A FAST CASE ON FUNCTION TYPE

                                     0000    98 ;	5. IRP$W_BOFF IS THE QUOTA FOR THE I/O

                                     0000    99 ;	6. IRP$W_BCNT IS THE READ REQUEST SIZE

                                     0000   100 ;

                                     0000   101 ; STATE BIT USAGE.

                                     0000   102 ;

                                     0000   103 ;	FOR IO$_READPBLK, TTY$V_ST_PASSALL IS SET.

                                     0000   104 ;	FOR IO$_READPROMPT, TTY$V_ST_PROMPT AND TTY$V_ST_CTRLR ARE SET.

                                     0000   105 ;		CTRLR WILL FORCE THE PROMPT OUT WHEN THE READ IS STARTED.

                                     0000   106 ;

                                     0000   107 ;	FOR IO$M_NOECHO, TTY$V_ST_NOECHO IS SET.

                                     0000   108 ;	FOR IO$M_NOFILTR, TTY$V_ST_NOFILTR IS SET.

                                     0000   109 ;

                                     0000   110 ; INPUTS:

                                     0000   111 ;

                                     0000   112 ;	R3 = ADDRESS OF THE PACKET FOR THIS REQUEST

                                     0000   113 ;	R4 = CURRENT PCB

                                     0000   114 ;	R5 = UCB ADDRESS

                                     0000   115 ;	R6 = ASSIGNED CCB

                                     0000   116 ;	R7 = FUNCTION CODE

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   4

V06             TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TER                                                                  (2)



                                     0000   117 ;	AP = ADDRESS OF FIRST FUNCTION DEPENDENT QIO PARAMETER

                                     0000   118 ;

                                     0000   119 ; OUTPUTS:

                                     0000   120 ;

                                     0000   121 ;	THE I/O IF IN ERROR IS COMPLETED VIA "EXE$ABORTIO".

                                     0000   122 ;	THE I/O IF VALID IS QUEUED TO THE DRIVER BY "EXE$QIODRVPKT".

                                     0000   123 ;

                                     0000   124 ; COMPLETION CODES:

                                     0000   125 ;

                                     0000   126 ;	SS$_ACCVIO - ACCESS VIOLATION ON BUFFER.

                                     0000   127 ;	SS$_EXQUOTA - OVER QUOTA FOR BUFFERED I/O

                                     0000   128 ;	SS$_INSFMEM - INSUFICIENT MEMORY

                                     0000   129 ;--

                                     0000   130 TTY$FDTREAD::				;

                          53     DD  0000   131 	PUSHL	R3			; SAVE PACKET ADDRESS

                                     0002   132 ;

                                     0002   133 ; SET PROPER STATE BITS FOR READ FUNCTIONS FROM FUNCTION MODIFIERS

                                     0002   134 ;

                                     0002   135 ; NOTE THE CORESPONDENCE OF THE VALUES

                                     0002   136 ;

         20 A3            09     78  0002   137 	ASHL	#TTY$V_ST_NOECHO-IO$V_NOECHO,IRP$W_FUNC(R3),R8

                          58         0006       

            58   FFFB7FFF 8F     CA  0007   138 	BICL	#^C<TTY$M_ST_NOECHO!TTY$M_ST_NOFLTR>,R8

            58       0800 8F     A8  000E   139 	BISW	#TTY$M_ST_READ,R8	; ADD READ

                                     0013   140 ;

                                     0013   141 ; CHECK ACCESS TO READ BUFFER

                                     0013   142 ;

            50            6C     D0  0013   143 	MOVL	P1(AP),R0		; GET BUFFER ADDRESS AND SIZE

            51         04 AC     3C  0016   144 	MOVZWL	P2(AP),R1		;

                          04     12  001A   145 	BNEQ	5$			; IF NEQ THEN ACTUAL READ

            58            09     E3  001C   146 	BBCS	#TTY$V_ST_EOL,R8,10$	; SET EOL AND BRANCH

                          06         001F       

                 00000000'GF     16  0020   147 5$:	JSB	G^EXE$READCHK		; CHECK READ ACCESS FOR BUFFER

                                     0026   148 					; NO RETURN MEANS NO ACCESS

            59            50     7D  0026   149 10$:	MOVQ	R0,R9			; COPY INPUT BUFFER PARAMS

                          57     D4  0029   150 	CLRL	R7			; ASSUME 0 BUFFER SIZE

            06            00     ED  002B   151 	CMPZV	#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3),#IO$_READPBLK; PASSALL?

            0C         20 A3         002E       

                          04     12  0031   152 	BNEQ	20$			; IF NEQ THEN NO

            58            0E     E3  0033   153 	BBCS	#TTY$V_ST_PASALL,R8,50$; SET PASSALL MODE AND BR

                          31         0036       

                                     0037   154 ;

                                     0037   155 ; DO SPECIAL FUNCTION LOGIC FOR READ WITH PROMPT

                                     0037   156 ;

            06            00     ED  0037   157 20$:	CMPZV	#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3),#IO$_READPROMPT; READ PROMPT?

            37         20 A3         003A       

                          29     12  003D   158 	BNEQ	50$			; BR IF NO

                                     003F   159 ;

                                     003F   160 ; SEE IF NO PROMPT IS SPECIFIED

                                     003F   161 ;

            57         14 AC     3C  003F   162 	MOVZWL	P6(AP),R7		; GET SIZE OF PROMPT

                          23     13  0043   163 	BEQL	50$			; IF EQL THEN MAKE THIS NORMAL READ

                                     0045   164 ;

                                     0045   165 ; READ WITH PROMPT

                                     0045   166 ;

            58   00020400 8F     C8  0045   167 	BISL	#TTY$M_ST_PROMPT!TTY$M_ST_CTRLR,R8; INSERT BITS FOR PROMPT

            50         10 AC     D0  004C   168 	MOVL	P5(AP),R0		; GET PROMPT BUFFER ADDRESS

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   5

V06             TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TER                                                                  (2)



                                     0050   169 ;

                                     0050   170 ; CHECK ACCESS TO PROMPT STRING

                                     0050   171 ;

            51            57     3C  0050   172 	MOVZWL	R7,R1			; GET SIZE PROMPT

                 00000000'GF     16  0053   173 	JSB	G^EXE$WRITECHK		; CHECK PROMPT BUFFER ACCESS

                                     0059   174 					; NO RETURN MEANS NO ACCESS

            56            50     D0  0059   175 	MOVL	R0,R6			; COPY PROMPT STRING ADDRESS

            51            5A     C0  005C   176 	ADDL	R10,R1			; ADJUST PROMPT SIZE TO OVERALLOCATE

         32 A3            5A     B0  005F   177 	MOVW	R10,IRP$W_BCNT(R3)	; SAVE ACTUAL READ SIZE

         2A A3            01     E2  0063   178 	BBSS	#IRP$V_FUNC,IRP$W_STS(R3),50$; RESET TRANSFER DIRECTION

                          00         0067       

            57            10     A1  0068   179 50$:	ADDW3	#TTY$L_RB_DATA,R7,IRP$W_TT_PRMPT(R3); ADJUST PROMPT SIZE FOR HEADER

                       3C A3         006B       

            51            10     C0  006D   180 	ADDL	#TTY$L_RB_DATA,R1	; ADJUST SIZE FOR BLOCK HEADER

         38 A3   00000000'EF     9E  0070   181 	MOVAB	TTY$A_STANDARD,IRP$L_TT_TERM(R3); ASSUME STANDARD TERMINATORS

         34 A3         0C AC     D0  0078   182 	MOVL	P4(AP),IRP$L_MEDIA(R3)	; GET ADDRESS OF TERMINATOR BITMASK

                          2A     13  007D   183 	BEQL	65$			; IF EQL THEN STANDARD

            52         34 A3     D0  007F   184 	MOVL	IRP$L_MEDIA(R3),R2	; RETREIVE ADDRESS

         38 A3            51     3C  0083   185 	MOVZWL	R1,IRP$B_CARCON(R3)	; SAVE OFFSET IN BUFFER BLOCK

            50       0000'8F     3C  0087   186 	MOVZWL	#SS$_ACCVIO,R0		; ASSUME ACCESS VIOLATION

                                     008C   187 	IFNORD	#8,(R2),70$		; DESC. ACCESSIBLE?

            53            62     3C  0092   188 	MOVZWL	(R2),R3			; GET BITMAP SIZE

                          07     13  0095   189 	BEQL	60$			; IF EQL THEN SHORT FORM

                                     0097   190 	IFNORD	R3,@4(R2),70$		; BITMAP ACCESSIBLE?

            51            10     C0  009E   191 60$:	ADDL	#16,R1			; ASSUME NOT EIGHTBIT

                                     00A1   192 ;

                                     00A1   193 ; BY RIGHTS, THIS TEST SHOULD NOT BE MADE HERE, THE DEVICE COULD

                                     00A1   194 ; CHANGE STATES BETWEEN NOW AND THE TIME THE READ TERMINATOR

                                     00A1   195 ; TEST IS MADE. THIS MEANS THAT THE TERMINATOR TEST MAY NOT BE CORRECT

                                     00A1   196 ; ON THE INTERRIM I/O.

                                     00A1   197 ;

         3C A5            0F     E1  00A1   198 	BBC	#TT$V_EIGHTBIT,UCB$L_DEVDEPEND(R5),65$; BR IF NOT EIGHTBIT TTY

                          03         00A5       

            51            10     C0  00A6   199 	ADDL	#16,R1			; MAKE BITMAP 8-BIT SIZE

                                     00A9   200 ;

                                     00A9   201 ; ALLOCATE HEADER + PROMPT + DATA + BITMASK

                                     00A9   202 ;

                                     00A9   203 ; CHECK FOR BUFFERED I/O QUOTA

                                     00A9   204 ;

                 00000000'GF     16  00A9   205 65$:	JSB	G^EXE$BUFFRQUOTA	; CHECK QUOTA

            06            50     E9  00AF   206 	BLBC	R0,70$			; SIGNAL ERROR IF LOW CLEAR

                                     00B2   207 ;

                                     00B2   208 ; ALLOCATE THE BUFFER

                                     00B2   209 ;

                 00000000'GF     16  00B2   210 	JSB	G^EXE$ALLOCBUF		; ALLOCATE THE BUFFER

                          08     BA  00B8   211 70$:	POPR	#^M<R3>			; RESTORE PACKET

            62            50     E9  00BA   212 	BLBC	R0,100$			; IF LOW CLEAR THEN ERROR

         2C A3            52     D0  00BD   213 	MOVL	R2,IRP$L_SVAPTE(R3)	; SAVE ADDRESS OF BUFFERED I/O BLOCK

         30 A3            51     B0  00C1   214 	MOVW	R1,IRP$W_BOFF(R3)	; SAVE BLOCK SIZE AS QUOTA

                                     00C5   215 ;

                                     00C5   216 ; ADJUST BUFFERED I/O QUOTA

                                     00C5   217 ;

         42 A4            51     A2  00C5   218 	SUBW	R1,PCB$W_BYTCNT(R4)	; ADJUST QUOTA WORD

                                     00C9   219 ;

                                     00C9   220 ; SET UP BUFFERED I/O BLOCK

                                     00C9   221 ;

         04 A2            59     D0  00C9   222 	MOVL	R9,TTY$L_RB_UVA(R2)	; INSERT USER VIRTUAL ADDRESS

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   6

V06             TTY$FDTREAD - FUNCTION DECISION ROUTINE FOR TER                                                                  (2)



            62         10 A2     9E  00CD   223 	MOVAB	TTY$L_RB_DATA(R2),TTY$L_RB_NXT(R2); INSERT POINTER TO DATA AREA

                          2C     BB  00D1   224 	PUSHR	#^M<R2,R3,R5>		; SAVE REGISTERS

            54         34 A3     D0  00D3   225 	MOVL	IRP$L_MEDIA(R3),R4	; ADDRESS BITMAP ADDRESS

                          23     13  00D7   226 	BEQL	90$			; IF EQL THEN STANDARD

         38 A3            52     C0  00D9   227 	ADDL	R2,IRP$L_TT_TERM(R3)	; CALC ADDRESS OF BITMAP SPACE

            51         3C A3     A2  00DD   228 	SUBW	IRP$W_TT_PRMPT(R3),R1	; CALC BITMAP SIZE

            51         32 A3     A2  00E1   229 	SUBW	IRP$W_BCNT(R3),R1	;

            55         04 A4     D0  00E5   230 	MOVL	4(R4),R5		; ADDRESS BITMAP

            52            64     3C  00E9   231 	MOVZWL	(R4),R2			; GET SIZE OF MAP

                          07     12  00EC   232 	BNEQ	80$			; IF NEQ THEN SPECIFIED

            52            04     9A  00EE   233 	MOVZBL	#4,R2			; SET SIZE OF SHORT FORM

            55         04 A4     9E  00F1   234 	MOVAB	4(R4),R5		; ADDRESS SHORT FORM LONG WORD

            65            52     2C  00F5   235 80$:	MOVC5	R2,(R5),#0,R1,@IRP$L_TT_TERM(R3); COPY BITMAP

            51            00         00F8       

                       38 B3         00FA       

            52            8E     D0  00FC   236 90$:	MOVL	(SP)+,R2		; RETREIVE BLOCK ADDRESS

         0E A2         08 AC     B0  00FF   237 	MOVW	P3(AP),TTY$W_RB_TIMOS(R2); GET TIMEOUT COUNT

                                     0104   238 ;

                                     0104   239 ; READ WITH PROMPT?

                                     0104   240 ;

            58            11     E1  0104   241 	BBC	#TTY$V_ST_PROMPT,R8,95$	; BR IF NOT PROMPT READ

                          05         0107       

            66            57     28  0108   242 	MOVC3	R7,(R6),TTY$L_RB_DATA(R2); COPY PROMPT STRING TO BUFFERED BLOCK

                       10 A2         010B       

                          28     BA  010D   243 95$:	POPR	#^M<R3,R5>		; RESTORE REGISTERS

                                     010F   244 ;

                                     010F   245 ; QUEUE I/O PACKET TO UNIT

                                     010F   246 ;

         34 A3            58     D0  010F   247 	MOVL	R8,IRP$L_MEDIA(R3)	; PUT STATE DATA IN PACKET

            00            00     F0  0113   248 	INSV	#TTY$C_FC_READ,#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3)

         20 A3            06         0116       

                 00000000'GF     17  0119   249 	JMP	G^EXE$QIODRVPKT		; INSERT PACKET ON QUEUE

                                     011F   250 ;

                                     011F   251 ; ERROR IN PROCESSING

                                     011F   252 ;

                 00000000'GF     17  011F   253 100$:	JMP	G^EXE$ABORTIO		; THE I/O IS DONE

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   7

V06             TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TE                                                                  (3)



                                     0125   255 	.SBTTL	TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TERMINAL WRITE FUNCTIONS

                                     0125   256 ;++

                                     0125   257 ; TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TERMINAL WRITE FUNCTIONS

                                     0125   258 ;

                                     0125   259 ; FUNCTIONAL DESCRIPTION:

                                     0125   260 ;

                                     0125   261 ; THIS ROUTINE IS THE FUNCTION DECISION ROUTINE FOR TERMINAL WRITE FUNCTIONS.

                                     0125   262 ;

                                     0125   263 ; THE QIO PARAMETERS FOR TERMINAL WRITES ARE:

                                     0125   264 ;

                                     0125   265 ;	P1 = ADDRESS OF THE BUFFER

                                     0125   266 ;	P2 = SIZE OF THE BUFFER

                                     0125   267 ;	P3 = UNUSED

                                     0125   268 ;	P4 = CARRIAGE CONTROL SPECIFIER (SEE TTY$CARRIAGE)

                                     0125   269 ;

                                     0125   270 ; THE FUNCTION PARAMETERS ARE VALIDATED AND IF CORRECT, THE PACKET IS

                                     0125   271 ; QUEUED ON THE UNIT I/O QUEUE.

                                     0125   272 ; THE PACKET CONTAINS THE FOLLOWING:

                                     0125   273 ;

                                     0125   274 ;	IRP$L_MEDIA IS THE NEW STATE BITS FOR THE FUNCTION

                                     0125   275 ;	IRP$L_SVAPTE IS THE ADDRESS OF THE BUFFERED I/O BLOCK, FORMATTED AS FOLLOWS:

                                     0125   276 ;

                                     0125   277 ;		.LONG	ADDRESS OF DATA START

                                     0125   278 ;		.LONG	ADDRESS OF DATA END

                                     0125   279 ;		.WORD	SIZE

                                     0125   280 ;		.WORD	TYPE

                                     0125   281 ;		DATA

                                     0125   282 ;

                                     0125   283 ; 	IRP$W_BOFF CONTAINS THE QUOTA FOR THIS I/O

                                     0125   284 ;	IRP$W_BCNT CONTAINS THE TRANSFER COUNT

                                     0125   285 ;	IRP$W_FUNC IS SET FOR A FAST CASE ON FUNCTION TYPE

                                     0125   286 ;

                                     0125   287 ; FOR IO$_WRITEPBLK OR IO$M_NOFORMAT, TTY$V_ST_WRTALL IS SET TO PREVENT

                                     0125   288 ; FORMATTING OF THE DATA.

                                     0125   289 ;

                                     0125   290 ; INPUTS:

                                     0125   291 ;

                                     0125   292 ;	R3 = I/O PACKET

                                     0125   293 ;	R4 = PCB OF PROCESS

                                     0125   294 ;	R5 = UCB

                                     0125   295 ;	R6 = ASSIGNED CCB

                                     0125   296 ;	R7 = FUNCTION CODE

                                     0125   297 ;	AP = ADDRESS OF FIRST USER QIO PARAMETER

                                     0125   298 ;

                                     0125   299 ; OUTPUTS:

                                     0125   300 ;

                                     0125   301 ;	IF THE I/O IS IN ERROR THEN IT IS COMPLETED BY "EXE$ABORTIO".

                                     0125   302 ;	IF THE I/O IS VALID THEN IT IS QUEUED TO THE UNIT BY "EXE$QIODRVPKT".

                                     0125   303 ;

                                     0125   304 ; COMPLETION CODES:

                                     0125   305 ;

                                     0125   306 ;	SS$_ACCVIO - ACCESS VIOLATION ON BUFFER ( FROM "EXE$WRTCHK" )

                                     0125   307 ;	SS$_INSFMEM - INSUFFICIENT MEMORY FOR REQUEST

                                     0125   308 ;	SS$_EXQUOTA - BUFFERED I/O QUOTA EXCEEDED

                                     0125   309 ;--

                                     0125   310 TTY$FDTWRITE::				;

            56            6C     D0  0125   311 	MOVL	P1(AP),R6		; GET USER BUFFER VIRTUAL ADDRESS

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   8

V06             TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TE                                                                  (3)



                       38 A3     D4  0128   312 	CLRL	IRP$B_CARCON(R3)	; ASSUME NO CARRIAGE CONTROL SPECIFIER

            06            00     ED  012B   313 	CMPZV	#IRP$V_FCODE,#IRP$S_FCODE,R7,#IO$_WRITEPBLK; WRITE PHYSICAL BLOCK?

            0B            57         012E       

                          08     13  0130   314 	BEQL	10$			; IF EQL THEN YES

         38 A3         0C AC     D0  0132   315 	MOVL	P4(AP),IRP$B_CARCON(R3)	; GET CARRIAGE CONTROL SPECIFIER

                          01C1   30  0137   316 	BSBW	TT$CARRIAGE		; CONVERT THE CARRIAGE CONTROL

            58         38 A3     9A  013A   317 10$:	MOVZBL	IRP$B_CARCON(R3),R8	; CALC NUMBER OF EXTRA PLACES NEEDED FOR CONTROL

            52         3A A3     9A  013E   318 	MOVZBL	IRP$B_CARCON+2(R3),R2	;

            58            52     C0  0142   319 	ADDL	R2,R8			;

            50            56     D0  0145   320 	MOVL	R6,R0			; SET UP FOR WRITE CHECK CALL

            57         04 AC     3C  0148   321 	MOVZWL	P2(AP),R7		; GET TRANSFER SIZE

            51            57     D0  014C   322 	MOVL	R7,R1			; COPY TRANSFER SIZE

                          06     13  014F   323 	BEQL	20$			; SKIP CHECK IF ZERO

                 00000000'GF     16  0151   324 	JSB	G^EXE$WRITECHK		; CHECK BUFFER ACCESS

                                     0157   325 					; NO RETURN MEANS NO ACCESS

                          38     BB  0157   326 20$:	PUSHR	#^M<R3,R4,R5>		; SAVE SOME REGISTERS

            51         10 A841   9E  0159   327 	MOVAB	TTY$L_WB_DATA+4(R8)[R1],R1; ADD HEADER TO REQUEST AND CARRIAGE CONTROL

                                     015E   328 ;

                                     015E   329 ; CHECK BUFFERED I/O QUOTA

                                     015E   330 ;

                 00000000'GF     16  015E   331 	JSB	G^EXE$BUFFRQUOTA	; CHECK QUOTA

            64            50     E9  0164   332 	BLBC	R0,105$			; BR IF ERROR

                                     0167   333 ;

                                     0167   334 ; ALLOCATE THE BUFFER

                                     0167   335 ;

                 00000000'GF     16  0167   336 	JSB	G^EXE$ALLOCBUF		; ALLOCATE THE BUFFERED I/O BLOCK

            5B            50     E9  016D   337 	BLBC	R0,105$			; BR IF ERROR

            53            6E     D0  0170   338 	MOVL	(SP),R3			; RESTORE PACKET ADDRESS

         2C A3            52     D0  0173   339 	MOVL	R2,IRP$L_SVAPTE(R3)	; SAVE BLOCK ADDRESS IN PACKET

         32 A3            58     A0  0177   340 	ADDW	R8,IRP$W_BCNT(R3)	; ADJUST TRANSFER SIZE FOR CARRIAGE CONTROL

                                     017B   341 ;

                                     017B   342 ; ADJUST QUOTA

                                     017B   343 ;

         42 A4            51     A2  017B   344 	SUBW	R1,PCB$W_BYTCNT(R4)	; ADJUST BUFFERED I/O QUOTA

         30 A3            51     B0  017F   345 	MOVW	R1,IRP$W_BOFF(R3)	; SAVE BLOCK SIZE AS QUOTA

                                     0183   346 ;

                                     0183   347 ; SET UP THE BLOCK

                                     0183   348 ;

            62         0C A2     9E  0183   349 	MOVAB	TTY$L_WB_DATA(R2),(R2)	; INSERT DATA ADDRESS

            52            0C     C0  0187   350 	ADDL	#TTY$L_WB_DATA,R2	; POINT TO DATA

                                     018A   351 ;

                                     018A   352 ; INSERT INITIAL CARRIAGE CONTROL

                                     018A   353 ;

            58         38 A3     9E  018A   354 	MOVAB	IRP$B_CARCON(R3),R8	; INSERT THE CHARACTERS

                          43     10  018E   355 	BSBB	110$			;

                                     0190   356 ;

                                     0190   357 ; COPY USER DATA TO BUFFER

                                     0190   358 ;

            66            57     28  0190   359 50$:	MOVC3	R7,(R6),(R2)		; MOVE THE DATA

                          62         0193       

            52            53     D0  0194   360 	MOVL	R3,R2			; COPY CURRENT END OF DATA

                                     0197   361 ;

                                     0197   362 ; THE USER DATA IS COPIED -- ADD TRAILING CARRIAGE RETURN IF NECESS.

                                     0197   363 ;

                          38     BA  0197   364 	POPR	#^M<R3,R4,R5>		; RESTORE REGISTERS

            58         3A A3     9E  0199   365 	MOVAB	IRP$B_CARCON+2(R3),R8	;

                          34     10  019D   366 	BSBB	110$			; INSERT CHARACTERS

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page   9

V06             TTY$FDTWRITE - FUNCTION DECISION ROUTINE FOR TE                                                                  (3)



         34 A3       0100 8F     3C  019F   367 	MOVZWL	#<TTY$M_ST_WRITE>,IRP$L_MEDIA(R3); SET UP FUNCTION DEPENDENT DATA

                                     01A5   368 ;

                                     01A5   369 ; SET WRITE PASSALL STATE FOR WRTPASSALL

                                     01A5   370 ;

         20 A3            08     E0  01A5   371 	BBS	#IO$V_NOFORMAT,IRP$W_FUNC(R3),90$; BR IF NO FORMAT SPECIFIED

                          08         01A9       

            06            00     ED  01AA   372 	CMPZV	#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3),#IO$_WRITEPBLK; PASSALL WRITE?

            0B         20 A3         01AD       

                          05     12  01B0   373 	BNEQ	100$			; BR IF NO

         34 A3            10     E2  01B2   374 90$:	BBSS	#TTY$V_ST_WRTALL,IRP$L_MEDIA(R3),100$; SET NO FORMAT MODE FOR WRITE

                          00         01B6       

                                     01B7   375 ;

                                     01B7   376 ; COMPLETE THE WRITE OPERATION

                                     01B7   377 ;

            51         2C A3     D0  01B7   378 100$:	MOVL	IRP$L_SVAPTE(R3),R1	; GET BLOCK ADDRESS

         04 A1            52     D0  01BB   379 	MOVL	R2,TTY$L_WB_END(R1)	; INSERT ADDRESS OF DATA END

            00            01     F0  01BF   380 	INSV	#TTY$C_FC_WRITE,#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3);

         20 A3            06         01C2       

                 00000000'GF     17  01C5   381 	JMP	G^EXE$QIODRVPKT		; QUEUE PACKET TO DRIVER

                                     01CB   382 ;

                                     01CB   383 ; ERROR IN PROCESSING

                                     01CB   384 ;

                          38     BA  01CB   385 105$:	POPR	#^M<R3,R4,R5>		; RESTORE REGISTERS

                 00000000'GF     17  01CD   386 	JMP	G^EXE$ABORTIO		; ABORT THE I/O

                                     01D3   387 ;

                                     01D3   388 ; SUBROUTINE TO INSERT PRE/SUF CARRIAGE CONTROL

                                     01D3   389 ;

            50            68     9A  01D3   390 110$:	MOVZBL	(R8),R0			; GET NUMBER OF CHARACTERS

                          13     13  01D6   391 	BEQL	130$			; IF EQL THEN NONE

            82         01 A8     90  01D8   392 	MOVB	1(R8),(R2)+		; INSERT CHARACTER

                          0D     12  01DC   393 	BNEQ	130$			; IF NEQ THEN DONE

         FF A2            0D     90  01DE   394 	MOVB	#TTY$C_CR,-1(R2)	; INSERT CARRIAGE RETURN TO START

                       32 A3     B6  01E2   395 	INCW	IRP$W_BCNT(R3)		; INCREASE BYTE COUNT FOR CR

            82            0A     90  01E5   396 120$:	MOVB	#TTY$C_LF,(R2)+		; INSERT LINE FEEDS

            FA            50     F5  01E8   397 	SOBGTR	R0,120$			; UNTIL DONE

                                 05  01EB   398 130$:	RSB				;

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  10

V06             TTY$FDTSETM -- FUNCTION DECISION ROUTINE FOR TE                                                                  (4)



                                     01EC   400 	.SBTTL	TTY$FDTSETM -- FUNCTION DECISION ROUTINE FOR TERMINAL SET MODE

                                     01EC   401 ;++

                                     01EC   402 ; TTY$FDTSETM - FUNCTION DECISION ROUTINE FOR TERMINAL SET MODE FUNCTIONS

                                     01EC   403 ;

                                     01EC   404 ; FUNCTIONAL DESCRIPTION:

                                     01EC   405 ;

                                     01EC   406 ; THIS ROUTINE IS THE FUNCTION DECISION ROUTINE FOR TERMINAL SET MODE FUNCTIONS.

                                     01EC   407 ; THERE ARE TWO BASIC FUNCTIONS -- SET UP FOR CONTROL C AND SET MODE.

                                     01EC   408 ;

                                     01EC   409 ; THE FUNCTION CODE IS SET FOR A FAST CASE ON TYPE

                                     01EC   410 ;

                                     01EC   411 ; INPUTS:

                                     01EC   412 ;

                                     01EC   413 ;	R3 = I/O PACKET ADDRESS

                                     01EC   414 ;	R4 = PCB ADDRESS OF CURRENT PROCESS

                                     01EC   415 ;	R5 = UCB ADDRESS

                                     01EC   416 ;	R6 = CCB ADDRESS FOR ASSIGNED UNIT

                                     01EC   417 ;	AP = ADDRESS OF ARGUMENT LIST AT USER PARAMETERS

                                     01EC   418 ;

                                     01EC   419 ; OUTPUTS:

                                     01EC   420 ;

                                     01EC   421 ;	THE FUNCTION IS COMPLETED HERE BY "EXE$FINISHIO".

                                     01EC   422 ;

                                     01EC   423 ; IMPLICIT OUTPUTS:

                                     01EC   424 ;

                                     01EC   425 ; 	R3,R5 ARE PRESERVED.

                                     01EC   426 ;--

                                     01EC   427 TTY$FDTSETM::				;

            00            02     F0  01EC   428 	INSV	#TTY$C_FC_SETM,#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3);

         20 A3            06         01EF       

                          06     11  01F2   429 	BRB	SET_COMMON

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  11

V06             TTY$FDTSETC - FUNCTION DECISION ROUTINE FOR TER                                                                  (5)



                                     01F4   431 	.SBTTL	TTY$FDTSETC - FUNCTION DECISION ROUTINE FOR TERMINAL SET CHARS

                                     01F4   432 ;++

                                     01F4   433 ; TTY$FDTSETC - FUNCTION DECISION ROUTINE FOR TERMINAL SET CHARACTERISTICS FUNCTIONS

                                     01F4   434 ;

                                     01F4   435 ; FUNCTIONAL DESCRIPTION:

                                     01F4   436 ;

                                     01F4   437 ; THIS ROUTINE IS THE FUNCTION DECISION ROUTINE FOR TERMINAL SET MODE FUNCTIONS.

                                     01F4   438 ; THERE ARE TWO BASIC FUNCTIONS -- SET UP FOR CONTROL Y AND SET MODE.

                                     01F4   439 ;

                                     01F4   440 ; INPUTS:

                                     01F4   441 ;

                                     01F4   442 ;	R3 = I/O PACKET ADDRESS

                                     01F4   443 ;	R4 = PCB ADDRESS OF CURRENT PROCESS

                                     01F4   444 ;	R5 = UCB ADDRESS

                                     01F4   445 ;	R6 = CCB ADDRESS FOR ASSIGNED UNIT

                                     01F4   446 ;	AP = ADDRESS OF ARGUMENT LIST AT USER PARAMETERS

                                     01F4   447 ;

                                     01F4   448 ; OUTPUTS:

                                     01F4   449 ;

                                     01F4   450 ;	THE FUNCTION IS COMPLETED HERE BY "EXE$FINISHIO".

                                     01F4   451 ;

                                     01F4   452 ; IMPLICIT OUTPUTS:

                                     01F4   453 ;

                                     01F4   454 ; 	R3,R5 ARE PRESERVED.

                                     01F4   455 ;--

                                     01F4   456 TTY$FDTSETC::				;

            00            03     F0  01F4   457 	INSV	#TTY$C_FC_SETC,#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3);

         20 A3            06         01F7       

                                     01FA   458 SET_COMMON:

            57       0080 C5     9E  01FA   459 	MOVAB	UCB$L_TT_CTRLC(R5),R7	; ASSUME CONTROL C

         20 A3            08     E0  01FF   460 	BBS	#IO$V_CTRLCAST,IRP$W_FUNC(R3),CTRLAST; BR IF CONTROL C

                          17         0203       

            57         7C A5     9E  0204   461 	MOVAB	UCB$L_TT_CTRLY(R5),R7	; ADDRESS LIST HEAD

         20 A3            07     E1  0208   462 	BBC	#IO$V_CTRLYAST,IRP$W_FUNC(R3),SET; BR IF SET CHAR

                          1A         020C       

            50       0000'8F     3C  020D   463 	MOVZWL	#SS$_NOPRIV,R0		; ASSUME NO PRIVILEGE

                          51     DC  0212   464 	MOVPSL	R1			; GET PSL

            02            16     ED  0214   465 	CMPZV	#PSL$V_PRVMOD,#PSL$S_PRVMOD,R1,#PSL$C_SUPER

            02            51         0217       

                          30     14  0219   466 	BGTR	BAD_SET			; IF GTR THEN NOT PRIVILEGED

                 00000000'GF     16  021B   467 CTRLAST:JSB	G^COM$SETATTNAST	; ENTER SET UP CODE

                 00000000'GF     17  0221   468 	JMP	G^EXE$FINISHIOC		;

                                     0227   469 ;

                                     0227   470 ; PROCESS SET MODE OR CHARACTERISTICS

                                     0227   471 ;

                                     0227   472 SET:					;

                          008C   30  0227   473 	BSBW	COMMON_SENSE		; PROCESS ARGS

         34 A3            61     7D  022A   474 	MOVQ	(R1),IRP$L_MEDIA(R3)	; SAVE NEW DATA

         3C A3         08 AC     B0  022E   475 	MOVW	P3(AP),IRP$W_TT_PRMPT(R3); GET THE SPEED PARAMETER

         3E A3         0C AC     B0  0233   476 	MOVW	P4(AP),IRP$W_TT_PRMPT+2(R3); SAVE FILLS

         34 A3         10 AC     90  0238   477 	MOVB	P5(AP),IRP$L_MEDIA(R3)	; SAVE PARITY

                 00000000'GF     17  023D   478 15$:	JMP	G^EXE$QIODRVPKT		; QUEUE PACKET TO DRIVER

            00            04     F0  0243   479 20$:	INSV	#TTY$C_FC_N_SET,#IRP$V_FCODE,#IRP$S_FCODE,IRP$W_FUNC(R3); SET SENSE, NO SE

         20 A3            06         0246       

                          F2     11  0249   480 	BRB	15$			; AND CONTINUE

                 00000000'GF     17  024B   481 BAD_SET:JMP	G^EXE$ABORTIO		; RETURN ON ERROR

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  12

V06             SENSE MODE OR CHARACTERISTICS                                                                                    (6)



                                     0251   483 	.SBTTL	SENSE MODE OR CHARACTERISTICS

                                     0251   484 ;++

                                     0251   485 ; TTY$FDTSENSEM - SENSE MODE

                                     0251   486 ; TTY$FDTSENSEC - SENSE CHARACTERISTICS

                                     0251   487 ;

                                     0251   488 ; FUNCTIONAL DESCRIPTION:

                                     0251   489 ;

                                     0251   490 ; THIS ROUTINE PASSES THE CURRENT CHARACTERISTICS FOR SENSEMODE AND

                                     0251   491 ; THE PERMANENT CHARACTERISTICS FOR SETCHAR.

                                     0251   492 ; THE BUFFER RETURNED IS A QUADWORD.

                                     0251   493 ;

                                     0251   494 ; INPUTS:

                                     0251   495 ;

                                     0251   496 ;	R3 = I/O PACKET ADDRESS

                                     0251   497 ;	R4 = CURRENT PCB ADDRESS

                                     0251   498 ;	R5 = UCB ADDRESS

                                     0251   499 ;	R6 = CCB ADDRESS

                                     0251   500 ;	R7 = FUNCTION CODE

                                     0251   501 ;	AP = ARG LIST FROM QIO

                                     0251   502 ;

                                     0251   503 ; OUTPUTS:

                                     0251   504 ;

                                     0251   505 ;	CONTROL IS PASSED TO EXE$FINISHIO ON SUCCESS

                                     0251   506 ;	AND EXE$ABORTIO ON FAILURE

                                     0251   507 ;

                                     0251   508 ; STATUS RETURNS:

                                     0251   509 ;

                                     0251   510 ;	SS$_NORMAL - SUCCESSFULL

                                     0251   511 ;	SS$_ACCVIO - BUFFER NOT ACCESSIBLE

                                     0251   512 ;--

                                     0251   513 TTY$FDTSENSEM::				; SENSE MODE

                          63     10  0251   514 	BSBB	COMMON_SENSE		; PROCESS ARG LIST

            61         38 A5     D0  0253   515 	MOVL	UCB$B_DEVCLASS(R5),(R1); RETURN CLASS, TYPE AND BUFFER SIZE

         04 A1         3C A5     D0  0257   516 	MOVL	UCB$L_DEVDEPEND(R5),4(R1); RETURN DEVICE DEPENDENT LONG WORD

       009A C5   FFC0FFFF 8F     CB  025C   517 	BICL3	#^C<UCB$M_TT_SPEED@16>,UCB$B_TT_SPEED-2(R5),R0; RETURN SPEED

                          50         0265       

       009A C5   FF3FFFFF 8F     CB  0266   518 	BICL3	#^C<<UCB$M_TT_PARTY!UCB$M_TT_ODD>@16>,UCB$B_TT_SPEED-2(R5),R1;

                          51         026F       

            51       009D C5     B0  0270   519 	MOVW	UCB$B_TT_CRFILL(R5),R1	; INSERT FILL DATA

            50       0000'8F     B0  0275   520 	MOVW	#SS$_NORMAL,R0		; SET STATUS

                 00000000'GF     17  027A   521 	JMP	G^EXE$FINISHIO		; COMPLETE THE I/O

                                     0280   522 ;

                                     0280   523 ;

                                     0280   524 TTY$FDTSENSEC::				; SENSE CHAR

                          34     10  0280   525 	BSBB	COMMON_SENSE		; PROCESS ARG LIST

            61         00'8F     90  0282   526 	MOVB	#DC$_TERM,(R1)		; SET CLASS

         01 A1       00A4 C5     D0  0286   527 	MOVL	UCB$B_TT_DETYPE(R5),1(R1); RETURN TYPE AND BUFFER SIZE

         04 A1       00A8 C5     D0  028C   528 	MOVL	UCB$L_TT_DECHAR(R5),4(R1); RETURN DEVICE DEPENDENT LONG WORD

       009E C5   FFC0FFFF 8F     CB  0292   529 	BICL3	#^C<UCB$M_TT_SPEED@16>,UCB$B_TT_DESPEE-2(R5),R0; RETURN SPEED

                          50         029B       

       009E C5   FF3FFFFF 8F     CB  029C   530 	BICL3	#^C<<UCB$M_TT_PARTY!UCB$M_TT_ODD>@16>,UCB$B_TT_DESPEE-2(R5),R1;

                          51         02A5       

            51       00A1 C5     B0  02A6   531 	MOVW	UCB$B_TT_DECRF(R5),R1	; INSERT FILL DATA

            50       0000'8F     B0  02AB   532 	MOVW	#SS$_NORMAL,R0		; SET STATUS

                 00000000'GF     17  02B0   533 	JMP	G^EXE$FINISHIO		; COMPLETE THE I/O

                                     02B6   534 ;

                                     02B6   535 ; COMMON SENSE SUBROUTINE

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  13

V06             SENSE MODE OR CHARACTERISTICS                                                                                    (6)



                                     02B6   536 ;

                                     02B6   537 COMMON_SENSE:				;

            51            6C     D0  02B6   538 	MOVL	P1(AP),R1		; ADDRESS BUFFER

            52         04 AC     3C  02B9   539 	MOVZWL	P2(AP),R2		; GET SIZE

                          0C     13  02BD   540 	BEQL	10$			; IF EQL THEN ERROR

                                     02BF   541 	IFNOWRT	R2,(R1),20$		; BR IF NO ACCESS

            52            08     B1  02C5   542 	CMPW	#8,R2			; ENOUGH?

                          01     1A  02C8   543 	BGTRU	10$			; IF GTRU THEN NO

                                 05  02CA   544 	RSB				; CONTINUE

            50       0000'8F     3C  02CB   545 10$:	MOVZWL	#SS$_BADPARAM,R0	; SET ERROR CODE

                          05     11  02D0   546 	BRB	25$			; CONTINUE

            50       0000'8F     3C  02D2   547 20$:	MOVZWL	#SS$_ACCVIO,R0		; SET ACCESS VIOLATION

                 00000000'GF     17  02D7   548 25$:	JMP	G^EXE$ABORTIO		; PASS ERROR

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  14

V06             CARRAIGE CONTROL INTERPRETATION                                                                                  (7)



                                     02DD   550 	.SBTTL	CARRAIGE CONTROL INTERPRETATION

                                     02DD   551 ;++

                                     02DD   552 ; TT$CARRIAGE - INTERPRET CARRIAGE CONTROL SPECIFIER

                                     02DD   553 ;

                                     02DD   554 ; FUNCTIONAL DESCRIPTION:

                                     02DD   555 ;

                                     02DD   556 ; THIS ROUTINE IS USED BY THE LINE PRINTER DRIVER AND THE TERMINAL

                                     02DD   557 ; DRIVER TO INTERPRET THE CARRIAGE CONTROL SPECIFIER IN IRP$B_CARCON .

                                     02DD   558 ;

                                     02DD   559 ; THE SPECIFIER IS AS FOLLOWS:

                                     02DD   560 ;

                                     02DD   561 ;	.BYTE 1 -- FORTRAN CARRIAGE CONTROL CHARACTER IF NOT 0

                                     02DD   562 ;	.BYTE 2 -- 0

                                     02DD   563 ;	.BYTE 3 -- PREFIX CARRIAGE CONTROL

                                     02DD   564 ;	.BYTE 4 -- SUFFIX CARRIAGE CONTROL

                                     02DD   565 ;

                                     02DD   566 ; THE PRE/SUF FIELDS ARE AS FOLLOWS

                                     02DD   567 ;

                                     02DD   568 ;	IF BIT 7=0 THEN BITS 6-0 ARE THE NUMBER OF NEWLINES TO INSERT.

                                     02DD   569 ;	IF BIT 7=1 AND BIT 6=0 THEN BITS 4-0 ARE THE ASCII CHARACTER TO

                                     02DD   570 ;			       OUTPUT. ASCII SET C0 OR C1 IS SPECIFIED BY BIT 5.

                                     02DD   571 ;	IF BIT 7=1 AND BIT 6=1 THEN BITS 5-0 ARE THE PRINTER CHANNEL NUMBER

                                     02DD   572 ;

                                     02DD   573 ; ASCII SET C0 IS ASSUMED AND BIT 6 IS IGNORED IF BIT 7=0.

                                     02DD   574 ;

                                     02DD   575 ; INPUTS:

                                     02DD   576 ;

                                     02DD   577 ;	R3 = ADDRESS OF THE I/O PACKET

                                     02DD   578 ;	R5 = ADDRESS OF THE UCB

                                     02DD   579 ;

                                     02DD   580 ; OUTPUTS:

                                     02DD   581 ;

                                     02DD   582 ;	IRP$B_CARCON IS SET UP TO REFLECT THE PRE/SUF CHARACTERS TO SEND.

                                     02DD   583 ;

                                     02DD   584 ;	BYTE 0 = NUMBER OF CHARACTERS TO SEND

                                     02DD   585 ;	BYTE 1 = CHARACTER, IF 0 THEN NEWLINE

                                     02DD   586 ;

                                     02DD   587 ;	IRP$B_CARCON+2 HAS THE SUFFIX CONTROL.

                                     02DD   588 ;

                                     02DD   589 ;	R0,R1 ARE USED.

                                     02DD   590 ;

                                     02DD   591 ;--

                                     02DD   592 ;

                                     02DD   593 ; LOCAL DATA TABLE

                                     02DD   594 ;

                                     02DD   595 CCTABLE:				; CARRIAGE CONTROL TO FORTRAN MATCH TABLE

                        0D 01 00 01  02DD   596 	.BYTE	1,0,1,TTY$C_CR		; SPACE

                                 20  02E1   597 	.ASCII	/ /			;

                        0D 01 00 02  02E2   598 	.BYTE	2,0,1,TTY$C_CR		; "0"

                                 30  02E6   599 	.ASCII	/0/

                        0D 01 0C 01  02E7   600 	.BYTE	1,TTY$C_FF,1,TTY$C_CR	; "1"

                                 31  02EB   601 	.ASCII	/1/

                        0D 01 00 00  02EC   602 	.BYTE	0,0,1,TTY$C_CR		; "+"

                                 2B  02F0   603 	.ASCII	/+/

                        00 00 00 01  02F1   604 	.BYTE	1,0,0,0			; "$"

                                 24  02F5   605 	.ASCII	/$/

                        0D 01 00 01  02F6   606 	.BYTE	1,0,1,TTY$C_CR		; DEFAULT

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  15

V06             CARRAIGE CONTROL INTERPRETATION                                                                                  (7)



                                 00  02FA   607 	.BYTE	0			; TABLE END

                                     02FB   608 ;

                                     02FB   609 ;

                                     02FB   610 ;

                                     02FB   611 TT$CARRIAGE::				; INTERPRET CARRIAGE CONTROL

            51         38 A3     9A  02FB   612 	MOVZBL	IRP$B_CARCON(R3),R1	; GET FORTRAN SPECIFIER

                          12     13  02FF   613 	BEQL	20$			; IF EQL THEN TRY PRE/SUF

            50         D9 AF     9E  0301   614 	MOVAB	B^CCTABLE,R0		; ADDRESS MATCH TABLE

         38 A3            80     D0  0305   615 10$:	MOVL	(R0)+,IRP$B_CARCON(R3)	; ASSUME MATCH

                          60     95  0309   616 	TSTB	(R0)			; END OF TABLE?

                          05     13  030B   617 	BEQL	15$			; IF EQL THEN YES

            51            80     91  030D   618 	CMPB	(R0)+,R1		; MATCH?

                          F3     12  0310   619 	BNEQ	10$			; NO THEN SEARCH

                                 05  0312   620 15$:	RSB				; ELSE RETURN

                                     0313   621 ;

                                     0313   622 ; PRE/SUF CARRIAGE CONTROL

                                     0313   623 ;

            51         3A A3     9A  0313   624 20$:	MOVZBL	IRP$B_CARCON+2(R3),R1	; GET PREFIX SPECIFIER

                          02     13  0317   625 	BEQL	30$			; IF EQL THEN NONE

                          19     10  0319   626 	BSBB	100$			; INTERPRET THE SPECIFIER

         38 A3            51     90  031B   627 30$:	MOVB	R1,IRP$B_CARCON(R3)	; INSERT NUMBER

         39 A3            50     90  031F   628 	MOVB	R0,IRP$B_CARCON+1(R3)	; INSERT CHARACTER

            51         3B A3     9A  0323   629 	MOVZBL	IRP$B_CARCON+3(R3),R1	; GET SUFFIX SPECIFIER

                          02     13  0327   630 	BEQL	40$			; IF EQL THEN NONE

                          09     10  0329   631 	BSBB	100$			; CONVERT THE SPECIFIER

         3A A3            51     90  032B   632 40$:	MOVB	R1,IRP$B_CARCON+2(R3)	; INSERT NUMBER

         3B A3            50     90  032F   633 	MOVB	R0,IRP$B_CARCON+3(R3)	; INSERT CHARACTER

                                 05  0333   634 	RSB				; RETURN

                                     0334   635 ;

                                     0334   636 ; SUBROUTINE TO INTERPRET PRE/SUF SPECIFIER

                                     0334   637 ;

                          50     D4  0334   638 100$:	CLRL	R0			; ASSUME NEWLINE

            51            07     E1  0336   639 	BBC	#7,R1,110$		; IF BIT 7 CLEAR THEN DONE

                          08         0339       

            51         E0 8F     8B  033A   640 	BICB3	#^X0E0,R1,R0		; REMOVE OTHER BITS

                          50         033E       

            51            01     9A  033F   641 	MOVZBL	#1,R1			; SET ONE CHARACTER

                                 05  0342   642 110$:	RSB				; RETURN

                                     0343   643 ;

                                     0343   644 	.END

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  16

SYMBOL TABLE                                                                                                                     (7)



BAD_SET          0000024B R     03   IO$M_BINARY    = 00000040            IO$V_INHSEEK   = 0000000C            

BIT...         = 00000008            IO$M_CANCTRLO  = 00000040            IO$V_INTERRUPT = 00000006            

CCTABLE          000002DD R     03   IO$M_COMMOD    = 00000040            IO$V_INTSKIP   = 00000008            

COM$SETATTNAST   ********   X   03   IO$M_CREATE    = 00000080            IO$V_MOUNT     = 00000009            

COMMON_SENSE     000002B6 R     03   IO$M_CTRLCAST  = 00000100            IO$V_NOECHO    = 00000006            

CTRLAST          0000021B R     03   IO$M_CTRLYAST  = 00000080            IO$V_NOFILTR   = 00000009            

DC$_TERM         ********   X   03   IO$M_CVTLOW    = 00000100            IO$V_NOFORMAT  = 00000008            

DYN$C_ACB      = 00000002            IO$M_DATACHECK = 00004000            IO$V_NOW       = 00000006            

DYN$C_ADP      = 00000001            IO$M_DELETE    = 00000100            IO$V_NOWAIT    = 00000007            

DYN$C_AQB      = 00000003            IO$M_DMOUNT    = 00000400            IO$V_PACKED    = 00000007            

DYN$C_BRDCST   = 0000001A            IO$M_DSABLMBX  = 00000400            IO$V_PURGE     = 0000000B            

DYN$C_BUFIO    = 00000013            IO$M_ENABLMBX  = 00000080            IO$V_READATTN  = 00000007            

DYN$C_CEB      = 00000004            IO$M_FCODE     = 0000003F            IO$V_REVERSE   = 00000006            

DYN$C_CRB      = 00000005            IO$M_HANGUP    = 00000200            IO$V_SHUTDOWN  = 00000007            

DYN$C_CXB      = 0000001B            IO$M_INHERLOG  = 00000800            IO$V_STARTUP   = 00000006            

DYN$C_DDB      = 00000006            IO$M_INHEXTGAP = 00001000            IO$V_SYNCH     = 00000009            

DYN$C_DPT      = 0000001E            IO$M_INHRETRY  = 00008000            IO$V_TIMED     = 00000007            

DYN$C_FCB      = 00000007            IO$M_INHSEEK   = 00001000            IO$V_TRMNOECHO = 0000000C            

DYN$C_FRK      = 00000008            IO$M_INTERRUPT = 00000040            IO$V_WRTATTN   = 00000008            

DYN$C_GSD      = 00000015            IO$M_INTSKIP   = 00000100            IO$_ACCESS     = 00000032            

DYN$C_IDB      = 00000009            IO$M_MOUNT     = 00000200            IO$_ACPCONTROL = 00000038            

DYN$C_IRP      = 0000000A            IO$M_NOECHO    = 00000040            IO$_CREATE     = 00000033            

DYN$C_JPB      = 0000001F            IO$M_NOFILTR   = 00000200            IO$_DEACCESS   = 00000034            

DYN$C_KFH      = 00000026            IO$M_NOFORMAT  = 00000100            IO$_DELETE     = 00000035            

DYN$C_KFI      = 00000018            IO$M_NOW       = 00000040            IO$_DIAGNOSE   = 0000001D            

DYN$C_LOG      = 0000000B            IO$M_NOWAIT    = 00000080            IO$_DRVCLR     = 00000004            

DYN$C_MTL      = 00000019            IO$M_PACKED    = 00000080            IO$_ERASETAPE  = 00000006            

DYN$C_MVL      = 00000016            IO$M_PURGE     = 00000800            IO$_LOGICAL    = 0000002F            

DYN$C_NDB      = 0000001C            IO$M_READATTN  = 00000080            IO$_MODIFY     = 00000036            

DYN$C_NET      = 00000017            IO$M_REVERSE   = 00000040            IO$_MOUNT      = 00000039            

DYN$C_PBH      = 00000020            IO$M_SHUTDOWN  = 00000080            IO$_NOP        = 00000000            

DYN$C_PCB      = 0000000C            IO$M_STARTUP   = 00000040            IO$_OFFSET     = 00000006            

DYN$C_PDB      = 00000021            IO$M_SYNCH     = 00000200            IO$_PACKACK    = 00000008            

DYN$C_PFL      = 00000023            IO$M_TIMED     = 00000080            IO$_PHYSICAL   = 0000001F            

DYN$C_PIB      = 00000022            IO$M_TRMNOECHO = 00001000            IO$_READHEAD   = 0000000E            

DYN$C_PQB      = 0000000D            IO$M_WRTATTN   = 00000100            IO$_READLBLK   = 00000021            

DYN$C_PTR      = 00000025            IO$S_FCODE     = 00000006            IO$_READPBLK   = 0000000C            

DYN$C_RVT      = 0000000E            IO$V_ABORT     = 00000008            IO$_READPRESET = 00000019            

DYN$C_SFT      = 00000024            IO$V_ACCESS    = 00000006            IO$_READPROMPT = 00000037            

DYN$C_SSB      = 0000001D            IO$V_ATTNAST   = 00000008            IO$_READTRACKD = 00000010            

DYN$C_TQE      = 0000000F            IO$V_BINARY    = 00000006            IO$_READVBLK   = 00000031            

DYN$C_TYPAHD   = 00000014            IO$V_CANCTRLO  = 00000006            IO$_RECAL      = 00000003            

DYN$C_UCB      = 00000010            IO$V_COMMOD    = 00000006            IO$_RELEASE    = 00000005            

DYN$C_VCB      = 00000011            IO$V_CREATE    = 00000007            IO$_RETCENTER  = 00000007            

DYN$C_WCB      = 00000012            IO$V_CTRLCAST  = 00000008            IO$_REWIND     = 00000024            

EXE$ABORTIO      ********   X   03   IO$V_CTRLYAST  = 00000007            IO$_REWINDOFF  = 00000022            

EXE$ALLOCBUF     ********   X   03   IO$V_CVTLOW    = 00000008            IO$_SEARCH     = 00000009            

EXE$BUFFRQUOTA   ********   X   03   IO$V_DATACHECK = 0000000E            IO$_SEEK       = 00000002            

EXE$FINISHIO     ********   X   03   IO$V_DELETE    = 00000008            IO$_SENSECHAR  = 0000001B            

EXE$FINISHIOC    ********   X   03   IO$V_DMOUNT    = 0000000A            IO$_SENSEMODE  = 00000027            

EXE$QIODRVPKT    ********   X   03   IO$V_DSABLMBX  = 0000000A            IO$_SETCHAR    = 0000001A            

EXE$READCHK      ********   X   03   IO$V_ENABLMBX  = 00000007            IO$_SETMODE    = 00000023            

EXE$WRITECHK     ********   X   03   IO$V_FCODE     = 00000000            IO$_SKIPFILE   = 00000025            

GBL...         = 00000000            IO$V_HANGUP    = 00000009            IO$_SKIPRECORD = 00000026            

IO$M_ABORT     = 00000100            IO$V_INHERLOG  = 0000000B            IO$_SPACEFILE  = 00000002            

IO$M_ACCESS    = 00000040            IO$V_INHEXTGAP = 0000000C            IO$_SPACERECORD= 00000009            

IO$M_ATTNAST   = 00000100            IO$V_INHRETRY  = 0000000F            IO$_STARTSPNDL = 00000019            

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  17

SYMBOL TABLE                                                                                                                     (7)



IO$_UNLOAD     = 00000001            IRP$S_MODE     = 00000002            PCB$V_ASTPEN   = 00000011            

IO$_VIRTUAL    = 0000003F            IRP$V_BUFIO    = 00000000            PCB$V_BATCH    = 0000000E            

IO$_WRITECHECK = 0000000A            IRP$V_CHAINED  = 00000005            PCB$V_DELPEN   = 00000001            

IO$_WRITECHECKH= 00000018            IRP$V_COMPLX   = 00000003            PCB$V_FORCPEN  = 00000002            

IO$_WRITEHEAD  = 0000000D            IRP$V_DIAGBUF  = 00000007            PCB$V_HIBER    = 00000013            

IO$_WRITELBLK  = 00000020            IRP$V_FCODE    = 00000000            PCB$V_INQUAN   = 00000003            

IO$_WRITEMARK  = 0000001C            IRP$V_FMOD     = 00000006            PCB$V_LOGIN    = 00000014            

IO$_WRITEOF    = 00000028            IRP$V_FUNC     = 00000001            PCB$V_NETWRK   = 00000015            

IO$_WRITEPBLK  = 0000000B            IRP$V_MBXIO    = 0000000A            PCB$V_NOACNT   = 0000000F            

IO$_WRITETRACKD= 0000000F            IRP$V_MODE     = 00000000            PCB$V_NODELET  = 00000017            

IO$_WRITEVBLK  = 00000030            IRP$V_PAGIO    = 00000002            PCB$V_PHDRES   = 00000012            

IPL$_ASTDEL    = 00000002            IRP$V_PHYSIO   = 00000008            PCB$V_PSWAPM   = 00000004            

IPL$_HWCLK     = 00000018            IRP$V_PRIVIO   = 00000009            PCB$V_PWRAST   = 00000016            

IPL$_IOPOST    = 00000004            IRP$V_SWAPIO   = 00000006            PCB$V_RES      = 00000000            

IPL$_MAILBOX   = 0000000B            IRP$V_VIRTUAL  = 00000004            PCB$V_RESPEN   = 00000005            

IPL$_POWER     = 0000001F            IRP$W_ABCNT      0000003C            PCB$V_SSFEXC   = 00000006            

IPL$_QUEUEAST  = 00000006            IRP$W_BCNT       00000032            PCB$V_SSFEXCE  = 00000007            

IPL$_SCHED     = 00000003            IRP$W_BOFF       00000030            PCB$V_SSFEXCS  = 00000008            

IPL$_SYNCH     = 00000007            IRP$W_CHAN       00000028            PCB$V_SSFEXCU  = 00000009            

IPL$_TIMER     = 00000007            IRP$W_FUNC       00000020            PCB$V_SSRWAIT  = 0000000A            

IRP$B_CARCON     00000038            IRP$W_OBCNT      0000003E            PCB$V_SUSPEN   = 0000000B            

IRP$B_EFN        00000022            IRP$W_SIZE       00000008            PCB$V_SWPVBN   = 00000010            

IRP$B_PRI        00000023            IRP$W_STS        0000002A            PCB$V_WAKEPEN  = 0000000C            

IRP$B_RMOD       0000000B            IRP$W_TT_PRMPT   0000003C            PCB$V_WALL     = 0000000D            

IRP$B_TYPE       0000000A            P1             = 00000000            PCB$W_APTCNT     00000034            

IRP$C_LENGTH     0000004C            P2             = 00000004            PCB$W_ASTCNT     0000003C            

IRP$K_LENGTH     0000004C            P3             = 00000008            PCB$W_BIOCNT     0000003E            

IRP$L_AST        00000010            P4             = 0000000C            PCB$W_BIOLM      00000040            

IRP$L_ASTPRM     00000014            P5             = 00000010            PCB$W_BYTCNT     00000042            

IRP$L_DIAGBUF    00000044            P6             = 00000014            PCB$W_BYTLM      00000068            

IRP$L_IOQBL      00000004            PCB$B_ASTACT     0000000C            PCB$W_DIOCNT     00000044            

IRP$L_IOQFL      00000000            PCB$B_ASTEN      0000000D            PCB$W_DIOLM      00000046            

IRP$L_IOSB       00000024            PCB$B_PRI        0000000B            PCB$W_FILCNT     00000048            

IRP$L_IOST1      00000034            PCB$B_PRIB       00000033            PCB$W_GPGCNT     00000038            

IRP$L_IOST2      00000038            PCB$B_TYPE       0000000A            PCB$W_GRP        00000022            

IRP$L_MEDIA      00000034            PCB$B_WEFC       00000032            PCB$W_MEM        00000020            

IRP$L_PID        0000000C            PCB$C_LENGTH     0000007C            PCB$W_MTXCNT     0000000E            

IRP$L_SEGVBN     00000040            PCB$K_LENGTH     0000007C            PCB$W_PPGCNT     0000003A            

IRP$L_SEQNUM     00000048            PCB$L_ASTQBL     00000014            PCB$W_PRCCNT     0000006A            

IRP$L_SVAPTE     0000002C            PCB$L_ASTQFL     00000010            PCB$W_SIZE       00000008            

IRP$L_TT_TERM    00000038            PCB$L_EFC2P      00000058            PCB$W_STATE      00000030            

IRP$L_UCB        0000001C            PCB$L_EFC3P      0000005C            PCB$W_TMBU       00000036            

IRP$L_WIND       00000018            PCB$L_EFCS       00000050            PCB$W_TQCNT      0000004A            

IRP$M_BUFIO    = 00000001            PCB$L_EFCU       00000054            PRV$V_ALLSPOOL = 00000004            

IRP$M_CHAINED  = 00000020            PCB$L_EFWM       0000004C            PRV$V_BUGCHK   = 00000017            

IRP$M_COMPLX   = 00000008            PCB$L_OWNER      0000001C            PRV$V_CMEXEC   = 00000001            

IRP$M_DIAGBUF  = 00000080            PCB$L_PHD        00000064            PRV$V_CMKRNL   = 00000000            

IRP$M_FUNC     = 00000002            PCB$L_PHYPCB     00000018            PRV$V_DETACH   = 00000005            

IRP$M_MBXIO    = 00000400            PCB$L_PID        00000060            PRV$V_DIAGNOSE = 00000006            

IRP$M_PAGIO    = 00000004            PCB$L_PQB        0000004C            PRV$V_EXQUOTA  = 00000013            

IRP$M_PHYSIO   = 00000100            PCB$L_SQBL       00000004            PRV$V_GROUP    = 00000008            

IRP$M_PRIVIO   = 00000200            PCB$L_SQFL       00000000            PRV$V_GRPNAM   = 00000003            

IRP$M_SWAPIO   = 00000040            PCB$L_STS        00000028            PRV$V_LOG_IO   = 00000007            

IRP$M_VIRTUAL  = 00000010            PCB$L_UIC        00000020            PRV$V_MOUNT    = 00000011            

IRP$Q_NT_PRVMSK  0000003C            PCB$L_WSSWP      00000024            PRV$V_NETMBX   = 00000014            

IRP$S_FCODE    = 00000006            PCB$L_WTIME      0000002C            PRV$V_NOACNT   = 00000009            

IRP$S_FMOD     = 0000000A            PCB$T_LNAME      0000006C            PRV$V_OPER     = 00000012            

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  18

SYMBOL TABLE                                                                                                                     (7)



PRV$V_PHY_IO   = 00000016            TT$C_BAUD_3600 = 0000000C            TT$_VT05       = 00000001            

PRV$V_PRMCEB   = 0000000A            TT$C_BAUD_4800 = 0000000D            TT$_VT52       = 00000040            

PRV$V_PRMGBL   = 00000018            TT$C_BAUD_50   = 00000001            TT$_VT55       = 00000041            

PRV$V_PRMMBX   = 0000000B            TT$C_BAUD_600  = 00000007            TT$_VT5X       = 00000040            

PRV$V_PSWAPM   = 0000000C            TT$C_BAUD_7200 = 0000000E            TTY$A_STANDARD   ********   X   03   

PRV$V_SETPRI   = 0000000D            TT$C_BAUD_75   = 00000002            TTY$B_BD_CNT     00000015            

PRV$V_SETPRV   = 0000000E            TT$C_BAUD_9600 = 0000000F            TTY$B_BD_IPL     00000017            

PRV$V_SYSGBL   = 00000019            TT$M_ALTRPAR   = 00000020            TTY$B_BD_REFC    00000016            

PRV$V_SYSNAM   = 00000002            TT$M_CRFILL    = 00000400            TTY$B_BD_TYPE    0000000A            

PRV$V_TMPMBX   = 0000000F            TT$M_EIGHTBIT  = 00008000            TTY$B_BD_WHO     00000014            

PRV$V_VOLPRO   = 00000015            TT$M_ESCAPE    = 00000008            TTY$B_TA_TYPE    0000000A            

PRV$V_WORLD    = 00000010            TT$M_HOLDSCREEN= 00004000            TTY$C_BELL     = 00000007            

PSL$C_EXEC     = 00000001            TT$M_HOSTSYNC  = 00000010            TTY$C_BLANK    = 00000020            

PSL$C_KERNEL   = 00000000            TT$M_LFFILL    = 00000800            TTY$C_BS       = 00000008            

PSL$C_SUPER    = 00000002            TT$M_LOWER     = 00000080            TTY$C_CR       = 0000000D            

PSL$C_USER     = 00000003            TT$M_MBXDSABL  = 00010000            TTY$C_CTRLC    = 00000003            

PSL$M_CM       = 80000000            TT$M_MECHTAB   = 00000100            TTY$C_CTRLO    = 0000000F            

PSL$M_CURMOD   = 03000000            TT$M_NOBRDCST  = 00020000            TTY$C_CTRLQ    = 00000011            

PSL$M_DV       = 00000080            TT$M_NOECHO    = 00000002            TTY$C_CTRLR    = 00000012            

PSL$M_FPD      = 08000000            TT$M_NOTYPEAHD = 00000004            TTY$C_CTRLS    = 00000013            

PSL$M_FU       = 00000040            TT$M_ODD       = 00000080            TTY$C_CTRLU    = 00000015            

PSL$M_IPL      = 001F0000            TT$M_PAGE      = FE000000            TTY$C_CTRLX    = 00000018            

PSL$M_IS       = 04000000            TT$M_PARITY    = 00000040            TTY$C_CTRLY    = 00000019            

PSL$M_IV       = 00000020            TT$M_PASSALL   = 00000001            TTY$C_CTRLZ    = 0000001A            

PSL$M_PRVMOD   = 00C00000            TT$M_READSYNC  = 00040000            TTY$C_DELETE   = 0000007F            

PSL$M_SAFBITS  = 000037FF            TT$M_REMOTE    = 00002000            TTY$C_DOLLAR   = 00000024            

PSL$M_TBIT     = 00000010            TT$M_SCOPE     = 00001000            TTY$C_DS_ACTIVE= 00000001            

PSL$M_TP       = 40000000            TT$M_SCRIPT    = 00000040            TTY$C_DS_ATTN1 = 00000002            

PSL$S_CURMOD   = 00000002            TT$M_TTSYNC    = 00000020            TTY$C_DS_ATTN3 = 00000009            

PSL$S_IPL      = 00000005            TT$M_WRAP      = 00000200            TTY$C_DS_HANG  = 0000000A            

PSL$S_PRVMOD   = 00000002            TT$S_PAGE      = 00000008            TTY$C_DS_IDLE  = 00000000            

PSL$V_CM       = 0000001F            TT$V_ALTRPAR   = 00000005            TTY$C_DS_RESET = 0000000B            

PSL$V_CURMOD   = 00000018            TT$V_CRFILL    = 0000000A            TTY$C_ESCAPE   = 0000001B            

PSL$V_DV       = 00000007            TT$V_EIGHTBIT  = 0000000F            TTY$C_FC_N_SET = 00000004            

PSL$V_FPD      = 0000001B            TT$V_ESCAPE    = 00000003            TTY$C_FC_READ  = 00000000            

PSL$V_FU       = 00000006            TT$V_HOLDSCREEN= 0000000E            TTY$C_FC_SETC  = 00000003            

PSL$V_IPL      = 00000010            TT$V_HOSTSYNC  = 00000004            TTY$C_FC_SETM  = 00000002            

PSL$V_IS       = 0000001A            TT$V_LFFILL    = 0000000B            TTY$C_FC_WRITE = 00000001            

PSL$V_IV       = 00000005            TT$V_LOWER     = 00000007            TTY$C_FF       = 0000000C            

PSL$V_PRVMOD   = 00000016            TT$V_MBXDSABL  = 00000010            TTY$C_HIGHIPL  = 00000016            

PSL$V_TBIT     = 00000004            TT$V_MECHTAB   = 00000008            TTY$C_LF       = 0000000A            

PSL$V_TP       = 0000001E            TT$V_NOBRDCST  = 00000011            TTY$C_LOWA     = 00000061            

SET              00000227 R     03   TT$V_NOECHO    = 00000001            TTY$C_LOWZ     = 0000007B            

SET_COMMON       000001FA R     03   TT$V_NOTYPEAHD = 00000002            TTY$C_NL       = 00000080            

SS$_ACCVIO       ********   X   03   TT$V_ODD       = 00000007            TTY$C_ONE      = 00000031            

SS$_BADPARAM     ********   X   03   TT$V_PAGE      = 00000019            TTY$C_PLUS     = 0000002B            

SS$_NOPRIV       ********   X   03   TT$V_PARITY    = 00000006            TTY$C_SCRIPT   = 00000060            

SS$_NORMAL       ********   X   03   TT$V_PASSALL   = 00000000            TTY$C_TAB      = 00000009            

TT$CARRIAGE      000002FB RG    03   TT$V_READSYNC  = 00000012            TTY$C_TYPAHDSIZ= 0000004E            

TT$C_BAUD_110  = 00000003            TT$V_REMOTE    = 0000000D            TTY$C_VT       = 0000000B            

TT$C_BAUD_1200 = 00000008            TT$V_SCOPE     = 0000000C            TTY$C_XOFF     = 00000013            

TT$C_BAUD_134  = 00000004            TT$V_SCRIPT    = 00000006            TTY$C_XON      = 00000011            

TT$C_BAUD_150  = 00000005            TT$V_TTSYNC    = 00000005            TTY$C_ZERO     = 00000030            

TT$C_BAUD_1800 = 00000009            TT$V_WRAP      = 00000009            TTY$FDTREAD      00000000 RG    03   

TT$C_BAUD_2000 = 0000000A            TT$_LA36       = 00000020            TTY$FDTSENSEC    00000280 RG    03   

TT$C_BAUD_2400 = 0000000B            TT$_LAX        = 00000020            TTY$FDTSENSEM    00000251 RG    03   

TT$C_BAUD_300  = 00000006            TT$_UNKNOWN    = 00000000            TTY$FDTSETC      000001F4 RG    03   

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  19

SYMBOL TABLE                                                                                                                     (7)



TTY$FDTSETM      000001EC RG    03   TTY$V_ST_CTRLO = 0000000C            UCB$B_TT_DESPEE  000000A0            

TTY$FDTWRITE     00000125 RG    03   TTY$V_ST_CTRLR = 0000000A            UCB$B_TT_DETYPE  000000A4            

TTY$L_BD_DATA    00000018            TTY$V_ST_CTRLS = 00000002            UCB$B_TT_DIAL    00000096            

TTY$L_BD_FORK    0000000C            TTY$V_ST_CURSOR= 00000004            UCB$B_TT_ESC     00000095            

TTY$L_BD_MIN     00000028            TTY$V_ST_DEL   = 0000000D            UCB$B_TT_ESC_O   00000099            

TTY$L_BD_UCB     00000010            TTY$V_ST_EOL   = 00000009            UCB$B_TT_FILL    00000097            

TTY$L_RB_DATA    00000010            TTY$V_ST_ESC   = 00000013            UCB$B_TT_LFFILL  0000009E            

TTY$L_RB_NXT     00000000            TTY$V_ST_ESC_O = 0000001A            UCB$B_TT_LINE    00000094            

TTY$L_RB_UVA     00000004            TTY$V_ST_FILL  = 00000003            UCB$B_TT_SPEED   0000009C            

TTY$L_TA_DATA    00000010            TTY$V_ST_GETAHD= 00000018            UCB$B_TYPE       0000000A            

TTY$L_TA_END     0000000C            TTY$V_ST_MULTI = 00000006            UCB$B_VERTSZ     0000003F            

TTY$L_TA_GET     00000004            TTY$V_ST_NL    = 00000015            UCB$C_LENGTH     00000074            

TTY$L_TA_PUT     00000000            TTY$V_ST_NOECHO= 0000000F            UCB$C_LOGLNK   = 00000001            

TTY$L_WB_DATA    0000000C            TTY$V_ST_NOFLTR= 00000012            UCB$K_LENGTH     00000074            

TTY$L_WB_END     00000004            TTY$V_ST_PASALL= 0000000E            UCB$L_AMB        00000054            

TTY$L_WB_NXT     00000000            TTY$V_ST_PROMPT= 00000011            UCB$L_ASTQBL     00000010            

TTY$M_A        = 00003FFF            TTY$V_ST_READ  = 0000000B            UCB$L_ASTQFL     0000000C            

TTY$M_CH_CTRL  = 00000020            TTY$V_ST_SENDLF= 00000005            UCB$L_CPID       0000005C            

TTY$M_CH_CTRL2 = 00000080            TTY$V_ST_SKIPLF= 00000017            UCB$L_CRB        00000020            

TTY$M_CH_LOWER = 00000040            TTY$V_ST_TYPFUL= 00000016            UCB$L_DDB        00000024            

TTY$M_CH_SPEC  = 00000010            TTY$V_ST_UNSOL = 00000019            UCB$L_DEVCHAR    00000034            

TTY$M_ST_BADESC= 00100000            TTY$V_ST_WRITE = 00000008            UCB$L_DEVDEPEND  0000003C            

TTY$M_ST_BRDCST= 00000080            TTY$V_ST_WRTALL= 00000010            UCB$L_DPC        00000080            

TTY$M_ST_CTRLO = 00001000            TTY$V_ST_XOFF  = 00000001            UCB$L_DUETIM     0000005C            

TTY$M_ST_CTRLR = 00000400            TTY$V_ST_XON   = 00000000            UCB$L_DX_BFPNT   0000009C            

TTY$M_ST_CTRLS = 00000004            TTY$W_BD_SIZE    00000008            UCB$L_DX_BUF     00000098            

TTY$M_ST_CURSOR= 00000010            TTY$W_RB_ORGHOR  0000000C            UCB$L_DX_RXDB    000000A0            

TTY$M_ST_DEL   = 00002000            TTY$W_RB_SIZE    00000008            UCB$L_EMB        00000078            

TTY$M_ST_EOL   = 00000200            TTY$W_RB_TIMOS   0000000E            UCB$L_FIRST      00000014            

TTY$M_ST_ESC   = 00080000            TTY$W_TA_SIZE    00000008            UCB$L_FPC        0000000C            

TTY$M_ST_ESC_O = 04000000            TTY$W_WB_SIZE    00000008            UCB$L_FQBL       00000004            

TTY$M_ST_FILL  = 00000008            UCB$B_AMOD       00000053            UCB$L_FQFL       00000000            

TTY$M_ST_GETAHD= 01000000            UCB$B_CEX        00000077            UCB$L_FR3        00000010            

TTY$M_ST_MULTI = 00000040            UCB$B_CM1        0000004A            UCB$L_FR4        00000014            

TTY$M_ST_NL    = 00200000            UCB$B_CM2        0000004B            UCB$L_IOQBL      00000044            

TTY$M_ST_NOECHO= 00008000            UCB$B_DEVCLASS   00000038            UCB$L_IOQFL      00000040            

TTY$M_ST_NOFLTR= 00040000            UCB$B_DEVTYPE    00000039            UCB$L_IRP        0000004C            

TTY$M_ST_PASALL= 00004000            UCB$B_DIPL       00000052            UCB$L_LINK       0000002C            

TTY$M_ST_PROMPT= 00020000            UCB$B_DX_SCTCNT  000000A6            UCB$L_LOGADR     00000064            

TTY$M_ST_READ  = 00000800            UCB$B_ERTCNT     00000070            UCB$L_MAXBLOCK   00000084            

TTY$M_ST_SENDLF= 00000020            UCB$B_ERTMAX     00000071            UCB$L_MEDIA      0000008C            

TTY$M_ST_SKIPLF= 00800000            UCB$B_ESCAPE     0000004B            UCB$L_NT_DATSSB  00000074            

TTY$M_ST_TYPFUL= 00400000            UCB$B_FEX        00000076            UCB$L_NT_INTSSB  00000078            

TTY$M_ST_UNSOL = 02000000            UCB$B_FIPL       0000000B            UCB$L_OPCNT      00000060            

TTY$M_ST_WRITE = 00000100            UCB$B_LOCSRV     0000003C            UCB$L_OWNUIC     0000001C            

TTY$M_ST_WRTALL= 00010000            UCB$B_OFFNDX     00000094            UCB$L_PID        00000028            

TTY$M_ST_XOFF  = 00000002            UCB$B_OFFRTC     00000095            UCB$L_RQBL       00000004            

TTY$M_ST_XON   = 00000001            UCB$B_REMSRV     0000003D            UCB$L_RQFL       00000000            

TTY$Q_BD_LINK    00000000            UCB$B_SECTORS    0000003C            UCB$L_SVAPTE     00000068            

TTY$S_A        = 0000000E            UCB$B_SLAVE      00000074            UCB$L_SVPN       00000064            

TTY$V_A        = 00000000            UCB$B_SPR        00000075            UCB$L_TTCHAR     0000003C            

TTY$V_CH_CTRL  = 00000005            UCB$B_STATE      00000052            UCB$L_TT_BRDCST  00000084            

TTY$V_CH_CTRL2 = 00000007            UCB$B_TRACKS     0000003D            UCB$L_TT_CTRLC   00000080            

TTY$V_CH_LOWER = 00000006            UCB$B_TT_BRDPT   00000098            UCB$L_TT_CTRLY   0000007C            

TTY$V_CH_SPEC  = 00000004            UCB$B_TT_CRFILL  0000009D            UCB$L_TT_DECHAR  000000A8            

TTY$V_ST_BADESC= 00000014            UCB$B_TT_DECRF   000000A1            UCB$L_TT_MULTI   00000078            

TTY$V_ST_BRDCST= 00000007            UCB$B_TT_DELFF   000000A2            UCB$L_TT_RDUE    0000008C            

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  20

SYMBOL TABLE                                                                                                                     (7)



UCB$L_TT_STATE   00000074            UCB$V_NT_BREAK = 00000005            

UCB$L_TT_TYPAHD  00000088            UCB$V_NT_NAME  = 00000004            

UCB$L_VCB        00000030            UCB$V_ONLINE   = 00000004            

UCB$M_BACKP    = 00000020            UCB$V_POWER    = 00000005            

UCB$M_BSY      = 00000100            UCB$V_PRMMBX   = 00000000            

UCB$M_CANCEL   = 00000008            UCB$V_SEGFLO   = 00000002            

UCB$M_DEADMO   = 00000400            UCB$V_TIM      = 00000000            

UCB$M_DELMBX   = 00000002            UCB$V_TIMOUT   = 00000006            

UCB$M_DIAGBUF  = 00000002            UCB$V_TT_NOTIF = 00000002            

UCB$M_DX_WRITE = 00000008            UCB$V_TT_ODD   = 00000007            

UCB$M_ECC      = 00000001            UCB$V_TT_PARTY = 00000006            

UCB$M_ERLOGIP  = 00000004            UCB$V_TT_SPEED = 00000000            

UCB$M_INT      = 00000002            UCB$V_TT_TIMO  = 00000001            

UCB$M_INTTYPE  = 00000080            UCB$V_UNLOAD   = 0000000C            

UCB$M_JOB      = 00000001            UCB$V_VALID    = 0000000B            

UCB$M_MOUNTING = 00000200            UCB$W_BCNT       0000006E            

UCB$M_NOCNVRT  = 00000004            UCB$W_BCR        00000096            

UCB$M_NT_BFROVF= 00000004            UCB$W_BOFF       0000006C            

UCB$M_NT_BREAK = 00000020            UCB$W_BUFQUO     00000018            

UCB$M_NT_NAME  = 00000010            UCB$W_BYTESTOGO  0000003E            

UCB$M_ONLINE   = 00000010            UCB$W_CHARGE     0000004A            

UCB$M_POWER    = 00000020            UCB$W_CYLINDERS  0000003E            

UCB$M_PRMMBX   = 00000001            UCB$W_DA         0000008C            

UCB$M_TIM      = 00000001            UCB$W_DC         0000008E            

UCB$M_TIMOUT   = 00000040            UCB$W_DEVBUFSIZ  0000003A            

UCB$M_TT_NOTIF = 00000004            UCB$W_DEVSTS     0000005A            

UCB$M_TT_ODD   = 00000080            UCB$W_DIRSEQ     00000088            

UCB$M_TT_PARTY = 00000040            UCB$W_DSTADDR    00000018            

UCB$M_TT_SPEED = 0000003F            UCB$W_DX_BCR     000000A4            

UCB$M_TT_TIMO  = 00000002            UCB$W_EC1        00000090            

UCB$M_UNLOAD   = 00001000            UCB$W_EC2        00000092            

UCB$M_VALID    = 00000800            UCB$W_ERRCNT     00000072            

UCB$S_LNKPRI   = 00000002            UCB$W_FUNC       0000007E            

UCB$S_LTYPE    = 00000002            UCB$W_MB_SEED    FFFFFFFC            

UCB$S_TT_ODD   = 00000001            UCB$W_MSGCNT     00000016            

UCB$S_TT_PARTY = 00000001            UCB$W_MSGMAX     00000014            

UCB$S_TT_SPEED = 00000006            UCB$W_NT_CHAN    0000007C            

UCB$T_PARTNER    0000000C            UCB$W_OFFSET     0000008A            

UCB$V_BACKP    = 00000005            UCB$W_REFC       00000050            

UCB$V_BSY      = 00000008            UCB$W_SIZE       00000008            

UCB$V_CANCEL   = 00000003            UCB$W_SRCADDR    0000001A            

UCB$V_DEADMO   = 0000000A            UCB$W_STS        00000058            

UCB$V_DELMBX   = 00000001            UCB$W_TT_CURSOR  0000009A            

UCB$V_DIAGBUF  = 00000001            UCB$W_TT_DESIZE  000000A5            

UCB$V_DX_WRITE = 00000003            UCB$W_TT_HOLD    00000090            

UCB$V_ECC      = 00000000            UCB$W_TT_INAHD   00000092            

UCB$V_ERLOGIP  = 00000002            UCB$W_UNIT       00000048            

UCB$V_INT      = 00000001            UCB$W_VPROT      0000001A            

UCB$V_INTTYPE  = 00000007            

UCB$V_JOB      = 00000000            

UCB$V_LNKPRI   = 00000006            

UCB$V_LTYPE    = 00000000            

UCB$V_MOUNTING = 00000009            

UCB$V_MSGACK   = 00000004            

UCB$V_MSGFLO   = 00000003            

UCB$V_NOCNVRT  = 00000002            

UCB$V_NT_BFROVF= 00000002            

TTYFDT          - TERMINAL FUNCTION DECISION ROUTINES            21-AUG-1978 21:00:43   VAX-11 MACRO X0.3-11               Page  21

PROGRAM SECTION SYNOPSIS                                                                                                         (7)







PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            FFFFFFFE      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

Y$EXEPAGED       00000343      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

5196. BYTES LEFT IN FREE MEMORY POOL.

2088. BYTES OF RECLAIMED MEMORY.

OBJ$:TTYFDT,LIS$:TTYFDT/-SP=EXECML$/ML,SRC$:TTYFDT

12 MLB DIR RDS - 1121 GETS TO DEFINE 23 MACROS. 98 INTER. FILE WRITES. 

