Google
 

Trailing-Edge - PDP-10 Archives - BB-M080K-SM - monitor-sources/ctermd.mac
There are 19 other files named ctermd.mac in the archive. Click here to see a list.
;------------------------- Autopatch Tape # 12 -------------------------
; UPD ID= 2250, SNARK:<6.1.MONITOR>CTERMD.MAC.16,  19-Jun-85 20:48:53 by MELOHN
;TCO 6.1.1465 - add ^R buffer and CTERM data mode change flag.
; UPD ID= 1917, SNARK:<6.1.MONITOR>CTERMD.MAC.15,   7-May-85 17:58:23 by MELOHN
;TCO 6.1.1371 - put dead CDBs in .STDEL state and let CTMFRK deallocate them.
;TCO 6.1.1370 - don't unlock the TDB in LOKCDB
; UPD ID= 1102, SNARK:<6.1.MONITOR>CTERMD.MAC.14,  19-Nov-84 15:44:27 by MELOHN
;TCO 6.1.1055 - Replace CTHLGO with CTHNGU
; UPD ID= 928, SNARK:<6.1.MONITOR>CTERMD.MAC.13,  28-Oct-84 10:59:44 by PRATT
;TCO 6.1.1022 - Add CHRID to the CTERM block to keep the remote host ID
; UPD ID= 747, SNARK:<6.1.MONITOR>CTERMD.MAC.11,  20-Aug-84 17:40:41 by WEISBACH
; Add CHLWI bit.
; UPD ID= 710, SNARK:<6.1.MONITOR>CTERMD.MAC.10,  26-Jul-84 08:30:04 by MCINTEE
;Add definition of SR%DCC.
; UPD ID= 703, SNARK:<6.1.MONITOR>CTERMD.MAC.9,  24-Jul-84 15:28:31 by MCINTEE
;Fix definition of SR%RAN.
; UPD ID= 686, SNARK:<6.1.MONITOR>CTERMD.MAC.8,  16-Jul-84 10:54:00 by MCINTEE
;Fix definition of CH%TTY.
; UPD ID= 650, SNARK:<6.1.MONITOR>CTERMD.MAC.7,   2-Jul-84 14:58:21 by MCINTEE
; UPD ID= 200, SNARK:<6.1.MONITOR>CTERMD.MAC.6,  19-Sep-83 12:13:38 by MCINTEE
;The bits in the CH.IND, RC.IND byte have been changed.

;note: size in the foundation data message is turned off for now

UNIVERSAL CTERMD - DEFINITIONS FOR CTERM

	SEARCH	MACSYM,MONSYM
	SALL


BYTSIZ==10		;Byte size, 
CTHMGL==200		;Length of any CTERM buffer
CTHBPW==4		;Bytes per PDP-10 word

.CFVER==2		;CTERM foundation version number
.CFECO==3		;CTERM foundation ECO number
.CFMOD==0		;CTERM foundation customer modification number

.CHVER==1		;CTERM command version number
.CHECO==4		;CTERM command ECO number
.CHMOD==0		;CTERM command customer modification number

