Trailing-Edge
-
PDP-10 Archives
-
AP-4178E-RM
-
swskit-sources/dupsrv.mac
There is 1 other file named dupsrv.mac in the archive. Click here to see a list.
;<3A.MONITOR>DUPSRV.MAC.26, 7-Jun-78 15:29:25, Edit by KIRSCHEN
;REMOVE INCORRECT CHECK FOR ASCIZ IN BTCLI
;<3A.MONITOR>DUPSRV.MAC.25, 18-May-78 08:23:19, Edit by MCCLURE
; IMPROVE N IN REP MESSAGES
;<3.SM10-RELEASE-3>DUPSRV.MAC.24, 10-May-78 15:24:33, Edit by MCCLURE
; FIX BTIPR FOR .VNDDC
;<3.SM10-RELEASE-3>DUPSRV.MAC.22, 5-May-78 00:10:14, Edit by MCCLURE
; Fix .VNCNL & .VNCBL
;<3.SM10-RELEASE-3>DUPSRV.MAC.21, 1-May-78 12:57:24, Edit by MCCLURE
;<3A.MONITOR>DUPSRV.MAC.20, 11-Apr-78 15:53:00, Edit by MCCLURE
; Clear PGDLMX in DEDLIN
;<3A.MONITOR>DUPSRV.MAC.19, 6-Apr-78 16:23:44, Edit by MCCLURE
; Add new COMIOP u-code
;<3A.MONITOR>DUPSRV.MAC.18, 29-Mar-78 14:09:57, Edit by MCCLURE
; Have BTCLI and BTCPN believe KDP_0_#
;<3A.MONITOR>DUPSRV.MAC.17, 28-Mar-78 10:54:15, Edit by MCCLURE
;<3A.MONITOR>DUPSRV.MAC.16, 23-Mar-78 16:41:48, Edit by MCCLURE
; ADD THINGS WHICH GOT DROPPED
;<3A.MONITOR>DUPSRV.MAC.15, 15-Mar-78 12:20:42, Edit by MCCLURE
;<3A.MONITOR>DUPSRV.MAC.14, 9-Mar-78 11:08:40, Edit by MCCLURE
; ADD BTIPR, BTTPR, BTSTS, BTRLC, BTCLI, BTCPN
;<3A.MONITOR>DUPSRV.MAC.13, 3-Feb-78 03:38:55, Edit by MCCLURE
;<3A.MONITOR>DUPSRV.MAC.12, 31-Jan-78 03:09:20, Edit by MCCLURE
;<3A.MONITOR>DUPSRV.MAC.11, 29-Jan-78 16:36:30, Edit by MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.9, 13-Jan-78 01:10:52, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.8, 12-Jan-78 17:27:05, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.7, 11-Jan-78 05:13:34, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.6, 3-Jan-78 10:14:36, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.5, 23-Dec-77 05:41:33, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.4, 22-Dec-77 02:56:16, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.3, 15-Dec-77 23:26:42, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.2, 14-Dec-77 09:55:45, EDIT BY MCCLURE
;<3.SM10-RELEASE-3>DUPSRV.MAC.1, 6-Dec-77 20:44:59, EDIT BY MCCLURE
;10-August-1977 DMCC
SEARCH PROLOG,PROKS
TTITLE DUPSRV
EXTN <DEDMCB>
EXTN <DUPLIM,DUPNLN,DUPN,DUPPAG,DUPTIM,DUPXPC>
EXTN <KMCACS,KMCINQ,KMCIPL,KMCFLG,KMCPAG,KMCQLN>
EXTN <NODINI,NSPQ,NSPSPC>
;THIS MODULE PROVIDES SUPPORT FOR DUP11'S WITH A KMC11 FOR NSPSRV ON A 2020
;THINGS TO CHECK
; 1) ERROR COUNTERS - SYSERR
; 2) COLLAPSE PAGES
IFNDEF FTRACE,<FTRACE==-1> ;NONZERO TO TURN ON TRACE
; TABLE OF CONTENTS FOR DUPSRV
;
;
; SECTION PAGE
; 1. DEFINITIONS
; 1.1 STG............................................... 4
; 1.2 KMC11............................................. 5
; 1.3 DUP11............................................. 7
; 1.4 DDCMP............................................. 8
; 2. PROTOTYPE MESSAGES........................................ 9
; 3. DUP11 COMIOP CODE FOR KMC11............................... 10
; 4. BOOT JSYS
; 4.1 PERFORMS BOOTSTRAP FUNCTIONS FOR KMC11............ 11
; 4.2 SEND MOP MESSAGE.................................. 13
; 4.3 INITIATE PROTOCOL................................. 14
; 4.4 TERMINATE PROTOCOL................................ 15
; 4.5 RETURN PROTOCOL STATUS............................ 16
; 4.6 RECEIVE MOP MESSAGE............................... 17
; 4.7 LOAD KMC11........................................ 18
; 4.8 DUMP THE KMC11.................................... 23
; 4.9 RETURN LINE COUNTERS.............................. 25
; 4.10 CONVERT LINE-ID TO PORT NUMBER.................... 26
; 4.11 CONVERT PORT NUMBER TO LINE-ID.................... 27
; 5. HERE TO INITIALIZE THE KMC11.............................. 28
; 6. KMC11 INTERRUPT LEVEL SERVICE............................. 32
; 7. DDCMP RECEIVER
; 7.1 DATA MESSAGE...................................... 34
; 7.2 CONTROL MESSAGE................................... 35
; 7.3 ACK MESSAGE....................................... 36
; 7.4 NAK MESSAGE....................................... 38
; 7.5 REP MESSAGE....................................... 39
; 7.6 START MESSAGE..................................... 40
; 7.7 STACK MESSAGE..................................... 41
; 7.8 JUNK MESSAGE...................................... 42
; 8. DDCMP TRANSMIT DONE....................................... 43
; 9. KMC11 CONTROL OUT INTERRUPT............................... 44
; 10. HERE FROM NSPSRV WITH OUTPUT MESSAGES..................... 45
; 11. HERE ONCE A SECOND TO CHECK THINGS........................ 46
; 12. DDCMP TRANSMITTER
; 12.1 DATA MESSAGES..................................... 47
; 12.2 REP MESSAGE....................................... 48
; 12.3 ACK MESSAGE....................................... 49
; 12.4 NAK MESSAGE....................................... 50
; 12.5 CONTROL MESSAGE................................... 51
; 12.6 DATA MESSAGES..................................... 52
; 13. HERE TO ENABLE RECEIVER................................... 53
; P1 FOR LINE SPECIFIC CODE WILL CONTAIN THE ADDRESS OF THE LINES PAGE
; MESSAGE BLOCKS LIVE IN BLOCKS OF RESIDENT SPACE
BLKSIZ=<MBKFRE*10>+1 ;SIZE OF BLOCKS IN RESIDENT SPACE
;FORMAT OF EACH MESSAGE BLOCK
MBKLNK==0 ;LH = ADR OF NEXT MESSAGE BLOCK
; RH = ADR OF MESSAGE
MBKCOD==1 ;DRIVER UNIQUE CODE
MBKLEN==2 ;LH IS DRIVER INT LOC
; RH IS LENGTH OF MESSAGE IN BYTES
;FOLLOWING VALID ONLY FOR LAST MSG BLOCK IN BLOCK
MBKFRE==3 ;LH = NUMBER OF FREE WORDS LEFT IN BLOCK
; RH = ADR OF BLOCK
;KMCINQ - QUEUE OF MESSAGE TO BE GIVEN TO THE KMC11
; FIRST WORD IS USED TO PUT THINGS INTO THE QUEUE
; 2ND WORD IS USED TO TAKE ENTRIES FROM QUEUE
; QUEUE ENTRIES ARE 2 WORDS LONG
; RH OF 1ST WORD GOES TO BSEL2
; LH OF 2ND WORD GOES TO BSEL4
; RH OF 2ND WORD GOES TO BSEL6
SUBTTL DEFINITIONS -- STG
DEFINE X (A,B)<
A==Z
Z=Z+B
>
Z=0
;PAGE OFFSETS
X PGUBAD,1 ;LH IS UNIBUS ADR OF PAGE
X PGDSTS,1 ;DDCMP STATUS
DEFSTR (DDSTA,PGDSTS(P1),35,3) ;DDCMP STATE
STADWN==0 ;KMC11 NOT RUNNING
STAMAI==1 ;MAINT MODE
STASTR==2 ;SENDING STARTS
STASTK==3 ;SENT STACK
STARUN==4 ;RUNNING
DEFSTR (DDTIM,PGDSTS(P1),32,7) ;TIMER
TIMSTR==5 ;5 SECONDS BETWEEN STARTS
TIMREP==3 ;3 SECONDS BETWEEN REPS
REPMAX==200 ;MAXIMUM NUMBER OF REPS BEFORE DECLARING LINE DOWN
DUPDSR==1B14 ;DATASET READY
DEFSTR (DDXAK,PGDSTS(P1),13,1) ;WANT TO SEND AN ACK
DEFSTR (DDNCD,PGDSTS(P1),12,3) ;NAK CODE TO SEND
DEFSTR (DDXRP,PGDSTS(P1),9,1) ;WANT TO SEND A REP
DEFSTR (DCHNG,PGDSTS(P1),8,2) ;INFORMATION FOR NSPSRV (SWAPPABLE)
DDUP==1 ;DDCMP NOW UP
DDOWN==2 ;DDCMP DOWN
X PGDOMQ,1 ;DDCMP OUTPUT MESSAGE QUEUE
; LH IS ADR OF FIRST OUTPUT MESSAGE BLOCK
; RH IS ADR OF LAST OUTPUT MESSAGE BLOCK
X PGDLMX,1 ;RH IS ADR OF MESSAGE BLOCK FOR LAST MESSAGE TRANSMITTED
X PGFCOR,1 ;RH & LH ARE ADR OF CORE BLOCKS FOR MESSAGE QUEUE
;LH ASSIGNED FIRST, RH USED FIRST
X PGDMNM,1 ;DDCMP MESSAGE NUMBERS
DEFSTR (DDRMN,PGDMNM(P1),7,8) ;RECEIVED MESSAGE NUMBER (HIGHEST)
DEFSTR (DDHXM,PGDMNM(P1),15,8) ;HIGHEST MESSAGE NUMBER TRANSMITTED
DEFSTR (DDHMA,PGDMNM(P1),23,8) ;HIGHEST MESSAGE NUMBER ACKED
DEFSTR (DDREPC,PGDMNM(P1),35,12) ;COUNTER FOR REPS
X PGDUPN,1 ;DUP11 LINE NUMBER
X PGUBAM,1 ;ADR OF UBA MAPPING REGISTER FOR PAGE
X PGZTIM,1 ;TIME LAST ZEROED COUNTERS, TICKED ONCE PER SECOND
X PGCOCN,10 ;CONTROL OUT COUNTS AS FOLLOWS
;10 = INVALID DDCMP HEADER
;12 = BAD CRC
;14 = BUFFER NOT AVAILABLE
;16 = DATASET READY TRANSITION
;20 = NXM
;22 = TRANSMIT UNDERRUN
;24 = RECEIVER UNDERRUN
;26 = KILL COMPLETE
X PGCOXX,1 ;OTHER
X PGXMCN,1 ;COUNT OF DDCMP MESSAGES TRANSMITTED
X PGNRNK,10 ;COUNT OF RECEIVED NAKS
; FIRST IS MISC NAKS, NEXT 7 ARE BY NAK CODE
X PGRMCN,1 ;COUNT OF DDCMP MESSAGES RECEIVED
X PGNXNK,10 ;COUNT OF TRNASMITTED NAKS
; FIRST IS MISC NAKS, NEXT 7 ARE BY NAK CODE
X PGKMCR,2 ;KMC11 REGISTERS WHEN KMC11 LAST HALTED
; BSEL0,,BSEL2
; BSEL4,,BSEL6
X PGLACK,2 ;LAST DDCMP ACK,NAK OR DATA MESSAGE TO UPDATE ACKED MESSAGE
X PGXBD1,4 ;1ST TRANSMIT BUFFER DESCRIPTOR LIST
X PGXMS1,140 ;1ST XMIT MESSAGE BUFFER
X PGXBD2,4 ;2ND TRANSMIT BUFFER DESCRIPTOR LIST
X PGXMS2,140 ;2ND XMIT MESSAGE BUFFER
X PGRBD1,4 ;1ST RECEIVE BUFFER DESCRIPTOR LIST
X PGRMS1,140 ;1ST INPUT MESSAGE BUFFER
X PGRBD2,4 ;2ND RECEIVE BUFFER DESCRIPTOR LIST
X PGRMS2,140 ;2ND INPUT MESSAGE BUFFER
IFN FTRACE,<
X PGTPTR,1 ;TRACE PUTTER
Z=<Z+1>&<-2> ;TRACE MUST BEGIN ON AN EVEN WORD
X PGTRCE,1 ;TRACE
>;IFN FTRACE
PURGE Z,X
SUBTTL DEFINITIONS -- KMC11
;KMC11 REGISTER BIT DEFINITIONS
BSEL0==0
BSEL1==1
KMCRUN==100000 ;RUN FLOP
KMCMCL==040000 ;MASTER CLEAR
KMCCWR==020000 ;CRAM WRITE
KMCSLU==010000 ;STEP LINE UNIT
KMCLUL==004000 ;LINE UNIT LOOP
KMCRMO==002000 ;ROM OUTPUT
KMCRMI==001000 ;ROM INPUT
KMCSUP==000400 ;STEP u-PROCESSOR
KMCRQI==000200 ;REQUEST INPUT
KMCIEO==000020 ;INTERRUPT ENABLE OUTPUT
KMCIEI==000001 ;INTERRUPT ENABLE INPUT
BSEL2==2
BSEL3==3 ;CONTAINS LINE NUMBER
KMCRDO==000200 ;READY FOR OUTPUT
KMCRDI==000020 ;READY FOR INPUT
KMCIOT==000004 ;SET FOR RECEIVE CLEARED FOR TRANSMIT
KMCTYP==000003 ;COMMAND TYPE
BASEIN==000003 ;BASE IN
CNTLIN==000001 ;CONTROL IN
BFADIN==000000 ;BUFFER ADDRESS IN
CNTLOU==000001 ;CONTROL OUT
BFADOU==000000 ;BUFFER ADDRESS OUT
BSEL4==4
BSEL5==5
;BUFFER DESCRIPTOR LIST ADDRESS (BUFFER ADR IN & OUT & CONTROL OUT)
BSEL6==6
BSEL7==7
;140000 ;ADR BITS 17 & 16 (BUFFER ADR IN & OUT & CONTROL OUT)
BFREOM==010000 ;END OF MESSAGE (BUFFER ADR OUT)
BFRENB==020000 ;BUFFER ENABLE (BUFFER ADR IN)
BFRKIL==010000 ;BUFFER KILL (BUFFER ADR IN)
CSRMSK==017770 ;MASK FOR DUP11 CSR ADR (BASE IN)
CDDCMP==100000 ;FLAG THIS A DDCMP LINE (CONTROL IN)
CHALFD==020000 ;FLAG THIS IS HALF DUPLEX (CONTROL IN)
;010000 ;ENABLE SECONDARY STATION (CONTROL IN)
;001000 ;CRC INHIBIT (CONTROL IN)
CENABL==000400 ;FLAG TO ENABLE LINE (CONTROL IN)
COUERR==000377 ;ERROR CODE (CONTROL OUT)
CRAMSZ==2000 ;SIZE OF KMC11 CRAM
DRAMSZ==2000 ;SIZE OF KMC11 DRAM
;BUFFER DESCRIPTOR LISTS ARE STRINGS OF 3 16 BIT WORDS
; 1ST WORD 16 BITS OF BUFFER ADDRESS
; 2ND WORD 16 BIT BYTE COUNT
; 3RD WORD
BDLLDS==100000 ;LAST DESCRIPTOR
BDLRSY==010000 ;RESYNC TRANSMITTER
;==006000 ;BUFFER ADDRESS 17 & 16
BDLEOM==001000 ;END OF MESSAGE
BDLSOM==000400 ;START OF MESSAGE
;MESSAGES TO THE KMC11
; BASEIN: BSEL2/ <LINE #>*400+3
; BSEL6/ <DUP11 ADR>&017770
; CONTROL IN: BSEL2/ <LINE #*400+1
; BSEL6/ FLAGS
; BF AD IN: BSEL2/ <LINE NU>*400+0+<4 IF INPUT>
; BSEL4/ BUFFER DESCRIPTOR LIST ADR
; BSEL6/ FLAGS
; BF AD OUT: BSEL2/ <LINE NU>*400+0+<4 IF RECEIVE>
; BSEL4/ BUFFER DESCRIPTOR LIST ADR
; BSEL6/ FLAGS
; CONTROL OUT: BSEL2/ <LINE NU>*400+1+<4 IF RECEIVE>
; BSEL4/ BUFFER DESCRIPTOR LIST ADR
; BSEL6/ ERROR CODE
SUBTTL DEFINITIONS -- DUP11
DUPADR==3760300 ;ADDRESS OF 1ST DUP11
DUPUBN==3 ;UNIBUS ADAPTER NUMBER FOR DUP11
DPRCSR==0 ;RECEIVER CSR
DPRDBF==2 ;(RO)RECEIVER DATA BUFFER
DPPCSR==2 ;(WO)PARAMETER CONTROL AND STATUS REGISTER
DPTCSR==4 ;TRANSMIT CONTROL AND STATUS REGISTER
DPCBLP==010000 ;EXTERNAL MAINTENCE MODE (CABLE LOOPBACK)
DPCNLP==004000 ;SYSTEMS TEST MODE (CONTROLLER LOOPBACK)
DPMAIN==014000 ;MAINTAINENCE MODE BITS
DPTDBF==6 ;TRANSMIT DATA BUFFER
SUBTTL DEFINITIONS -- DDCMP
SYN==226
IDLE==SYN ;NO SPECIAL IDLE CHARACTER
ENQ==005 ;1ST CHAR IN UNNUMBERED MESSAGES
DLE==220 ;1ST CHAR IN BOOTSTRAP MESSAGES
SOH==201 ;1ST CHAR IN NUMBERED MESSAGES
MAXOUT==10 ;MAXIMUM NUMBER OF DATA MESSAGES TO PUT IN PIPE
;NUMBERED MESSAGES
; SOH CC1 CC2 QSYNC SELECT R N A0 BCC1 DATA BCC2
; CC1&CC2 ARE TOTAL LENGTH OF DATA(BCC1 THRU BCC2 EXCLUSIVE)
; CC1 IS LOWORDER 8BITS OF LENGTH
; CC2 IS HIGH ORDER 6 BITS OF LENGTH
QSYNC==100 ;QSYNC BIT
SELECT==200 ;SELECT BIT
; R IS # OF LAST GOOD MESSAGE RECEIVED
; N IS THIS MESSAGE NUMBER
A0==1 ;A0 IS THE DESTINATION STATION ADR(ALWAYS 1)
; BCC1 IS THE 16 BIT CRC ON SOH THROUGH A0 INCLUSIVE
; DATA IS PASSED TO NCL
; BCC2 IS THE 16BIT CRC OF DATA
;UNNUMBERED MESSAGES
FILL==000 ;FILL CHARACTER
;ACK: ENQ ACK QSYNC SELECT FILL MSG# FILL A0 BCC1 BCC2
ACK==001
; MSG# IS LAST GOOD MSG RECEIVED
;NAK: ENQ NAK QSYNC SELECT RNAK MSG# FILL A0 BCC1 BCC2
NAK==002 ;NETIVE ACKNOWLEDGE
; RNAK IS NAK REASON AS FOLLOWS
NCDHBC==1 ;HEADER BCC ERROR
NCDBCC==2 ;DATA BCC ERROR
NCDREP==3 ;REP RESPONSE
NCDBTU==4 ;BUFFER TEMPORARILY UNAVAILABLE
NCDROV==5 ;RECEIVER OVERRUN
NCDMTL==6 ;MESSAGE TOO LONG
NCDHFE==7 ;HEADER FORMAT ERROR
; MSG# IS LAST GOOD MSG RECEIVED
;REP: ENQ REP QSYNC SELECT FILL FILL N A0 BCC1 BCC2
REP==003 ;REPLY TYPE
; N IS THE LAST MESSAGE# SENT
;RESET: ENQ RESET QSYNC SELECT FILL FILL N A0 BCC1 BCC2
; RESET==4 ;DC72 WILL NOT SEND THIS TYPE;WILL RESPOND WITH START
;RESAK: ENQ RESAK QSYNC SELECT FILL R FILL A0 BCC1 BCC2
RESAK==5 ;DC72 WILL NOT SEND THIS TYPE;WILL RESPOND WITH START
;START: ENQ STRT QSYNC SELECT FILL FILL N A0 BCC1 BCC2
STRT==006 ;START TYPE
; N IS NEXT NUMBERED MESSAGE TO BE SENT
;STACK: ENQ STACK QSYNC SELECT FILL R N A0 BCC1 BCC2
STACK==007 ;START ACKNOWLEDGE
; R IS NEXT EXPECTED MESSAGE # FOR RECPTION
; N IS NEXT MESSAGE # FOR TRANSMISSION
MSNMAX==377 ;MAXIMUM MESSAGE NUMBER
;WHEN A MSG IS RECEIVED CORRECTLY AN ACK IS SENT BACK;
; AN ACK IMPLIES ACK OF ALL LOWER NUMBERED MESSAGES
;WHEN A MSG IS RECEIVED INCORRECTLY A NAK MSG IS SENT BACK;
; A NAK IMPLIES ACK OF ALL LOWER NUMBERED MSGS.
SUBTTL PROTOTYPE MESSAGES
RESCD
ACKMSG: BYTE(18)ENQ+400*ACK,FILL+400*FILL,FILL+400*A0,FILL+400*FILL
NAKMSG: BYTE(18)ENQ+400*NAK,FILL+400*FILL,FILL+400*A0,FILL+400*FILL
REPMSG: BYTE(18)ENQ+400*REP,FILL+400*FILL,FILL+400*A0,FILL+400*FILL
STRTMS: BYTE(18)ENQ+400*STRT,QSYNC+SELECT+FILL+400*FILL,FILL+400*A0,FILL+400*FILL
STCKMS: BYTE(18)ENQ+400*STACK,QSYNC+SELECT+FILL+400*FILL,FILL+400*A0,FILL+400*FILL
SUBTTL DUP11 COMIOP CODE FOR KMC11
SWAPCD
COMIOP: BYTE(18)61220,61222,63234,63233,63224,16400,123600,60400
BYTE(18)103412,100405,440,63225,74524,63220,60365,101427
BYTE(18)63064,2777,4457,70000,76613,62614,114707,4003
BYTE(18)10375,16451,16517,2777,123620,103163,10375,4003
BYTE(18)140620,120440,103501,120440,103434,400,61222,2511
BYTE(18)100434,2511,10377,50220,101434,55223,55224,55225
BYTE(18)55226,55227,55222,10376,57221,43220,2517,767
BYTE(18)60360,101474,406,62400,40361,101477,100500,2777
BYTE(18)10375,123400,103105,2441,100434,2443,700,61231
BYTE(18)100434,120400,103514,100451,3020,61202,102121,2524
BYTE(18)100434,2531,600,100507,120440,103127,100533,120400
BYTE(18)102121,120440,103034,2451,457,63225,123072,60532
BYTE(18)70005,57233,47234,70213,14414,75231,56226,56227
BYTE(18)70213,120440,102555,102272,100764,102254,400,61222
BYTE(18)123620,116353,100434,521,61271,400,63232,73233
BYTE(18)67234,100607,123620,116353,63072,420,60372,101436
BYTE(18)4457,63220,60532,70000,57233,47234,70213,54620
BYTE(18)43220,101572,62560,101172,76620,56224,56225,415
BYTE(18)61230,43231,120600,102222,23421,60731,106750,23100
BYTE(18)23417,103637,1400,106441,60617,107576,100572,402
BYTE(18)62004,415,61230,120600,102243,23007,23030,60617
BYTE(18)100632,110740,110470,110545,137140,14770,62660,56226
BYTE(18)123160,740,62700,42227,401,62223,556,63236
BYTE(18)405,114643,120560,102277,17400,76560,100702,136500
BYTE(18)136500,422,76222,134560,2401,103707,2400,42223
BYTE(18)421,61230,120600,102312,123560,103724,122142,2600
BYTE(18)102722,2400,422,100732,2626,42222,2444,103331
BYTE(18)2440,600,62263,736,63236,114645,120560,1400
BYTE(18)103343,400,100746,410,63220,42700,76222,2633
BYTE(18)120560,103753,2605,400,76223,136540,454,70013
BYTE(18)2400,556,63236,114645,22144,22165,415,61230
BYTE(18)120440,1400,102775,432,100776,411,60413,63226
BYTE(18)120600,106000,23017,120560,113002,417,70006,43625
BYTE(18)1400,107033,2440,70206,136500,136520,123160,700
BYTE(18)60660,1400,1400,1400,1400,62620,60525,103556
BYTE(18)434,63235,114450,500,62705,43225,403,70006
BYTE(18)104414,60601,1400,107045,100634,404,62004,415
BYTE(18)61230,120600,106051,20400,107456,100634,22106,22127
BYTE(18)123220,501,63260,414,61311,454,70013,43620
BYTE(18)113105,451,70013,40620,1400,107107,106100,100634
BYTE(18)23140,770,62266,773,63677,62222,110520,20400
BYTE(18)107116,20420,102634,3020,110515,103634,43620,106164
BYTE(18)463,63236,445,114632,43621,76461,106152,62224
BYTE(18)56225,414,63260,61070,400,62223,120600,106136
BYTE(18)36002,22420,23140,402,62006,421,61230,120600
BYTE(18)106147,100634,105155,14400,104561,560,63236,114743
BYTE(18)400,76223,42222,104542,113040,20420,107573,62560
BYTE(18)60611,1400,107120,401,62223,104542,404,70013
BYTE(18)64214,57231,60610,117550,144620,2611,572,77236
BYTE(18)104620,2615,572,77236,104620,106627,653,77236
BYTE(18)74611,113545,43220,76607,43227,62600,160616,2605
BYTE(18)435,63235,110635,2656,404,70013,456,62671
BYTE(18)43231,601,60367,105653,405,60367,111545,620
BYTE(18)60367,105653,114567,401,62711,110545,2663,407
BYTE(18)70013,62607,110545,2677,410,70013,477,62667
BYTE(18)63271,404,70013,700,60667,62711,110545,2701
BYTE(18)110545,2703,110545,2717,74611,1400,106710,110545
BYTE(18)40367,111545,404,70013,420,62711,110545,2721
BYTE(18)100572,2727,107324,114555,60611,102172,104756,437
BYTE(18)63236,114627,105334,104737,60611,103172,110545,405
BYTE(18)70013,2743,100572,107356,114557,120600,106345,100572
BYTE(18)3002,42722,706,63236,416,110722,2633,60611
BYTE(18)107364,400,63235,110635,417,70013,57224,57223
BYTE(18)57222,57221,57220,76604,76603,76602,76601,76600
BYTE(18)60531,114762,120440,1400,112414,454,70013,43220
BYTE(18)423,62700,601,110420,417,63235,114571,605
BYTE(18)63222,426,63223,426,63235,110663,417,70006
BYTE(18)2602,120560,1400,107005,100556,100572,114567,104732
BYTE(18)60611,1400,113051,400,62222,2003,757,62660
BYTE(18)104542,626,76222,401,76223,43221,62561,105142
BYTE(18)451,70013,110446,105124,20420,113533,60600,112522
BYTE(18)473,63235,110731,774,23140,62266,451,70013
BYTE(18)43620,61620,107115,112127,100634,112541,2400,451
BYTE(18)70013,40620,1400,107107,3000,410,60671,62302
BYTE(18)621,104546,402,62223,652,63236,114645,454
BYTE(18)70013,2423,100634,422,63223,473,63235,601
BYTE(18)110734,62560,404,62223,104542,430,70013,43622
BYTE(18)1400,113160,435,63235,571,63236,414,110722
BYTE(18)563,63236,114631,111204,43622,112167,110577,572
BYTE(18)63236,114615,60562,62226,14621,42222,61230,545
BYTE(18)63235,120600,112201,110714,40620,112213,14000,14776
BYTE(18)76662,62607,110627,616,63236,114615,74607,62223
BYTE(18)42222,60602,112225,421,110626,621,61230,426
BYTE(18)70013,745,63236,401,114741,426,70013,43622
BYTE(18)112242,110654,645,63236,114615,74562,62226,42222
BYTE(18)621,61230,120600,112252,420,63223,604,63222
BYTE(18)411,60413,63226,70206,56226,56227,123220,501
BYTE(18)63260,43221,414,60661,61311,406,70006,57220
BYTE(18)43221,413,70006,56342,54441,76223,651,77236
BYTE(18)40620,1400,117245,110740,400,63223,604,63222
BYTE(18)411,110736,63223,3400,63221,63224,601,63222
BYTE(18)110746,400,63223,600,63222,432,60413,63226
BYTE(18)416,63236,70206,57220,57221,43224,10376,4003
BYTE(18)50220,76612,76600,76601,62603,60602,112361,2400
BYTE(18)110763,400,63223,77124,63124,63124,63524,76703
BYTE(18)76602,10376,57220,40620,115410,60360,115412,10376
BYTE(18)767,60360,115406,406,62400,174616,2517,174616
BYTE(18)62600,110777,70200,3200,42700,174616,417,70006
BYTE(18)64214,43620,117430,70206,432,63236,406,114741
BYTE(18)60520,117435,737,62660,170615,677,62660,403
BYTE(18)70006,57220,57221,57222,70206,76600,76601,62602
BYTE(18)70206,56224,56225,401,63220,55310,120600,116056
BYTE(18)37004,37025,465,63236,114721,37002,23023,36400
BYTE(18)36420,76604,76605,476,63236,114721,23020,36420
BYTE(18)76602,76603,76604,76605,43222,540,60662,62700
BYTE(18)411,60413,60366,115543,74564,116126,62224,60605
BYTE(18)62225,414,63260,61070,120600,116124,36420,16407
BYTE(18)60617,1400,116542,2400,404,63717,62222,542
BYTE(18)63236,114672,170615,754,43220,63260,62460,170615
BYTE(18)117157,60530,117561,406,114562,410,114562,412
BYTE(18)114562,424,63223,436,63235,605,110657,435
BYTE(18)63235,64214,757,63677,62222,600,63236,114672
BYTE(18)420,63717,62222,621,61230,54620,2633,1400
BYTE(18)117212,2605,120600,116212,170615,56226,56227,123220
BYTE(18)501,63260,414,63221,40661,61311,170616,407
BYTE(18)114632,424,70013,43221,76561,115640,14000,170616
BYTE(18)43221,76561,170616,3221,114647,402,3021,23140
BYTE(18)62006,23160,62107,115255,114662,123220,404,63000
BYTE(18)515,61271,123200,555,60660,60701,61230,120600
BYTE(18)116267,160616,402,70013,56226,56227,123220,501
BYTE(18)63260,414,61311,621,61230,114733,100572,460
BYTE(18)73013,60013,115315,64214,100414,67114,400,73233
BYTE(18)100414,402,23100,62004,23120,62105,123200,115336
BYTE(18)416,63260,61070,120600,116333,174616,404,63000
BYTE(18)114730,63220,56400,43220,76500,115347,164616,43220
BYTE(18)404,62400,164616,500,61271,761,63236,420
BYTE(18)110722,100434,117567,100572,0,0,0,0
BYTE(18)0,0,0,0,0,0,0,0
COMIOE: ;END OF COMIOP CODE
SUBTTL BOOT JSYS -- PERFORM BOOTSTRAP FUNCTIONS FOR KMC11
;BOOT JSYS IS USED TO LOAD AND DUMP KMC11
; CALL MOVEI AC1,<FUNCTION CODE>
; MOVEI AC2,<ADR OF ARGUMENT BLOCK>
; BOOT
;
;REG STRING IS BSEL0,BSEL2,BSEL4,BSEL6,MISC+NPR,INDATA,OUTDATA,INBA,OUTBA
; TABLE OF DISPATCH ADDRESSES
BOOTTB: EXP BTERR ;(0) = ACTIVATE ROM
EXP BTSMP ;(1) = SEND MOP MESSAGE
EXP BTERR ;(2) = LOAD MEMORY
EXP BTERR ;(3) = DUMP MEMORY
EXP BTIPR ;(4) = INITIALIZE PROTOCOL
EXP BTTPR ;(5) = TERMINATE PROTOCOL
EXP BTSTS ;(6) = RETURN STATUS
EXP BTERR ;(7) = WAIT FOR TO-10 DOORBELL
EXP BTRMP ;(10) = READ MOP MESSAGE
EXP BTKML ;(11) = LOAD KMC11
EXP BTKMD ;(12) = DUMP KMC11
EXP BTRLC ;(13) = RETURN LINE COUNTS
EXP BTCLI ;(14) = CONVERT LINE-ID TO PORT NUMBER
EXP BTCPN ;(15) = CONVERT PORT NUMBER TO LINE-ID
BOOTLN==.-BOOTTB
;HERE ON A BOOT JSYS
.BOOT:: MCENT ;MONITOR CONTEXT ENTRY
MOVE T1,CAPENB ;GET ENABLED CAPABILITIES
TXNN T1,SC%WHL!SC%OPR!SC%MNT ;WHEEL, OPERATOR, OR MAINTENANCE ?
ITERR (CAPX2) ;WHEEL, OPERATOR, or MAINTENANCE capability required
UMOVE Q3,1 ;GET FUNCTION CODE FROM USER
CAIL Q3,.BTROM ;CHECK RANGE OF GIVEN
CAIL Q3,.BTROM+BOOTLN ; FUNCTION CODE
BTERR: ITERR (ARGX02) ;Invalid function
; VALIDATE KMC11 ADDRESS
UMOVE Q1,2 ;GET ADDRESS OF USER'S ARGUMENT BLOCK
; DISPATCH TO PROCESSING ROUTINE BASED ON REQUESTED FUNCTION
CALL @BOOTTB-.BTROM(Q3) ;DISPATCH TO APPROPRIATE ROUTINE
ITERR () ;FAILED, RETURN ERROR TO USER
MRETNG ;SUCCESS, RETURN TO USER
;HERE TO GET KMC11 ADDRESS FROM ARGUMENT BLOCK
BTGKMA: UMOVE Q2,.BTKMC(Q1) ;GET KMC11 ADDRESS FROM USER
TRNE Q2,7 ;BE SURE FIRST KMC11 ADR
JRST BTDVX5 ;GIVE USER ERROR
MOVE T1,Q2 ;COPY KMC11 ADR FOR UBGOOD
LDB T2,[POINT 9,T1,22] ;GET UBA NUMBER & 5 BITS OF UNIBUS ADR
CAIE T2,77 ;1,,76#### ?
CAIN T2,177 ;OR 3,,76#### ?
CALL UBGOOD ;SEE IF THAT ADDRESS EXISTS
BTDVX5: ITERR (DEVX5) ;No such device
RET
;HERE TO GET A PORT NUMBER ARGUMENT
; RETURN: P1/ LINES PAGE
; T4/ DUP11 HDW ADR
BTGPRT: UMOVE P1,.BTPRT(Q1) ;GET PORT NUMBER FROM ARGUMENT BLOCK
HRRZ T4,P1 ;COPY ONLY PORT NUMBER
CAML T4,DUPNLN ;IS ARGUMENT IN RANGE ?
ITERR (ARGX19) ;Invalid unit number
LSH T4,3 ; *10
ADD T4,[DUPADR] ;MAKES THIS DUP11'S ADR
HRR P1,DUPPAG(P1) ;GET ADR OF LINES PAGE
RET
SUBTTL BOOT JSYS -- SEND MOP MESSAGE
BTSMP: CALL BTGPRT ;GET PORT NUMBER
RETSKP
SUBTTL BOOT JSYS -- INITIATE PROTOCOL
BTIPR: CALL BTGPRT ;GET PORT NUMBER
MOVE T1,[EXP KMCADR] ;GET ADDRESS OF KMC11
RDIO T1,(T1) ;GET STATUS FROM KMC11
TRNN T1,KMCRUN ;IS KMC11 RUNNING ?
RETBAD (KDPX01) ;KMC11 not running
LOAD T1,DDSTA ;GET CURRENT LINE STATE
UMOVE T2,.BTPRV(Q1) ;GET PROTOCOL VERSION NUMBER
RDIO T3,DPTCSR(T4) ;GET CURRENT MAINTENANCE MODE BITS
ANDI T3,DPMAIN ;LEAVE ONLY THE MAINTAINENCE MODE BITS
CAIN T2,.VNDDC ;STARTING DDCMP ?
JRST BTIDDC ;STARTING DDCMP
CAIN T2,.VNCNL ;INITIATING CONTROLLER LOOPBACK ?
JRST BTICNL ;YES
CAIN T2,.VNCBL ;INITIATING CABLE LOOPBACK ?
JRST BTICBL ;YES
CAIE T2,.VNMOP ;STARTING DDCMP MAINTENANCE MODE ?
JRST BTERR ;CAN'T DO THAT
;HERE TO INITIATE MAINTENANCE MODE ON LINE
BTIMOP: MOVEI T1,DPMAIN ;DUP11 MAINTENANCE MODE BITS
BCIO T1,DPTCSR(T4) ;CLEAR MAINTENANCE MODE
MOVEI T1,STAMAI ;NOW AM IN MAINTENANCE MODE
CALL DEDLIN ;DROP LINE
RETSKP
;HERE TO INITIATE DDCMP ON LINE
BTIDDC: CAIE T1,STADWN ;IS THE LINE DOWN ?
CAIN T1,STAMAI ;OR IS LINE IN MOP MODE ?
JRST BTIDC4 ;GO TRY TO DDCMP START IT
JUMPN T3,BTERR ;IF HDW LOOPED BACK LOSE
RETSKP ;ALREADY RUNNING SO WIN
BTIDC4: MOVEI T1,DPMAIN ;DUP11 MAINTENANCE MODE BITS
BCIO T1,DPTCSR(T4) ;CLEAR MAINTENANCE MODE
BTIDC6: MOVEI T1,STASTR ;NOW WANT TO SEND STARTS
CALL DEDLIN ;DROP LINE
RETSKP
;HERE TO INITIATE CONTROLLER LOOPBACK
BTICNL: MOVEI T2,DPCNLP ;BIT FOR CONTROLLER LOOPBACK
JRST BTILPB ;SET LOOPBACK
;HERE TO INITIATE CABLE LOOPBACK
BTICBL: MOVEI T2,DPCBLP ;BIT FOR FOR CABLE LOOPBACK
BTILPB: CAIE T1,STADWN ;IS THE LINE DOWN ?
CAIN T1,STAMAI ;OR IS LINE IN MOP MODE ?
JRST BTILP4
CAMN T1,T3 ;ALREADY THIS WAY ?
RETSKP ;ALREADY LOOPED BACK
JRST BTERR ;LOSE
BTILP4: MOVEI T1,DPMAIN ;MAINTAINENCE MODE BITS
BCIO T1,DPTCSR(T4) ;CLEAR BITS
BSIO T2,DPTCSR(T4) ;SET NEW FORM OF MAINTAINENCE MODE
JRST BTIDC6 ;NOW TURN ON THE LINE
SUBTTL BOOT JSYS -- TERMINATE PROTOCOL
BTTPR: CALL BTGPRT ;GET PORT NUMBER
MOVEI T1,DPMAIN ;MAINTAINENCE MODE BITS
BCIO T1,DPTCSR(T4) ;CLEAR MAINTAINENCE MODE BITS
NOINT
MOVEI T1,STADWN ;CODE FOR STOPPED
CALL DEDLIN ;CLEAN UP LINE
OKINT
RETSKP
SUBTTL BOOT JSYS -- RETURN PROTOCOL STATUS
BTSTS: CALL BTGPRT ;GET PORT NUMBER
LOAD T1,DDSTA ;GET LINE STATE
MOVEI T3,.VNMOP ;CALL IT MOP MODE
CAIN T1,STAMAI ;MAINTENANCE MODE ?
JRST BTSTS9 ;LINE IS IN MAINTAINENCE MODE
SETOM T3 ;ASSUME NOT RUNNING
CAIN T1,STADWN ;IS THE LINE STOPPED
JRST BTSTS9 ;LINE IS DOWN
MOVEI T3,.VNDDC ;ASSUME RUNNING DDCMP
RDIO T2,DPTCSR(T4) ;GET MAINTAINENCE MODE STATUS
ANDI T2,DPMAIN ;STRIP EXTRA BITS
JUMPE T2,BTSTS9 ;IF NOT MAINTAINENCE THEN RUNNING
SETOM T3 ;IN CASE INTERNAL MAINTENANCE MODE
CAIN T2,DPCNLP ;CONTROLLER LOOPBACK ?
MOVEI T3,.VNCNL ;YES
CAIN T2,DPCBLP ;CABLE LOOPBACK ?
MOVEI T3,.VNCBL ;YES
BTSTS9: UMOVEM T3,.BTPRV(Q1) ;GIVE STATE TO USER
RETSKP
SUBTTL BOOT JSYS -- RECEIVE MOP MESSAGE
BTRMP: CALL BTGPRT ;GET PORT NUMBER
RETSKP
SUBTTL BOOT JSYS -- LOAD KMC11
BTKML: CALL BTGKMA ;GET KMC11 ADR FROM ARGUMENT BLOCK
CALL BTSTOP ;STOP THE KMC11 IF RUNNING
MOVEI T1,KMCMCL ;TO CLEAR THE KMC11
WRIO T1,BSEL0(Q2) ;RESET THE KMC11
;QUICK CHECK OF KMC11 INTEGRITY
MOVEI T2,200 ;BIT PATERN FOR FIRST REGISTER
MOVE T4,Q2 ;COPY KMC11 ADR
BTCHK0: WRIO T2,@T4 ;WRITE THE REGISTER
RDIO T1,@T4 ;THEN READ IT BACK
CAME T2,T1 ;DO THE BITS MATCH ?
JRST [ TXO T1,BT%RVE ;REGISTER VERIFY ERROR
JRST KMCILL ] ;REPORT PROBLEM THEN QUIT,Q2
JUMPE T2,BTCHK2 ;DONE WITH REGISTER
LSH T2,-1 ;NEXT MASK TO TRY
JRST BTCHK0 ;TRY NEXT MASK
BTCHK2: MOVEI T2,100000 ;BIT PATERN FOR NEXT BSEL
ADDI T4,2 ;NEXT BSEL
TRNE T4,7 ;DONE ALL REGS YET ?
JRST BTCHK0 ;LOOP BACK FOR REST OF REGISTERS
;VERIFY DRAM IS OK
CALL MARCLR ;INITIALIZE THE MAR
MOVEI T4,DRAMSZ ;SIZE OF THE DRAM
MOVEI T1,041222 ;MOVE <MEM><BSEL2>
CALL KMCXCT ;READ DRAM (TO RESTORE LATER)
RDIO Q3,BSEL2(Q2) ;GET OLD CONTENTS
BTCKD0: MOVEI T3,200 ;PATERN FOR DRAM
BTCKD1: WRIO T3,BSEL2(Q2) ;SO WE WRITE INTO DRAM
MOVEI T1,122440 ;MOVE <BSEL2><MEM>
CALL KMCXCT ;WRITE DRAM
SETZ T2,
WRIO T2,BSEL2(Q2) ;CLEAR BSEL2
MOVEI T1,041222 ;MOVE <MEM><BSEL2>
CALL KMCXCT
RDIO T1,BSEL2(Q2) ;READ MEMORY
CAME T1,T3 ;RIGHT DATA ?
JRST [ TXO T1,BT%DVE ;DRAM VERIFY ERROR
JRST KMCILL ] ;REPORT ERROR THEN QUIT
JUMPE T3,BTCKD2
LSH T3,-1 ;NEXT PATERN FOR DRAM
JRST BTCKD1 ;TRY THAT ONE
BTCKD2: WRIO Q3,BSEL2(Q2) ;OLD CONTENTS OF DRAM
MOVEI T1,136440 ;MOVE <BSEL2><MEM><MARINC>
CALL KMCXCT ;RESTORE DRAM LOCATION
SOJG T4,BTCKD0 ;ON TO NEXT DRAM LOCATION
;HERE TO LOAD THE CRAM
BTKLC0: UMOVE T4,.BTKCC(Q1) ;GET COUNT FOR CRAM BYTES
UMOVE Q3,.BTKCP(Q1) ;GET POINTER FOR CRAM BYTES
JUMPLE T4,BTKLC9 ;IN CASE NOT LOADING CRAM
SETZ T3, ;FIRST ADDRESS TO LOAD
BTKLC2: WRIO T3,BSEL4(Q2) ;PUT ADR IN REGISTER
AOS T3 ;NEXT CRAM ADR
XCTBU [ILDB T1,Q3] ;GET NEXT BYTE FOR CRAM
WRIO T1,BSEL6(Q2) ;PUT DATA IN RIGHT PLACE
MOVEI T1,KMCRMO ;SELECT ROM OUTPUT
WRIO T1,BSEL0(Q2) ;SET IT
MOVEI T1,KMCRMO!KMCCWR ;NOW DO CRAM WRITE
WRIO T1,BSEL0(Q2)
SETZ T1,
WRIO T1,BSEL0(Q2) ;CLEAR UP THE KMC11
SOJG T4,BTKLC2 ;ON FOR REST OF DATA
;NOW VERIFY CRAM LOAD
UMOVE T4,.BTKCC(Q1) ;GET COUNT FOR CRAM BYTES
UMOVE Q3,.BTKCP(Q1) ;GET POINTER FOR CRAM BYTES
SETZ T3, ;FIRST ADR TO VERIFY
BTKLC4: WRIO T3,BSEL4(Q2) ;PUT ADR IN KMC11
MOVEI T1,KMCRMO ;FLAG FOR ROM OUTPUT
WRIO T1,BSEL0(Q2) ;TELL IT TO READ CRAM
RDIO T1,BSEL6(Q2) ;GET CRAM DATA
XCTBU [ILDB T2,Q3] ;GET NEXT BYTE FROM USER
UMOVEM Q3,.BTKCP(Q1) ;SAVE UPDATED CRAM POINTER
CAME T1,T2 ;IS CRAM RIGHT ?
JRST [ TXO T1,BT%CVE ;FLAG FOR CRAM VERIFY ERROR
JRST KMCILL ] ;REPORT ERROR THEN QUIT
AOS T3 ;NEXT CRAM ADR
SOJG T4,BTKLC4 ;ON TO NEXT CRAM LOCATION
BTKLC9: UMOVEM T4,.BTKCC(Q1) ;SAVE UPDATED COUNT
;HERE TO LOAD THE DRAM
BTKLD0: UMOVE T4,.BTKDC(Q1) ;GET COUNT FOR DRAM BYTES
UMOVE Q3,.BTKDP(Q1) ;GET POINTER FOR DRAM BYTES
JUMPLE T4,BTKLD9 ;IN CASE NOT LOADING DRAM
CALL MARCLR ;INITIALIZE THE MAR
MOVEI T1,136440 ;MOVE <BSEL2><MEM><MARINC>
BTKLD2: XCTBU [ILDB T2,Q3] ;GIVE NEXT BYTE TO USER
WRIO T2,BSEL2(Q2) ;PUT DATA IN BSEL2 FOR KMC11
CALL KMCXCT ;HAVE KMC11 PUT DATA INTO MEM
SOJG T4,BTKLD2 ;COUNT BYTE AND THEN DO NEXT
UMOVE T4,.BTKDC(Q1) ;GET COUNT FOR DRAM BYTES
UMOVE Q3,.BTKDP(Q1) ;GET POINTER FOR DRAM BYTES
CALL MARCLR ;INITIALIZE THE MAR
MOVEI T1,055222 ;MOVE <MEM><BSEL2><MARINC>
BTKLD4: CALL KMCXCT ;GET NEXT BYTE FROM DRAM
RDIO T2,BSEL2(Q2) ;GET DATA
XCTBU [ILDB T3,Q3] ;GET WHAT USER WANTED
UMOVEM Q3,.BTKDP(Q1) ;SAVE UPDATED DRAM POINTER
CAME T2,T3 ;DO THEY MATCH ?
JRST [ TXO T2,BT%DVE ;DRAM VERIFY ERROR
MOVE T1,T2 ;PUT IN RIGHT REGISTER
JRST KMCILL ] ;DONE WITH JSYS
SOJG T4,BTKLD4 ;LOOP BACK FOR REST OF VERIFY
BTKLD9: UMOVEM T4,.BTKDC(Q1) ;SAVE UPDATED DRAM COUNT
;HERE TO LOAD THE REGISTERS
MOVEI T1,KMCMCL ;DO A MASTER CLEAR AGAIN
WRIO T1,BSEL0(Q2)
SETZ T1, ;TO FINISH IT
WRIO T1,BSEL0(Q2)
WRIO T1,BSEL2(Q2) ;CLEAR BSEL2
WRIO T1,BSEL4(Q2) ;CLEAR BSEL4
WRIO T1,BSEL6(Q2) ;CLEAR BSEL6
UMOVE T1,.BTKSA(Q1) ;GET STARTING ADDRESS
SETZ T3, ;DEFAULT IS DON'T START
JUMPGE T1,BTKLR0 ;IN CASE NO STARTING ADDRESS
TRO T3,KMCRUN ;IF GAVE A STARTING ADR ASSUME WANTS TO RUN
LSHC T1,-^D8 ;LEAVE ONLY BRANCH ADR BITS 9,8
ANDI T1,3 ;STRIP ANY EXTRANEOUS BITS
LSH T1,^D3
LSHC T1,^D8
IORI T1,100400 ;MAKES AN UNCONDITIONAL BRANCH
CALL KMCXCT ;EXECUTE THE BRANCH
BTKLR0: UMOVE T4,.BTKRC(Q1) ;GET COUNT FOR REGISTER BYTES
UMOVE Q3,.BTKRP(Q1) ;GET POINTER FOR REGISTER BYTES
JUMPLE T4,BTKLR9 ;IN CASE NOT LOADING REGISTER
XCTBU [ILDB T1,Q3] ;GET CONTENTS FOR BSEL0
IOR T3,T1 ;INCLUDE WITH RUN BIT
MOVE T2,Q2 ;COPY KMC11 ADR
JRST BTKLR4
BTKLR2: XCTBU [ILDB T1,Q3] ;GET NEXT BYTE FROM USER
WRIO T1,(T2) ;LOAD REGISTER
BTKLR4: ADDI T2,2 ;READY FOR NEXT REGISTER
TRNE T2,7 ;LOADED ALL FOUR ?
SOJG T4,BTKLR2 ;ON TO NEXT
BTKLR9: WRIO T3,BSEL0(Q2) ;NOW SET BSEL0 (I.E. RUN FLOP)
UMOVEM T4,.BTKRC(Q1) ;SAVE UPDATED REGISTER COUNT
UMOVEM Q3,.BTKRP(Q1) ;SAVE UPDATED REGISTER POINTER
CAMN Q2,[KMCADR] ;IS THIS OUR KMC11 ?
CALL COMINI ;INITIALIZE THE COMIOP
RETSKP
KMCILL: MOVEM T1,.BTKER(Q1) ;GIVE USER ERROR CODE
BUG (INFO,KMCBRK,<KMC11 broken>,Q2)
MOVEI T1,IOX5 ;Device or data error
RET ;REPORT PROBLEM THEN QUIT
;HERE TO INITIALIZE THE COMIOP
COMINI: SKIPL P1,DUPLIM ;GET NUMBER OF DUP11'S
RET ;NONE SO DONE
MOVEI T1,KMCINQ+3 ;START PUTTING ENTRIES HERE
MOVEM T1,KMCINQ ;INITIALIZE THE PUTTER
MOVEM T1,KMCINQ+1 ;INITIALIZE THE TAKER
KMBT.8: HRR P1,DUPPAG(P1) ;GET ADR OF LINES PAGE
SETZM PGXBD1(P1) ;FIRST TRANSMIT BUFFER IS FREE
SETZM PGXBD2(P1) ;SECOND TRANSMIT BUFFER IS FREE
SETZM PGRBD1(P1) ;FIRST RECEIVE BUFFER IS FREE
SETZM PGRBD2(P1) ;SECOND RECEIVE BUFFER IS FREE
IFN FTRACE,<
MOVEI T1,PGTRCE(P1) ;GET ADR OF TRACE
MOVEM T1,PGTPTR(P1) ;SAVE PUTTER
>;IFN FTRACE
MOVEI T1,STASTR ;TRYING TO START LINE
STOR T1,DDSTA ;REMEMBER NEW STATE
MOVEI T1,1 ;QUICK TIMER
STOR T1,DDTIM ;SO WE SEND A START SOON
HRRZ T2,PGDUPN(P1) ;GET LINE NUMBER
LSH T2,3 ;MULTIPLY BY 8
ADD T2,[DUPADR] ;MAKES THIS LINES ADR
SETZ T1,
WRIO T1,(T2) ;CLEAR FIRST DUP11 REGISTER
WRIO T1,2(T2) ;CLEAR 2ND DUP11 REGISTER
WRIO T1,4(T2) ;CLEAR 3RD DUP11 REGISTER
WRIO T1,6(T2) ;CLEAR 4TH DUP11 REGISTER
HRRZ T1,PGDUPN(P1) ;THIS IS LINE NUMBER
LSH T1,^D8 ;POSITION FOR LH UNIBUS BYTE
IORI T1,BASEIN ;COMMAND TYPE
ANDI T2,CSRMSK ;STRIP EXTRA BITS
CALL KMCINP ;GIVE MSG TO KMC11
HRRZ T1,PGDUPN(P1) ;LINE NUMBER
LSH T1,^D8 ;POSITION FOR LH UNIBUS BYTE
IORI T1,CNTLIN ;WILL BE A CONTROL IN MESSAGE
MOVEI T2,CDDCMP!CENABL ;DDCMP AND ENABLE LINE
CALL KMCINP ;GIVE MSG TO KMC11
MOVEI T3,PGRBD1(P1) ;FIRST RECEIVER BUFFER
CALL RCVENB ;START THE RECEIVER ... BUFFER 1
MOVEI T3,PGRBD2(P1) ;2ND RECEIVER BUFFER
CALL RCVENB ;START THE RECEIVER ... BUFFER 2
HRR P1,PGDUPN(P1) ;GET LINE NUMBER AGAIN
AOBJN P1,KMBT.8 ;LOOP BACK FOR REST OF DUP11 LINES
RET
SUBTTL BOOT JSYS -- DUMP THE KMC11
BTKMD: CALL BTGKMA ;GET KMC11 ADR FROM ARGUMENT BLOCK
UMOVE T4,.BTKRC(Q1) ;GET COUNT FOR SAVING REGISTERS
UMOVE Q3,.BTKRP(Q1) ;POINTER FOR STORING REGISTERS
JUMPLE T4,BTKDR9 ;IN CASE DOESN'T WANT REGISTERS
MOVE T3,Q2 ;COPY KMC11 ADR
BTKDR2: RDIO T1,(T3) ;GET DATA FROM BSEL#
XCTBU [IDPB T1,Q3] ;SAVE NEXT BYTE FOR USER
SOJLE T4,BTKDR9 ;IF NO ROOM DONE
ADDI T3,2 ;ON TO NEXT REGISTER
TRNE T3,7 ;DONE ALL FOUR ?
JRST BTKDR2 ;ON FOR NEXT
CALL BTSTOP ;STOP THE KMC11 IF RUNNING
MOVEI T1,121202 ;MOVE <NPR>,<BSEL2>
CALL BTKDR6
MOVEI T1,021002 ;MOVE <IBUS 0>,<BSEL2>
CALL BTKDR6
CALL BTKDR6
CALL BTKDR6
CALL BTKDR6
BTKDR9: CALL BTSTOP ;STOP THE KMC11 IF RUNNING
UMOVEM T4,.BTKRC(Q1) ;SAVE UPDATED REG COUNTER
UMOVEM Q3,.BTKRP(Q1) ;SAVE UPDATED POINTER
;HERE TO DUMP THE KMC11 CRAM
BTKDC0: UMOVE T4,.BTKCC(Q1) ;GET COUNTER FOR CRAM DATA
UMOVE Q3,.BTKCP(Q1) ;GET POINTER FOR CRAM DATA
JUMPLE T4,BTKDC9 ;IN CASE DOESN'T WANT TO DUMP CRAM
SETZ T2, ;CRAM ADR TO DUMP NEXT
BTKDC2: WRIO T2,BSEL4(Q2) ;SELECT ADR TO DUMP
MOVEI T1,KMCRMO ;FLAG TO DUMP CRAM
WRIO T1,BSEL0(Q2) ;TELL IT TO DUMP CRAM
RDIO T1,BSEL6(Q2) ;GET LOCATION FROM CRAM
XCTBU [IDPB T1,Q3] ;PUT BYTE IN USER CORE
SOJLE T4,BTKDC9 ;COUNT BYTE
AOJA T2,BTKDC2 ;ON FOR NEXT BYTE
BTKDC9: UMOVEM T4,.BTKCC(Q1) ;SAVE UPDATED CRAM COUNTER
UMOVEM Q3,.BTKCP(Q1) ;SAVE UPDATED POINTER
;HERE TO DUMP THE KMC11 DRAM
BTKDD0: UMOVE T4,.BTKDC(Q1) ;GET COUNTER FOR DRAM DATA
UMOVE Q3,.BTKDP(Q1) ;GET POINTER FOR DRAM DATA
JUMPLE T4,BTKDD9 ;IN CASE DOESN'T WANT TO DUMP THE DRAM
CALL MARCLR ;INITIALIZE THE MAR
BTKDD2: MOVEI T1,055222 ;MOVE <MEM>,<BSEL2>,<MARINC>
CALL KMCXCT ;GET NEXT DRAM BYTE
RDIO T2,BSEL2(Q2) ;GET BYTE WE JUST PUT IN BSEL2
XCTBU [IDPB T2,Q3] ;GIVE BYTE TO USER
SOJG T4,BTKDD2 ;ON FOR NEXT BYTE
BTKDD9: UMOVEM T4,.BTKDC(Q1) ;SAVE UPDATED DRAM COUNTER
UMOVEM Q3,.BTKDP(Q1) ;SAVE UPDATED DRAM POINTER
RETSKP
;HERE TO FORCE KMC11 TO GIVE US INTERNAL INFORMATION
BTKDR6: JUMPLE T4,R ;IN CASE COUNT ALREADY EXHAUSTED
CALL KMCXCT ;XCT FIRST INSTRUCTION
ADDI T1,21 ;NEXT SOURCE & DEST
CALL KMCXCT ;EXECUTE NEXT INSTRUCTION
ADDI T1,17 ;INCREMENT SOURCE,DECREMENT DESTINATION
RDIO T2,BSEL2(Q2) ;GET DATA WE JUST FORCED TO BSEL2 & BSEL3
XCTBU [IDPB T2,Q3] ;SAVE THIS REGISTER
SOJA T4,R ;COUNT BYTE GIVEN TO USER
;HERE TO CLEAR THE MAR
MARCLR: MOVEI T1,004000 ;CLEAR MAR LOW
CALL KMCXCT ;DO IT
MOVEI T1,010000 ;CLEAR MAR HI
;CALL KMCXCT ;DO IT
;RET
;HERE TO EXECUTE A KMC11 INSTRUCTION
; CALL WITH KMC11 INSTRUCTION IN T1
KMCXCT: MOVEI T2,KMCRMI
WRIO T2,BSEL0(Q2) ;PUT BSEL1 IN KNOWN STATE
WRIO T1,BSEL6(Q2) ;LOAD BSEL6 & BSEL7
MOVEI T2,KMCRMI!KMCSUP
WRIO T2,BSEL0(Q2) ;DO ONE INSTRUCTION
SETZ T2, ;TO CLEAN UP BSEL0
WRIO T2,BSEL0(Q2) ;CLEAN OUT BSEL0
RET
;HERE TO STOP THE KMC11 AS PART OF BOOT JSYS
BTSTOP: NOINT ;PREVENT INTERRUPTS
CAMN Q2,[KMCADR] ;IS THIS OUR KMC11 ?
CALL KMCHLT