
ASMB,A,B,C,L   2000-SERIES I/O PROCESSOR PROGRAM
*                                VERSION A    JULY 20, 1973 
*                                VERSION B    FEBRUARY 14, 1974 
*                                VERSION C    FEBRUARY 14, 1975 
      ORG 2 
      JMP *+1,I 
      DEF INI       ADDRESS OF INITIALIZER
      JSB POW,I     POWER FAIL
      HLT 5         PARITY ERROR
      SUP 
A     EQU 0         A REGISTER ADDRESS
B     EQU 1         B REGISTER ADDRESS
      SPC 1 
C1    EQU 10B       CHANNEL FROM OTHER MACHINE
C2    EQU 11B       CHANNEL TO OTHER MACHINE
      ORG C1
      JSB PRFS,I
      CLC C2
      SPC 1 
TBASE EQU 12B 
      ORG TBASE 
      JSB TBGDR,I 
      SPC 1 
MPX   EQU 13B 
      ORG MPX 
      JSB MPX+1,I 
      DEF MPXIO 
      SPC 1 
DSCB1 EQU 15B 
      ORG DSCB1 
      JSB DSDR1,I 
      SPC 1 
MPY   EQU 16B 
      ORG MPY 
      JSB MPY+1,I 
      DEF MPYIO 
      SPC 1 
DSCB2 EQU 20B 
      ORG DSCB2 
      JSB DSDR2,I 
      SPC 1 
* 
**
***   PANIC ROUTINE 
**
* 
*  IF THE I/O PROCESSOR CRASHES, START THE MACHINE AT LOCATION
*  40B AND THIS ROUTINE WILL MAKE THE NECESSARY RESPONSES SO
*  THAT THE SYSTEM CAN BE SLEPT.  THEN THE I/O PROCESSOR CAN BE 
*  RE-LOADED AND THE SYSTEM CAN BE BROUGHT UP FROM DISC.
* 
      ORG 40B 
PANIC EQU * 
      LDA .+15B 
      OTA C1        CONTINUE
      STC C1,C        RESPONDING
      CLC C1            TO OTHER
      JMP PANIC           MACHINE 
      SPC 2 
* 
**        MULTIPLEXER CONSTANTS AND TEMPORARIES 
* 
XTNUM BSS 1         =>  PORT NUMBER 
XCCNT BSS 1         =>  CHARACTER COUNT 
XBPNT BSS 1         =>  RUNNING BUFFER POINTER
XBSTR BSS 1         =>  START OF BUFFER 
XBHED BSS 1         =>  START OF FIRST BUFFER 
XBSAV BSS 1         =>  SAVED BUFFER POINTER
XBGIN BSS 1         =>  START OF PHYSICAL BUFFER
XBEND BSS 1         =>  END OF PHYSICAL BUFFER
XSTAT BSS 1         =>  STATUS
XATIM BSS 1         =>  ALLOWED <ENTER> TIME
XTYPE BSS 1         =>  TERMINAL TYPE 
XDCNT BSS 1         =>  CR AND LF DELAY COUNT 
XSCNT BSS 1         =>  CR DELAY CHARACTER COUNT
*                                   R     S 
MPXA  BSS 1          E     T
MPXB  BSS 1           G     O 
MPXE  BSS 1            I     R
MPYA  BSS 1             S     A 
MPYB  BSS 1              T     G
MPYE  BSS 1               R     E 
XCHAR BSS 1         TEMPORARY CHARACTER STORAGE 
XTPNT BSS 1         BUFFER POINTER TEMPORARY
MPXT0 BSS 1         TEMPORARY STORAGE 
MPXLC BSS 1         LOWER MPX SC STORAGE
LOWER BSS 1 
MPXUC BSS 1         UPPER MPX SC STORAGE
UPPER BSS 1 
XFLAG OCT 0         X-MULTIPLEXER FLAG
YFLAG OCT 0         Y-MULTIPLEXER FLAG
      SPC 1 
