;  The stream control block has the following format:
;
;      Offset     Size      Field
;      ------     ----      -----
;
;           0        1      Flag bits      1 x x x x x x x    Input
;                                          x 1 x x x x x x    Output
;                                          x x 1 x x x x x    Buffered
;                                          x x x 1 x x x x    Interactive
;                                          x x x x 1 x x x    EOF
;                                          x x x x x 1 x x    Break
;
;           1        1      Buffer POS value
;           2        1      Buffer END value
;           3        2      BUFREAD  routine
;           5        2      BUFWRITE routine
;           7        2      BINREAD  routine
;           9        2      BINWRITE routine
;          11        2      CLOSE    routine
;          13        2      User ARG1 value
;          15        2      User ARG2 value
;          17      128      Buffer


S.FLAG  EQU     0                       ;  SCB FLAG field
S.POS   EQU     1                       ;  SCB POS field
S.END   EQU     2                       ;  SCB END field
S.BUFR  EQU     3                       ;  SCB BUFREAD field
S.BUFW  EQU     5                       ;  SCB BUFWRITE field
S.BINR  EQU     7                       ;  SCB BINREAD field
S.BINW  EQU     9                       ;  SCB BINWRITE field
S.CLSE  EQU     11                      ;  SCB CLOSE field
S.ARG1  EQU     13                      ;  SCB ARG1 field
S.ARG2  EQU     15                      ;  SCB ARG2 field
S.BUFF  EQU     17                      ;  SCB BUFF field

S.SIZE  EQU     128                     ;  Size of Buffer
S.UPB   EQU     S.BUFF+S.SIZE           ;  Size of entire SCB


F.IN    EQU     7                       ;  Flag bit INPUT
F.OUT   EQU     6                       ;  Flag bit OUTPUT
F.BUF   EQU     5                       ;  Flag bit BUFFERED
F.INT   EQU     4                       ;  Flag bit INTERACTIVE
F.EOF   EQU     3                       ;  Flag bit EOF
F.BRK   EQU     2                       ;  Flag bit BREAK


B.IN    EQU     #B10000000              ;  Flag bit INPUT
B.OUT   EQU     #B01000000              ;  Flag bit OUTPUT
B.BUF   EQU     #B00100000              ;  Flag bit BUFFERED
B.INT   EQU     #B00010000              ;  Flag bit INTERACTIVE
B.EOF   EQU     #B00001000              ;  Flag bit EOF
B.BRK   EQU     #B00000100              ;  Flag bit BREAK


RUBOUT  EQU     #X7F                    ;  Rubout character
SPACE   EQU     #X20                    ;  Space character
STARE   EQU     #X1B                    ;  Escape character
STARC   EQU     #X0D                    ;  Carriage return character
STARN   EQU     #X0A                    ;  Line feed character
START   EQU     #X09                    ;  Tab character
STARB   EQU     #X08                    ;  Back space character 

ENDCH   EQU     #XFFFF                  ;  "endstreamch"


V.LNGTH EQU     128                     ;  Length byte
V.ADMRS EQU     130                     ;  Admit reset
V.DENRS EQU     131                     ;  Deny reset
V.EOIL  EQU     150                     ;  End of input line
V.IESC  EQU     153                     ;  Escaped character
V.TABMK EQU     155                     ;  Tab mark character
V.EOOL  EQU     200                     ;  End of output line
V.LRQST EQU     201                     ;  Line request


CH.RST  EQU     'R'+#B100000000         ;  Byte stream reset character
CH.PSH  EQU     'P'+#B100000000         ;  Byte stream push character
CH.CRQ  EQU     'C'+#B100000000         ;  Byte stream close request character