CTHOBJ==^D42		;CTERM HOST object type
RBFCNT==^D80		;Maximum characters in ^R buffer
;Per connection CTERM data base - a.k.a. CDB
BEGSTR CH
	WORD IMB	;Address of CTERM message input buffer
	WORD UID	;Unique id (used for stale detection)
	WORD CO1  	;Last CCOC word (1) sent to server.
	WORD CO2	;Last CCOC word (2) sent to server.
	WORD BR1	;Last break mask (word 1) sent to server
	WORD BR2	;Last break mask (word 2) sent to server
	WORD BR3	;Last break mask (word 3) sent to server
	WORD BR4	;Last break mask (word 4) sent to server
	WORD RFL   	;START-READ flags
	HWORD LIN	;TOPS20 TTY #
	HWORD CHL	;DECnet36 channel number
	HWORD INC	;Count of bytes in input buffer   
	HWORD STS	;Current status of DECnet link
	HWORD STA	;Current CTERM state for this TTY.
	HWORD SSZ	;Maximum protocol message size.
	HWORD MAX	;Maximum input buffer length.
	HWORD RLN	;START-READ length
	HWORD RID	;Remote host ID (node address)
	HWORD RBL	;^R Buffer length (0<RBFCNT)
	FIELD FLG,18	;FLAGS:
	 BIT RDA	;A read request is active in the server.
	 BIT MRD	;There is input data available in the server
	 BIT SSD	;Set "do not discard" in the next write message
	 BIT DSO	;Discard output (control-O is in effect)
	 BIT RCX	;CR-LF forced on in server's break mask
	 BIT CLI	;Clear input buffer 
	 BIT ASR	;Send another START-READ
	 BIT COC	;Send CCOC words
	 BIT TCI	;Sending input characters to TTYSRV
	 BIT CTM	;CTERM INITIATE message has been received.
	 BIT BIN	;Last message sent to server was Transparent (binary)
	FIELD FL1,18	;FLAGS:
	 BIT EDT	;Remote server supports editing
	 BIT LWI	;Remote server supports line width setting.
	 BIT RTI	;Remote server supports remote TEXTI% prompts
	WORD RBF,<<RBFCNT>/5>;^R (prompt) buffer 
ENDSTR

;The CTERM line states
.STINI==0		;"initializing"
.STFND==1		;"foundation started"
.STRUN==2		;"running"
.STSHU==3		;"shutting down"
.STDEL==4		;"Deleting the CDB"

REPEAT 0,<
INTERCONNECTIONS AMONG TTY, CTERM, AND DECNET DATA AREAS

TTACTL			+ Line-Number /	    Address of TTY Dynamic Data Block
CTERM-Channel-Table  	+ Channel nummber / Address of CTERM Data Block
(Table address in CTHCHP)
TTY-Dynamic-Data-Block	+ TTDEV /	    Address of CTERM Data Block
CTERM-Data-Block	+ CHLIN /	    Line Number
CTERM-Data-Block	+ CHCHL /	    DECnet Channel
>
	SUBTTL FOUNDATION MESSAGES -- BIND REQUEST

;BIND REQUEST (H :--: S)


; .________.________.________.________.
; !  TYPE  !  VER1  !  VER2  !  VER3  !
; !________!________!________!________!
; !  OPSY1 !  OPSY2 !  SPT1  !  SPT2  !
; !________!________!________!________!
; !  REV1  !  REV2  !  REV3  !  REV4  !
; !________!________!________!________!
; !  REV5  !  REV6  !  REV7  !  REV8  !
; !________!________!________!________!
; !  ID1   !  ID2   !  OPTS  !  NAME1 !
; !________!________!________!________!
; !  ...   !  NAMEn !  VAL1  !  VAL2  !
; !________!________!________!________!

.FNBNR==^D1		;BIND REQUEST FOUNDATION MESSAGE TYPE
;Operating system of the sender
  .FBNON==0		; NONE SPECIFIED
  .FBRT1==1		; RT-11
  .FBRST==2		; RSTS/E
  .FBRSS==3		; RSX-11S
  .FBRSM==4		; RSX-11D
  .FBRSD==5		; RSX-11M
  .FBIAS==6		; IAS
  .FBVMS==7		; VMS
  .FBT20==10		; TOPS-20
  .FBT10==11		; TOPS-10
  .FBOS8==12		; OS-8
  .FBRS8==13		; RTS-8
  .FBRMP==14		; RSX-11M+
;Protocols supported by the sender
  FB%RST==1B20		; RSTS/E DECNET HOMOGENEOUS COMMAND TERMINAL
  FB%RSX==1B21		; RSX DECNET HOMOGENEOUS COMMAND TERMINAL
  FB%VMS==1B22		; VMS DECNET HOMOGENEOUS COMMAND TERMINAL
  FB%T20==1B23		; TOPS-20 DECNET HOMOGENEOUS COMMAND TERMINAL
  FB%TCA==1B24		; TERMINAL COMMUNICATION PROTOCOL (CTERM)
			; VALUE FIELD.
	SUBTTL FOUNDATION MESSAGES -- UNBIND REQUEST