* 
**    LINE PRINTER CONSTANTS AND TEMPORARIES
* 
PRISC OCT 0         LINE PRINTER SELECT CODE
LPTYP OCT 0         LP TYPE: -1=2767  0=2778  1=2610
LPTTY OCT 0         LP USER NUMBER
TLSUP OCT 0         TEMPORARY LP SUSPENSION 
TLPR  OCT 0         TEMPORARY LP RELEASE
LFLAG OCT 0         LINE PRINTER INITIALIZATION FLAG
LPERF OCT 0         LP ERROR REPORT FLAG
LPDRF OCT 0         LP DOWN RETURN FLAG 
LPDIS OCT 0         LP DISCONNECT FLAG
LPXOF OCT 0         LP X-OFF FLAG 
* 
LPBT  DEF LPBT1     **
LPBT1 BSS 1          **  MUST REMAIN IN SEQUENCE
LPBT2 BSS 1         **
* 
DMESS OCT 12                                     [B]
      ASC 3,LP DOW    LP DOWN                    [B]
      OCT 47015                                  [B]
      OCT 5000          MESSAGE                  [B]
DMBPT DEF DMESS+DMESS                            [B]
* 
LTNUM BSS 1 
LCCNT BSS 1 
LBPNT BSS 1 
LBSTR BSS 1 
LBHED BSS 1 
LBSAV BSS 1 
LBGIN BSS 1 
LBEND BSS 1 
LSTAT BSS 1 
LCHAR BSS 1 
      SPC 1 