;UNBIND REQUEST (H :--: S)
; .________.________.________.
; !  TYPE  ! REASON1! REASON2!
; !________!________!________!

.FNUBN==^D2		;UNBIND REQUEST FOUNDATION MESSAGE TYPE
.UBNRQ==^D3		;USER UNBIND REQUEST TYPE
.UBNSZ==^D3		;NUMBER OF BYTES IN UNBIND REQUEST
	SUBTTL FOUNDATION MESSAGES -- BIND ACCEPT

;BIND ACCEPT (H :--: S)
; .________.________.________.________.
; !  TYPE  ! VERS1  ! VERS2  ! VERS3  !
; !________!________!________!________!
; ! REV1   ! REV2   ! REV3   ! REV4   !
; !________!________!________!________!
; ! REV5   ! REV6   ! REV7   ! REV8   !
; !________!________!________!________!
; !  ID1   !  ID2   !OPTIONS !
; !________!________!________!

.FNBNA==^D4		;BIND ACCEPT FOUNDATION MESSAGE TYPE
	SUBTTL FOUNDATION MESSAGES -- COMMON DATA

;COMMON DATA (H :--: S)
; .________.________.________.________.
; !  TYPE  ! FILLER ! SIZEA1 ! SIZEA2 !
; !________!________!________!________!
; !      command-level message A      !
; !________!________!________!________!
; ! SIZEB1 ! SIZEB2 ! command-level.. !
; !________!________!________!________!
; !   ..message B   !  ...   !
; !________!________!________!

.FNCDT==^D9		;COMMON DATA FOUNDATION MESSAGE TYPE
.COMLN==4		;Length of foundation COMMON DATA header
	SUBTTL FOUNDATION MESSAGES -- MODE DATA

;MODE DATA (H :--: S)
; .________.________.________.________.
; !  TYPE  ! FILLER ! SIZEA1 ! SIZEA2 !
; !________!________!________!________!
; !      command-level message A      !
; !________!________!________!________!
; ! SIZEB1 ! SIZEB2 ! command-level.. !
; !________!________!________!________!
; !   ..message B   !  ...   !
; !________!________!________!

.FNDAT==^D10		;DATA FOUNDATION MESSAGE TYPE
	SUBTTL COMMAND MODE MESSAGES -- INITIATE

;INITIATE A BINDING (H :--: S)
; .________.________.________.________.
; ! TYPE   ! FLAG   ! VERSION!  ECO   !
; !________!________!________!________!
; !  MOD   ! REV1   ! REV2   ! REV3   !
; !________!________!________!________!
; !  REV4  ! REV5   ! REV6   ! REV7   !
; !________!________!________!________!
; !  REV8  ! P1TYP  ! P1LEN  ! P1VAL1 !
; !________!________!________!________!
; ! P1VAL2 !  ...   ! P1VALn ! P2TYP  !
; !________!________!________!________!
; ! P2LEN  ! P2VAL1 ! P2VAL2 ! ...    !	      
; !________!________!________!________!
; ! P2VALn !
; !________!

.BIND==	1		;INITIATE BINDING MESSAGE TYPE
             
			;    EACH PARAMETER CONSISTS OF:
			; PARAMETER TYPE (1 byte)
			; LENGTH OF PARAMETER VALUE (1 byte)
			; PARAMETER VALUE 

.BNDPL==1		;MAX-MESSAGE-SIZE PARAMETER TYPE
 .BNPLL==4		;TOTAL LENGTH OF THE ABOVE
.BNDPB==2		;INPUT-BUFFER-SIZE PARAMETER TYPE
 .BNPBL==4		;TOTAL LENGTH OF THE ABOVE
.BNDPM==3		;SUPPORTED-MESSAGES PARAMETER TYPE
 .BNPML==4		;TOTAL LENGTH OF MESSAGES PARAMETER
 .BNMF1==376		;FIRST MESSAGES BYTE
 .BNMF2==177		;SECOND MESSAGES BYTE
	SUBTTL COMMAND MODE MESSAGES -- START-READ

;START READ (H ---: S)
; .________.________.________.________.
; ! TYPE   ! FLAG1  ! FLAG2  ! FLAG3  !
; !________!________!________!________!
; ! LNGTH1 ! LNGTH2 !  END1  !  END2  !
; !________!________!________!________!
; ! TIME1  ! TIME2  !  EOP1  !  EOP2  !
; !________!________!________!________!
; ! SDS1   ! SDS2   ! LOW1   !  LOW2  !
; !________!________!________!________!
; ! TMLEN  ! TERM1  ! TERM2  !  ...   !
; !________!________!________!________!
; ! DATA   !  ...   !
; !________!________!

.SREAD==2		;START A READ MESSAGE TYPE
.SRFGS==3		;NUMBER OF FLAG BYTES
.SRHLN==20		;NUMBER OF BYTES IN HEADER
;Flags left justified for ease of setting in sending
   SR%RAI==3B1		; 2, RAISE LOWER CASE INPUT
    SR%RAD==0B1		;   0==DEFAULT (USE CHARACTERISTIC)
    SR%RAN==1B1		;   1==NO RAISE
    SR%RAE==2B1		;   2==RAISE
   SR%CTN==1B2		; 1, THIS IS A CONTINUATION READ
   SR%TVC==1B3		; 1, TERMINATE ON VERTICAL CHANGE
   SR%FOR==1B4		; 1, FORMATTING (MATCH CR WITH LF, IGNORE LEADING LF)
   SR%CTA==1B5		; 1, CLEAR TYPE-AHEAD
   SR%UFH==3B7		; 2, UNDERFLOW HANDLING (0==IGNORE)
    SR%UFB==1B7		;   1==SEND BELL TO HOST
    SR%UFT==2B7		;   2==TERMINATE READ
   SR%XDT==3B9		; 2, NON-DEFAULT TERMINATOR SET
    SR%XDP==0B9		;   0==USE SET FROM PREVIOUS READ
    SR%XDR==1B9		;   1==USE SET INCLUDED IN THIS READ
    SR%XDU==2B9		;   2==USE UNIVERSAL SET
   SR%TIM==1B10		; 1, TIME-OUT FIELD IS PRESENT
   SR%TEC==1B11		; 1, ECHO TERMINATOR (0=DON'T, 1=ECHO)
   SR%XEC==1B12		; 1, DON'T ECHO INPUT (0=USE CHAR'CS, 1=NO ECHO)
   SR%DCD==7B15		; 3, DISABLE CONTROL DEFINITION
    SR%DUR==1B15	;   1==DISABLE CONTROL-U AND CONTROL-R
    SR%DED==2B15	;   2==DISABLE EDITING CHARACTERS.
    SR%DCC==3B15	;   3==DISABLE CONTROL CHARACTERS.
   SR%IES==3B16		; 2, RECOGNIZE INPUT ESCAPE SEQUENCES
.SRTLN==^D17		;NUMBER OF BYTES IN "NORMAL" TERMINATION SET


;Internal argument block for start read.
.ARFLG==0		;Flags word, left justified, as defined above.
.ARBMK==1		;Address of break mask.
.ARMLN==2		;Maximum length of input buffer.
.ARPPT==3		;Prompt pointer (user context)
.ARPCT==4		;Prompt count
.ARDPT==5 		;Data pointer (user context)
.ARDCT==6 		;Data count
.ARFRE==7		;Free pointer (user context)
.ARSIZ==10		;Size of argument block
	SUBTTL COMMAND MODE MESSAGES -- READ-DATA

;READ DATA - SATISFY A READ REQUEST (H :--- S)
; .________.________.________.________.
; ! TYPE   ! FLAG   !  LOW1  !  LOW2  !
; !________!________!________!________!
; !  VCH1  !  VCH2  !  EPR1  !  EPR2  !
; !________!________!________!________!
; ! TPOS1  ! TPOS2  !  DATA  !  ...   !
; !________!________!________!________!