* 
**    PHONES LOGIC CONSTANTS AND TEMPORARIES
* 
PHNA  BSS 1         REGISTER                     [B]
PHNB  BSS 1                                      [B]
PHNE  BSS 1           STORAGE                    [B]
DSCRA BSS 1         RETURN ADDRESS               [B]
OSTAX BSS 1         OLD STATUS (BOARD #1)        [B]
NSTAX BSS 1         NEW STATUS (BOARD #1)        [B]
OSTAY BSS 1         OLD STATUS (BOARD #2)        [B]
NSTAY BSS 1         NEW STATUS (BOARD #2)        [B]
DSDR1 DEF DSCBX                                  [B]
DSDR2 DEF DSCBY                                  [B]
LTLDB OCT 60        LTBT+LDBT                    [B]
PLTLD OCT 460       PDBT+LTBT+LDBT               [B]
      SPC 1 
* 
**    POWER FAIL/AUTO RESTART CONSTANTS AND TEMPORARIES 
* 
POWA  BSS 1                                      [B]
POWB  BSS 1                                      [B]
POWE  BSS 1                                      [B]
POWP  BSS 1                                      [B]
POWAT BSS 1                                      [B]
POWBT BSS 1                                      [B]
POWFL BSS 1                                      [B]
POWSV BSS 1                                      [B]
POWI  BSS 1                                      [B]
POWJ  BSS 1                                      [B]
PWFLG BSS 1                                      [B]
CTEMP BSS 1                                      [B]
VTEMP BSS 1                                      [B]
FTNUM BSS 1                                      [B]
POWFF OCT 0                                      [B]
CKFLG OCT 0                                      [B]
B360  OCT 360                                    [B]
CLC0  CLC 0                                      [C]
STC0  STC 0                                      [B]
LMXOR ABS MUXRE-MUXOR+1                          [B]
CODES ABS STUP-LCODE                             [C]
TTRP  DEF TTY00+?RPRM                            [B]
      SPC 2 
* 
**    GENERAL USAGE CONSTANTS 
* 
M1200 DEC -1200 
.40   DEC -32 
      DEC -20,-19,-18,-17,-16,-15,-14,-13,-12 
      DEC -11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1
.     EQU * 
      DEC 0,1,2,3,4,5,6,7,8,9,10,11 
      DEC 12,13,14,15,16,17,18,19,20
M136  DEC 136 
SYNCC OCT 77577     SYNCHRONIZING CHARACTER 
CNTLQ EQU .+21B     'CONTROL Q' 
CNTLW OCT 27        'CONTROL W' 
CANCL OCT 30        'CONTROL X' 
BKSPC OCT 137       BACK SPACE
CRLF  OCT 6412      CARRIAGE RETURN - LINE FEED 
RVRSL ASC 1, \
B7    EQU .+7 
B37   OCT 37
B137  OCT 137 
B177  OCT 177 
B340  OCT 340 
B377  OCT 377 
HLTLD OCT 2060
PLDHE OCT 2560      PDBT+LTBT+LDBT+HUBT+ENBT
BMASK OCT 1777
TRINT OCT 17400     TRANSMIT INTERRUPT BITS 
DMASK OCT 43400 
CIRCD OCT 64        "CIRCLE D" FOR SELECTRIC
CRCLD OCT 43664 
CRCLC OCT 43774 
B71M  OCT 71000 
KMASK OCT 73470 
HUMSK OCT 7577
PEJCT OCT 100077    2778A PAGE EJECT CODE 
ICODE OCT 160000
KCODE OCT 160031                                 [B]
TMASK OCT 160377
MASK1 OCT 174377
HIMSK OCT 177400
M277  OCT 177501    =-277B
SCMSK OCT 177700
MASK2 EQU .-8 
.100  EQU SCMSK 
ATEMP BSS 1 
CMA   BSS 1 
CMB   BSS 1 
CME   BSS 1 
MTEMP BSS 1 
NPORT BSS 1 
PCHAR BSS 1 
PHR   BSS 1 
PTNUM BSS 1 
RCODE BSS 1 
STEMP BSS 1 
TBGA  BSS 1 
TBGB  BSS 1 
TBGE  BSS 1 
TBGCN BSS 1 
TEMP1 BSS 1 
TPONT BSS 1 
TTYN  BSS 1 
BIT0  EQU .+1 
BIT1  EQU .+2 
BIT2  EQU .+4 
BIT3  EQU .+10B 
BIT4  EQU .+20B 
BIT5  OCT 000040
BIT6  OCT 000100
BIT7  OCT 000200
BIT8  OCT 000400
BIT9  OCT 001000
BIT10 OCT 002000
BIT11 OCT 004000
BIT12 OCT 010000
BIT13 OCT 20000 
BIT14 OCT 040000
BIT15 OCT 100000
NBT0  EQU .-2 
NBT1  EQU .-3 
NBT2  EQU .-5 
NBT3  EQU .-9 
NBT4  EQU .-21B 
NBT5  OCT 177737
NBT6  OCT 177677
NBT7  OCT 177577
NBT8  OCT 177377
NBT9  OCT 176777
NBT10 OCT 175777
NBT11 OCT 173777
NBT12 OCT 167777
NBT13 OCT 157777
NBT15 OCT 077777
BUFLN EQU 132                                    [C]
EOBIT EQU BIT12 
EFBIT EQU NBT12 
NECHO EQU NBT12 
SLBIT EQU BIT7
SYBIT EQU BIT14 
CTB2  DEF CTBP2 
ICNV  DEF ICNVR 
IDLEL DEF IDLE
IOMTM DEF OMTOM                                  [B]
IMUXR DEF MUXOR                                  [B]
LDWR  DEF LDWNR 
LPCLR DEF CLRLP                                  [B]
LPIN  DEF LPINT 
NIEBT OCT 077677
NDUBT OCT 157773
OCNV  DEF OCNVR 
POW   DEF POWF
PMPXP DEF MPXEP 
TBGDR DEF TBGEN 
TTY   DEF TTY00 
TTCC  DEF TTY00+?CCNT 
TTYTP DEF TTPT
MBLEN ABS -BUFLN-BUFLN
BLEN  ABS BUFLN+BUFLN 
MAXBL ABS -BUFLN-BUFLN+2
PRFS  DEF RFS 
PSC.  EQU CLC0                                   [C]
      HED TELETYPE TABLES 
* 
**
***            TELETYPE TABLES
**
* 
*     THE TELETYPE TABLES ARE LOCATED IN BASE PAGE AND CONTAIN
*     INFORMATION ABOUT THE SYSTEM USERS.  EACH OF THE 32 USERS 
*     HAS ONE TABLE CONTAINING THE FOLLOWING ENTRIES: 
* 
      SPC 1 
?TNUM EQU 0 
*                   PORT NUMBER IN BITS 12-8
      SPC 1 
?CCNT EQU ?TNUM+1 
*                   USED BY MPX FOR COUNTING OUTPUT CHARACTERS.  IT 
*                   EQUALS -# OF CHARACTERS, INCLUDING CURRENT ONE. 
      SPC 1 
?BPNT EQU ?CCNT+1 
*                   ON INPUT - POINTS TO THE CHARACTER LOCATION INTO
*                              WHICH THE NEXT CHARCTER WILL BE
*                              DEPOSITED. 
*                   ON OUTPUT- POINTS TO THE LAST CHAR. TRANSMITTED.
      SPC 1 
?BSTR EQU ?BPNT+1 
*                   ON INPUT - POINTS TO THE FIRST CHARACTER OF THE 
*                              MOST RECENT BUFFER.
*                   ON OUTPUT- POINTS TO THE LOCATION INTO WHICH THE
*                              NEXT CHARACTER WILL BE PLACED BY THE 
*                              OUTCR ROUTINE. 
      SPC 1 
?BHED EQU ?BSTR+1 
*                   ON INPUT - POINTS TO THE NEXT CHARACTER TO BE 
*                              FETCHED. 
      SPC 1 
?BSAV EQU ?BHED+1 
*                   SAVED BUFFER PICKUP POINTER.
      SPC 1 
?BGIN EQU ?BSAV+1 
*                   POINTS TO BEGINNING OF PHYSICAL BUFFER
      SPC 1 
?BEND EQU ?BGIN+1 
*                   POINTS TO FIRST CHARACTER FOLLOWING PHYSICAL
*                   BUFFER. 
      SKP 
?STAT EQU ?BEND+1 
      SPC 1 
TPBT  EQU BIT0      USER IS IN TAPE MODE
TPNBT EQU NBT0
STBT  EQU BIT1      USER WAS TURNED OFF 
STNBT EQU NBT1
CXBT  EQU BIT2      'CONTROL X' WAS HIT 
IOBT  EQU BIT3      USER IS IN INPUT MODE 
IONBT EQU NBT3
LDBT  EQU BIT4      LINE DROPOUT OCCURRED 
LDNBT EQU NBT4
LTBT  EQU BIT5      WAIT FOR LOG TIMING 
LTNBT EQU NBT5
ENBT  EQU BIT6      TIMING FOR <ENTER>
ENNBT EQU NBT6
RNBT  EQU BIT7      USER IS RUNNING 
RNNBT EQU NBT7
PDBT  EQU BIT8      PHONE DISCONNECTED
NIBT  EQU BIT9      NO INPUT ALLOWED
NINBT EQU NBT9
HUBT  EQU BIT10     HANG USER UP
XOBT  EQU BIT11     X-OFF WAS READ FROM TERMINET
XONBT EQU NBT11 
*               STYP2 EQU BIT12     * 
*               STYP3 EQU BIT13      *
*               STYP4 EQU B1213      **  TELETYPE SUBTYPES
*               STYP5 EQU BIT14      *
*               STYP6 EQU B1214     * 
ICBT  EQU BIT15     INPUT CONFIGURATION NEEDED
ICNBT EQU NBT15 
      SPC 1 
?ATIM EQU ?STAT+1 
*                   CONTAINS ALLOWED TIME FOR <ENTER STATEMENT> 
*                   EXECUTION.
      SPC 1 
?TIMO EQU ?ATIM+1 
*                   TIMEOUT VALUE FOR USER EXECUTING <ENTER 
*                   STATEMENT>. 
      SPC 1 
?PHON EQU ?TIMO+1 
*                   USED AS TIME COUNTER FOR PHONES LOGIC.
      SKP 
?TYPE EQU ?PHON+1 
*                   TERMINAL TYPE: ASCII     =0 
* 
*                                  EBCD      BIT0 =0
*                                            BIT15=1
* 
*                                  CALL/360  BIT0 =1
*                                            BIT15=0
* 
*                   FOR EBCD & CALL/360 TERMINAL: 
      SPC 1 
CDBT  EQU BIT1      CODE DETERMINED 
UCBT  EQU BIT2      UPPER CASE MODE 
UCNBT EQU NBT2
CNBT  EQU BIT3      "CENT" CHARACTER
CNNBT EQU NBT3
CCBT  EQU BIT4      "CENTC" CHARACTER 
CRBT  EQU BIT5      "CR" BIT(OUTPUT ONLY!)
CRNBT EQU NBT5
XBIT  EQU BIT6      "CONTROL X" WAS INPUT 
XNBIT EQU NBT6
CBBT  EQU BIT7      "CIRCLE C" WAS SENT 
CBNBT EQU NBT7
*                         BIT8       CIRCLE D * 
*                         BIT9       SYNC      *   TRANSMIT 
*                         BIT10      SPACE     **  INTERRUPT
*                         BIT11      SPACE     *   BITS 
*                         BIT12      SPACE    * 
DIBT  EQU BIT13     "CIRCLE D" WAS RECEIVED 
      SPC 1 
?CDLY EQU ?TYPE+1 
*                   CARRIAGE RETURN DELAY (NEGATIVE). 
      SPC 1 
?LDLY EQU ?CDLY+1 
*                   LINE FEED DELAY (NEGATIVE). 
      SPC 1 
?DCNT EQU ?LDLY+1 
*                   CR AND LF DELAY COUNTER.
      SPC 1 
?SCNT EQU ?DCNT+1 
*                   CHARACTER COUNTER USED FOR DETERMINING CARRIAGE 
*                   RETURN DELAYS.
      SPC 1 
?RPRM EQU ?SCNT+1 
*                   RECEIVE CHANNEL PARAMETERS. 
      SPC 1 
?SPRM EQU ?RPRM+1 
*                   SEND CHANNEL PARAMETERS.
      SPC 1 
?PPRM EQU ?SPRM+1 
*                   PHONE PARAMETER.
      SKP 
TTY00 OCT 0,0 
      REP 5 
      DEF BUF00+BUF00 
      DEF BUF00+BUF00+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY01 OCT 400,0 
      REP 5 
      DEF BUF01+BUF01 
      DEF BUF01+BUF01+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY02 OCT 1000,0
      REP 5 
      DEF BUF02+BUF02 
      DEF BUF02+BUF02+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY03 OCT 1400,0
      REP 5 
      DEF BUF03+BUF03 
      DEF BUF03+BUF03+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY04 OCT 2000,0
      REP 5 
      DEF BUF04+BUF04 
      DEF BUF04+BUF04+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY05 OCT 2400,0
      REP 5 
      DEF BUF05+BUF05 
      DEF BUF05+BUF05+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY06 OCT 3000,0
      REP 5 
      DEF BUF06+BUF06 
      DEF BUF06+BUF06+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY07 OCT 3400,0
      REP 5 
      DEF BUF07+BUF07 
      DEF BUF07+BUF07+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY10 OCT 4000,0
      REP 5 
      DEF BUF10+BUF10 
      DEF BUF10+BUF10+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY11 OCT 4400,0
      REP 5 
      DEF BUF11+BUF11 
      DEF BUF11+BUF11+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY12 OCT 5000,0
      REP 5 
      DEF BUF12+BUF12 
      DEF BUF12+BUF12+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY13 OCT 5400,0
      REP 5 
      DEF BUF13+BUF13 
      DEF BUF13+BUF13+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY14 OCT 6000,0
      REP 5 
      DEF BUF14+BUF14 
      DEF BUF14+BUF14+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY15 OCT 6400,0
      REP 5 
      DEF BUF15+BUF15 
      DEF BUF15+BUF15+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY16 OCT 7000,0
      REP 5 
      DEF BUF16+BUF16 
      DEF BUF16+BUF16+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY17 OCT 7400,0
      REP 5 
      DEF BUF17+BUF17 
      DEF BUF17+BUF17+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY20 OCT 10000,0 
      REP 5 
      DEF BUF20+BUF20 
      DEF BUF20+BUF20+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY21 OCT 10400,0 
      REP 5 
      DEF BUF21+BUF21 
      DEF BUF21+BUF21+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY22 OCT 11000,0 
      REP 5 
      DEF BUF22+BUF22 
      DEF BUF22+BUF22+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY23 OCT 11400,0 
      REP 5 
      DEF BUF23+BUF23 
      DEF BUF23+BUF23+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY24 OCT 12000,0 
      REP 5 
      DEF BUF24+BUF24 
      DEF BUF24+BUF24+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY25 OCT 12400,0 
      REP 5 
      DEF BUF25+BUF25 
      DEF BUF25+BUF25+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY26 OCT 13000,0 
      REP 5 
      DEF BUF26+BUF26 
      DEF BUF26+BUF26+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY27 OCT 13400,0 
      REP 5 
      DEF BUF27+BUF27 
      DEF BUF27+BUF27+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY30 OCT 14000,0 
      REP 5 
      DEF BUF30+BUF30 
      DEF BUF30+BUF30+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY31 OCT 14400,0 
      REP 5 
      DEF BUF31+BUF31 
      DEF BUF31+BUF31+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY32 OCT 15000,0 
      REP 5 
      DEF BUF32+BUF32 
      DEF BUF32+BUF32+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY33 OCT 15400,0 
      REP 5 
      DEF BUF33+BUF33 
      DEF BUF33+BUF33+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY34 OCT 16000,0 
      REP 5 
      DEF BUF34+BUF34 
      DEF BUF34+BUF34+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY35 OCT 16400,0 
      REP 5 
      DEF BUF35+BUF35 
      DEF BUF35+BUF35+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY36 OCT 17000,0 
      REP 5 
      DEF BUF36+BUF36 
      DEF BUF36+BUF36+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
TTY37 OCT 17400,0 
      REP 5 
      DEF BUF37+BUF37 
      DEF BUF37+BUF37+BUFLN+BUFLN 
      OCT 0,0,0,0,0,0,0,0,0,0,0,0 
* 
      BSS 0              END OF TELETYPE TABLES 
      HED REQUEST FOR SERVICE 
* 
**
***      REQUEST FOR SERVICE
**
* 
*   THIS ROUTINE DECODES REQUESTS FOR SERVICE FROM THE SYSTEM 
*   PROCESSOR AND THEN CALLS ON THE PROPER SERVICE ROUTINE FOR
*   PROCESSING. 
* 
RFS   NOP 
      STA CMA       S   A,
      STB CMB        A   B, 
      ERA             V   AND 
      STA CME          E   E
      LIA C1        LOAD REQUEST CODE 
      STA RCODE       AND SAVE IT 
      ALF,ALF       MOVE TTY# TO RIGHT END
      AND B37       MASK TO 5 BITS
      ADA TTYTP     ADD TTY TABLE POINTER 
      LDB A,I       B = TTY TABLE ADDRESS 
      LDA RCODE     LOAD REQUEST WORD, MOVE REQUEST 
      ALF,CLE,ERA     CODE TO RIGHT 3 BITS, AND MASK
      AND B7            IT (E = 1 FOR UPPER 16 TTYS)
      ADA DTPNT     AND ON DECODE TABLE POINTER 
      CLF 0 
      JMP A,I       CALL SERVICE ROUTINE
* 
*             DECODE TABLE
* 
DTPNT DEF *+1,I     DECODE TABLE POINTER
      DEF POC       0 - PROCESS OUTPUT CHARACTER
      DEF STE       1 - START ENTER TIMING
      DEF FNC       2 - FETCH NEXT CHARACTER
      DEF PHS       3 - PHONES TIMING 
      DEF SPE       4 - BAUD RATE 
      DEF SBP       5 - SAVE BUFFER POINTER 
      DEF RBP       6 - RESTORE BUFFER POINTER
      DEF MIKRO     7 - CODED 
* 
**        PROCESS MIKRO-CODED REQUEST 
* 
MIKRO EQU * 
      LDA RCODE     LOAD REQUEST WORD 
      AND B37       MASK TO 5 BITS
      ADA CODES     IS RCODE LEGAL?              [C]
      SSA,RSS                                    [C]
      JMP SRRTN     NO, EXIT                     [C]
      LDA RCODE     YES, MASK                    [C]
      AND B37         TO 5 BITS                  [C]
      ADA MTPNT     ADD ON MIKRO-DECODE TABLE POINTR
      JMP A,I       CALL SERVICE ROUTINE
* 
*              MIKRO-DECODE TABLE 
* 
MTPNT DEF *+1,I     MIKRO-DECODE TABLE POINTER
STUP  EQU * 
      DEF INIF       0 - INITIALIZE THE I/O SYSTEM
      DEF UIR        1 - USER IS RUNNING
      DEF UNR        2 - USER NOT RUNNING 
      DEF IWT        3 - INPUT WAIT 
      DEF HUU        4 - HANG USER UP 
      DEF ULO        5 - STOP AUTO-DISCONNECT TIMING
      DEF ECO        6 - ECHO ON
      DEF ECF        7 - ECHO OFF 
      DEF TPO       10 - TAPE MODE ON 
      DEF ILI       11 - ILLEGAL INPUT - TAPE MODE
      DEF NUC       12 - NEW USER CALLED
      DEF KAO       13 - KILL ALL OUTPUT
      DEF ALI       14 - ALLOW INPUT
      DEF OWT       15 - OUTPUT WAIT
      DEF IBF       16 - IS BUFFER FULL?
      DEF PSC       17 - LINE PRINTER SELECT CODE 
      DEF LPR       20 - LINE PRINTER REQUEST 
      DEF LPD       21 - LINE PRINTER DISCONNECT
      DEF LPS       22 - LINE PRINTER STATUS
      DEF BKS       23 - BACKSPACE
      DEF CHS       24 - CHARACTER SIZE INFORMATION 
      DEF STP       25 - SUBTYPE INFORMATION
      DEF GRP       26 - GET RECEIVE PARAMETER
      DEF ABT       27 - USER ABORTED 
      DEF WTP       30 - WHAT TERMINAL TYPE?
DUMP  DEF KSN       31 - CORE DUMP               [B]
LCODE EQU *                                      [C]
      SPC 1 
* 
**        SERVICE REQUEST RETURN POINT
* 
SVRTN EQU *                                      [B]
      STA B,I      RETURN WITH SAVE              [B]
SRRTN EQU * 
      STF 0 
      LDB CME       RESTORE 
      ELB             E,
      LDA CMA         A,
      LDB CMB         AND B 
      STC C1,C      ACKNOWLEDGE RECEIPT 
      JMP RFS,I     RETURN
RFSE  EQU * 