.RDDAT==3		;READ DATA MESSAGE TYPE
.RDFGS==1		;NUMBER OF FLAGS BYTES
;Flags right justified for ease of reading.
   RD%MTY==1B31		; 1, THERE IS DATA IN THE TYPE-AHEAD BUFFER
   RD%CCD==17B35	; 4, COMPLETION CODE
			;COMPLETION CODES:
RD%CTM== 0B35		;TERMINATION CHARACTER
RD%CES== 1B35		;VALID ESCAPE SEQUENCE
RD%CXE== 2B35		;INVALID ESCAPE SEQUENCE
RD%COB== 3B35		;OUT OF BAND CHARACTER
RD%CBF== 4B35		;INPUT BUFFER FULL
RD%CTI== 5B35		;TIMEOUT
RD%CUR== 6B35		;UNREAD
RD%CUF== 7B35		;UNDERFLOW
RD%CAT==10B35		;ABSENTEE TOKEN
RD%CVC==11B35		;VERTICAL POSITION CHANGE
RD%CLB==12B35		;LINE BREAK
RD%CFE==13B35		;FRAMING ERROR
RD%CPE==14B35		;PARITY ERROR
RD%COV==15B35		;RECEIVER OVER-RUN
	SUBTTL COMMAND MODE MESSAGES -- OUT-OF-BAND

;OUT OF BAND - SEND OOB CHARACTER TO HOST (H :--- S)
; .________.________.________.
; ! TYPE   ! FLAG   ! CHAR   !
; !________!________!________!

.OOBCH==4		;OUT OF BAND MESSAGE TYPE
.OBFGS==1		;NUMBER OF FLAG BYTES
;Flags right justified for ease of reading
OB%DIS==1B35		;Discard output
	SUBTTL COMMAND MODE MESSAGES -- UNREAD

;UNREAD (H ---: S)
; .________.________.
; ! TYPE   ! FLAG   !
; !________!________!

.UREAD==5		;UNREAD MESSAGE TYPE
.URFGS==1		;NUMBER OF FLAG BYTES
			;FLAGS: (LENGTH, FUNCTION)
  UR%EMP==1B35		; 1, UNREAD ONLY IF INPUT & T-A BUFFERS ARE EMPTY
	SUBTTL COMMAND MODE MESSAGES -- CLEAR-INPUT

;CLEAR INPUT (H ---: S)
; .________.________.
; ! TYPE   ! FLAG   !
; !________!________!

.CLRIN==6		;CLEAR INPUT MESSAGE TYPE
.CLFGS==1		;NUMBER OF FLAG BYTES
	SUBTTL COMMAND MODE MESSAGES -- WRITE

;WRITE (H ---: S)
; .________.________.________.________.
; ! TYPE   ! FLAG1  ! FLAG2  !  PRE   !
; !________!________!________!________!
; ! POST   ! DATA   !  ...   !
; !________!________!________!

.WRITE==7		;WRITE MESSAGE TYPE
.WRHLN==5		;Header length.
.WRFGS==2		;NUMBER OF FLAG BYTES
			;FLAGS: (LENGTH, FUNCTION)
;Flags left justified for ease of setting when sending.
  WR%PRC==3B1		; 2, PREFIX CODE  (0=IGNORE, 1=COUNT, 2=CHARACTER)
   WR%PRN==1B1
   WR%PRL==2B1
  WR%EMS==1B2		; 1, END OF MESSAGE FLAG
  WR%BMS==1B3		; 1, BEGINNING OF MESSAGE FLAG
  WR%SOD==1B4		; 1, SET OUTPUT DISCARD STATE
  WR%CTA==3B7		; 2, LOCK HANDLING (0=UL, 1=L, 2=L/UL, 3=REDIS)
   WR%CLK==1B1
   WR%CLU==2B1
   WR%CRD==2B1

  WR%FRW==1B10		; 1, FORCE WRITE THROUGH XOFF
  WR%BKT==1B11		; 1, BREAK THROUGH ACTIVE READ
  WR%TPT==1B12		; 1, WRITE TRANSPARENT
  WR%CMP==1B13		; 1, COMPLETION STATUS REQUESTED
  WR%POC==3B15		; 2, POSTFIX CODE (0=IGNORE, 1=COUNT, 2=CHARACTER)
   WR%PON==1B1
   WR%POL==2B1
	SUBTTL COMMAND MODE MESSAGES -- WRITE-COMPLETION

;WRITE COMPLETION - TELL HOST THAT WRITE WAS ACCOMPLISHED (H :--- S)
; .________.________.________.________.
; ! TYPE   ! FLAG   !  HPOS1 ! HPOS2  !
; !________!________!________!________!
; ! VPOS1  ! VPOS2  !
; !________!________!

.WRTCM==^D8		;WRITE COMPLETION MESSAGE TYPE
.WCFGS==1		;NUMBER OF FLAG BYTES
			;FLAGS: (LENGTH, FUNCTION)
   WC%DST==1B35		; 1, SOME OUTPUT LOST DUE TO USER-TYPED CONTROL-O
	SUBTTL COMMAND MODE MESSAGES -- DISCARD-STATE

;DISCARD STATE - REPORT CONTROL-O STATE (H :--- S)
; .________.________.
; ! TYPE   ! FLAG   !
; !________!________!

.DSTAT==^D9		;DISCARD STATE MESSAGE TYPE
.DSFGS==1		;NUMBER OF FLAG BYTES
   DS%DSC==1B35		; 1, 0=DISCARD, 1=DON'T DISCARD
	SUBTTL COMMAND MODE MESSAGES -- READ-CHARACTERISTICS

;READ CHARACTERISTICS (H ---: S)
; .________.________.________.________.
; ! TYPE   ! FLAG   ! IND1   ! IND2   !
; !________!________!________!________!
; ! SSEL   !
; !________!

.RCHAR==^D10		;READ CHARACTERISTICS MESSAGE TYPE
.RCFGS==1		;NUMBER OF FLAG BYTES
	SUBTTL COMMAND MODE MESSAGES -- CHARACTERISTICS

;MODIFY OR REPORT CHARACTERISTICS (H :--: S)
; .________.________.________.________.
; ! TYPE   ! FLAG   ! INDA1  ! INDA2  !
; !________!________!________!________!
; ! DAT1   !  ...   ! DAT10  ! INDB1  !
; !________!________!________!________!
; ! INDB2  !  ...   !
; !________!________!

.CHARS==^D11		;CHARACTERISTICS MESSAGE TYPE
.CHFGS==1		;NUMBER OF FLAG BYTES
			;EACH CHARACTERISTIC IS:
			; CHARACTERISTIC IDENTIFIER (1 BYTE)
			; CHARACTERISTIC TYPE (1 BYTE)
			; CHARACTERISTIC VALUE 
			; - BOOLEAN (1 BYTE)
			; - INTEGER (2 BYTES)
			; - COMPOUND (3 BYTES)
			; - STRING (count byte followed by string)
	SUBTTL COMMAND MODE MESSAGES -- CHECK-INPUT

;CHECK INPUT - ASK FOR INPUT COUNT (H ---: S)
; .________.________.
; ! TYPE   ! FLAG   !
; !________!________!

.CHKIN==^D12		;CHECK INPUT MESSAGE TYPE
.CKFGS==1		;NUMBER OF FLAG BYTES
	SUBTTL COMMAND MODE MESSAGES -- INPUT-COUNT

;INPUT COUNT - REPORT COUNT OF CHARACTERS IN INPUT AND T-A BUFFERS (H :--- S)
; .________.________.________.________.
; ! TYPE   ! FLAG   ! CNT1   ! CNT2   !
; !________!________!________!________!

.INCNT==^D13		;INPUT COUNT MESSAGE TYPE
.ICFGS==1		;NUMBER OF FLAG BYTES
	SUBTTL COMMAND MODE MESSAGES -- INPUT-STATE

;INPUT STATE - REPORT BUFFER STATE CHANGE (H :--- S)
; .________.________.
; ! TYPE   ! FLAG   !
; !________!________!

.INSTA==^D14		;INPUT STATE MESSAGE TYPE
.ISFGS==1		;NUMBER OF FLAG BYTES
			;FLAGS: (LENGTH, FUNCTION)
   IS%CBX==1B35		; 1, 0=COUNT BECAME ZER0, 1=COUNT BECAME NON-ZERO
	SUBTTL CHARACTERISTICS DEFINITIONS

;CHARACTERISTIC TYPES 
;A RIGHT JUSTIFIED 2 BYTE FIELD.

CH%CTP==3B27 	;CHARACTERISTIC TYPE FIELD
 CH%FPC==0B27	;FOUNDATION PHYSICAL TERMINAL CHARACTERISTIC
 CH%FLC==1B27	;FOUNDATION LOGICAL TERMINAL CHARACTERISTIC
 CH%CLC==2B27	;COMMAND LOGICAL TERMINAL CHARACTERISTIC

;Local flags - argument type
MSKSTR CHTYP,0,17B3
CH%BOO==0   	;BOOLEAN    
CH%INT==1   	;INTEGER
CH%STG==2   	;STRING
CH%COM==3   	;COMPOUND

;CHARACTERISTICS IDENTIFIERS:
;FOUNDATION LOGICAL TERMINAL CHARACTERISTICS (CH%FLC):

CH%MDW==CH%FLC+FLD(CH%BOO,CHTYP)+^D1	; B  MODE WRITING ALLOWED
CH%ATT==CH%FLC+FLD(CH%INT,CHTYP)+^D2	; I  TERMINAL ATTRIBUTES
CH%TTY==CH%FLC+FLD(CH%STG,CHTYP)+^D3	; S  TERMINAL TYPE
CH%FLW==CH%FLC+FLD(CH%BOO,CHTYP)+^D4	; B  OUTPUT FLOW CONTROL
CH%PGS==CH%FLC+FLD(CH%BOO,CHTYP)+^D5	; B  OUTPUT PAGE STOP
CH%FPS==CH%FLC+FLD(CH%BOO,CHTYP)+^D6	; B  FLOW CHARACTER PASS-THROUGH
CH%IFL==CH%FLC+FLD(CH%BOO,CHTYP)+^D7	; B  INPUT FLOW CONTROL
CH%LOS==CH%FLC+FLD(CH%BOO,CHTYP)+^D8	; B  LOSS NOTIFICATION
CH%WID==CH%FLC+FLD(CH%INT,CHTYP)+^D9	; I  LINE WIDTH
CH%PLN==CH%FLC+FLD(CH%INT,CHTYP)+^D10	; I  PAGE LENGTH
CH%SLN==CH%FLC+FLD(CH%INT,CHTYP)+^D11	; I  STOP LENGTH
CH%CRF==CH%FLC+FLD(CH%INT,CHTYP)+^D12	; I  CARRIAGE-RETURN FILL
CH%LFF==CH%FLC+FLD(CH%INT,CHTYP)+^D13	; I  LINEFEED FILL
CH%WRP==CH%FLC+FLD(CH%INT,CHTYP)+^D14	; I  WRAP
CH%HTB==CH%FLC+FLD(CH%INT,CHTYP)+^D15	; I  HORIZONTAL TAB
CH%VTB==CH%FLC+FLD(CH%INT,CHTYP)+^D16	; I  VERTICAL TAB
CH%FMF==CH%FLC+FLD(CH%INT,CHTYP)+^D17	; I  FORMFEED

;FOUNDATION PHYSICAL TERMINAL CHARACTERISTICS (CH%FPC):

CH%ISP==CH%FPC+FLD(CH%INT,CHTYP)+^D1	; I  INPUT SPEED
CH%OSP==CH%FPC+FLD(CH%INT,CHTYP)+^D2	; I  OUTPUT SPEED
CH%CSZ==CH%FPC+FLD(CH%INT,CHTYP)+^D3	; I  CHARACTER SIZE
CH%PAR==CH%FPC+FLD(CH%BOO,CHTYP)+^D4	; B  PARITY ENABLE
CH%PTY==CH%FPC+FLD(CH%INT,CHTYP)+^D5	; I  PARITY TYPE
CH%MDM==CH%FPC+FLD(CH%BOO,CHTYP)+^D6	; B  MODEM PRESENT
CH%AUT==CH%FPC+FLD(CH%BOO,CHTYP)+^D7	; B  AUTO-BAUD DETECT
CH%MAN==CH%FPC+FLD(CH%BOO,CHTYP)+^D8	; B  MANAGEMENT GUARANTEED
CH%SW1==CH%FPC+FLD(CH%STG,CHTYP)+^D9	; S  SWITCH CHARACTER 1
CH%SW2==CH%FPC+FLD(CH%STG,CHTYP)+^D10	; S  SWITCH CHARACTER 2
;COMMAND LOGICAL TERMINAL CHARACTERISTICS (CH%CLC):

CH%IGI==CH%CLC+FLD(CH%BOO,CHTYP)+^D1	; B  IGNORE (DISCARD) INPUT (CONTROL-O)
CH%CAT==CH%CLC+FLD(CH%COM,CHTYP)+^D2	; C  CHARACTER ATTRIBUTES
CH%COP==CH%CLC+FLD(CH%BOO,CHTYP)+^D3	; B  CONTROL-O PASS-THROUGH
CH%RAI==CH%CLC+FLD(CH%BOO,CHTYP)+^D4	; B  RAISE LOWER CASE INPUT
CH%NEC==CH%CLC+FLD(CH%BOO,CHTYP)+^D5	; B  NORMAL ECHO
CH%RQP==CH%CLC+FLD(CH%BOO,CHTYP)+^D6	; B  REQUEST PROCESSING
CH%IER==CH%CLC+FLD(CH%BOO,CHTYP)+^D7	; B  ENABLE INPUT ESCAPE SEQUENCE
CH%OER==CH%CLC+FLD(CH%BOO,CHTYP)+^D8	; B  ENABLE OUTPUT ESCAPE SEQUENCE
CH%ICS==CH%CLC+FLD(CH%INT,CHTYP)+^D9	; I  INPUT COUNT STATE
CH%AUP==CH%CLC+FLD(CH%BOO,CHTYP)+^D10	; B  AUTO-PROMPT
CH%ERP==CH%CLC+FLD(CH%BOO,CHTYP)+^D11	; B  ERROR PROCESSING


;Character attriibute structure - right justified
BEGSTR CA
	FILLER 28		;PUT FLAGS IN RIGHTMOST 8 BITS
	FIELD XXX,1		;(RESERVED FLAG)
	FIELD SCF,1		;SPECIAL CHAR FUNCTION (FOR O,R,U,V,W,X,DEL)
	FIELD CEC,2		;CONTROL CHAR ECHO (0==NO ECHO):
	 .CACCX==0		;  NO ECHO
	 .CACCI==1		;  IMAGE ECHO
	 .CACCS==2		;  STANDARD ECHO
	 .CACCB==3		;  STANDARD, THEN IMAGE ECHO
	FIELD DIS,1		;DISCARD OUTPUT IF CLEAR OOB
	FIELD INC,1		;INCLUDE IMMED. HELLO OOB IN INPUT STREAM
	FIELD OOB,2		;OUT OF BAND HANDLING (0==NOT OOB):
	 .CAOOX==0		;  NOT OUT OF BAND
	 .CAOOI==1		;  IMMEDIATE CLEAR
	 .CAOOD==2		;  DEFERRED CLEAR
	 .CAOOH==3		;  IMMEDIATE HELLO
ENDSTR

	END