Trailing-Edge
-
PDP-10 Archives
-
AP-4178E-RM
-
swskit-sources/dtesrv.mac
There are 49 other files named dtesrv.mac in the archive. Click here to see a list.
;<3A.MONITOR>DTESRV.MAC.24, 16-Aug-78 18:41:00, EDIT BY MILLER
;FIX PROTOCOL PAUSE ROUTINES NOT TO GET CONFUSED IF IN SECONDARY PROTOCOL
;<4.MONITOR>DTESRV.MAC.4, 18-Jul-78 08:46:20, EDIT BY MILLER
;MORE OF "CONTINUED" CHANGES
;<4.MONITOR>DTESRV.MAC.3, 17-Jul-78 08:55:20, EDIT BY MILLER
;SUPPRESS "CONTINUED" MESSAGE ON PROTOCOL PAUSE
;<3A.MONITOR>DTESRV.MAC.22, 12-Jun-78 09:54:34, EDIT BY MILLER
;FIX UP DTSNGL SO IT CAN ALWAYS GO TO DTEQ
;<3A.MONITOR>DTESRV.MAC.21, 6-Jun-78 11:54:20, EDIT BY MILLER
;FIX UP DTPAUS AND DTEACT TO CLEAR VALID EX IN EPT
;<3A.MONITOR>DTESRV.MAC.20, 22-May-78 07:58:53, EDIT BY MILLER
;REMOVE "REPEAT 0" FROM DTPAUS. CODE NOW IMPLEMENTS NEW PROTOCOL STATE
;<3A.MONITOR>DTESRV.MAC.19, 5-May-78 13:29:03, Edit by PORCHER
;RESET DTE PI 0 ENABLE ON ERRORS DURING ROMGNK
;<3A.MONITOR>DTESRV.MAC.18, 18-Apr-78 11:32:41, Edit by KIRSCHEN
;RETURN CORRECT ERROR CODE FRM RMGRNK IF NO SUCH DTE
;<3A.MONITOR>DTESRV.MAC.17, 14-Apr-78 10:14:13, EDIT BY MILLER
;CHANGE DTINIT ROUTINES TO READ MS CLOCK AND NOT RELY ON TODCLK
;<3A.MONITOR>DTESRV.MAC.16, 24-Mar-78 14:30:59, EDIT BY MILLER
;DTSNGL MUST USE MSTRDT FOR THE DTE NUMBER
;<3A.MONITOR>DTESRV.MAC.15, 23-Mar-78 10:44:52, EDIT BY MILLER
;REMOVE DTEBFF REFERENCE
;<3A.MONITOR>DTESRV.MAC.14, 23-Mar-78 09:27:14, EDIT BY MILLER
;MAKE ANY DTE ABLE TO DO RSX20F PROTOCOL
;<3A.MONITOR>DTESRV.MAC.13, 15-Mar-78 09:37:10, EDIT BY MILLER
;CHECK FOR OUTPUT BUFFER ALREADY EMPTY IN DTEPOL
;<3A.MONITOR>DTESRV.MAC.12, 13-Feb-78 08:48:43, EDIT BY MILLER
;ADD DTPAUS.
;<3A.MONITOR>DTESRV.MAC.11, 5-Feb-78 14:24:13, EDIT BY MILLER
;ADD NEW ROUTINE TO REACITVATE DTES. CODE WAIITNG FOR FE CHANGES
;<3.SM10-RELEASE-3>DTESRV.MAC.10, 9-Jan-78 10:37:26, EDIT BY MILLER
;ADD DTEINA ROUTINE
;<3.SM10-RELEASE-3>DTESRV.MAC.9, 16-Dec-77 13:11:24, EDIT BY MILLER
;MAKE SURE DEVICE IS RESET IN RMGRNK BEFORE ACTIVATING THE ROM
;<3.SM10-RELEASE-3>DTESRV.MAC.8, 14-Dec-77 13:37:41, EDIT BY MILLER
;REARRNAGE CODE IN RELOAD
;<3.SM10-RELEASE-3>DTESRV.MAC.7, 14-Dec-77 12:57:30, EDIT BY MILLER
;FIX DTECHK TO STEP TO NEXT DTE PROPERLY
;<3.SM10-RELEASE-3>DTESRV.MAC.6, 13-Dec-77 18:26:17, EDIT BY MILLER
;CLEAR VALID EXAMINE ON DN20 STOPPED
;<3.SM10-RELEASE-3>DTESRV.MAC.5, 8-Dec-77 13:22:25, EDIT BY MILLER
;USE "MCPRON" IN PRVTAB
;<3.SM10-RELEASE-3>DTESRV.MAC.4, 6-Dec-77 11:11:22, EDIT BY MILLER
;MAKE RMGRNK ZERO THE TO -11 BYTE POINTER AFTER TO -11 TRANSFER
;<3.SM10-RELEASE-3>DTESRV.MAC.3, 5-Dec-77 12:21:36, EDIT BY MILLER
;SET UP REGS AT RQTAD1 SO MEXEC CAN BE FREE OF DTE DEPENDENT STUFF
;<3.SM10-RELEASE-3>DTESRV.MAC.2, 1-Dec-77 12:06:01, EDIT BY MILLER
;REINSTATE DTEIOP CODE
;<3.SM10-RELEASE-3>DTESRV.MAC.1, 24-Oct-77 11:12:05, EDIT BY MURPHY
;ADD SEARCH PROKL
;<3-MONITOR>DTESRV.MAC.273, 20-Oct-77 13:11:39, EDIT BY MILLER
;FIX RELODD TO GET PROPER WORDS FOR SYSERR
;<3-MONITOR>DTESRV.MAC.272, 17-Oct-77 13:55:36, EDIT BY MILLER
;CHANGE RELOAD FORK TO ALWAYS RUN OKSKED
;<3-MONITOR>DTESRV.MAC.271, 12-Oct-77 13:43:37, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-MONITOR>DTESRV.MAC.270, 7-Sep-77 08:22:07, EDIT BY MILLER
;MAKE RELAOD OF SECODNARY -11''S RUN SCHEDUABALE AND INTERRUPTABLE
;<3-MONITOR>DTESRV.MAC.269, 6-Sep-77 16:13:14, EDIT BY MILLER
;FIX UP BOOT JSYS SOME MORE
;<3-MONITOR>DTESRV.MAC.268, 6-Sep-77 11:30:46, EDIT BY MILLER
;CHANGE BOOT JSYS TO CHECK FOR ALREADY RUNNING DTE ON RELOAD REQUEST
;<3-MONITOR>DTESRV.MAC.267, 1-Sep-77 11:21:54, EDIT BY HURLEY
;MAKE RELAOD FORK AT EXTRA-HIGH PRIORITY
;<3-MONITOR>DTESRV.MAC.266, 31-Aug-77 14:50:30, EDIT BY MILLER
;INCLUDE CONI BITS ON DTEERR BUGCHK
;<3-MONITOR>DTESRV.MAC.265, 30-Aug-77 15:23:23, EDIT BY MILLER
;RELOAD -11 ON DEVICE ERROR
;<3-MONITOR>DTESRV.MAC.264, 25-Aug-77 11:05:03, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.263, 25-Aug-77 10:24:19, EDIT BY MILLER
;MORE POWER-FAIL CODE
;<3-MONITOR>DTESRV.MAC.262, 25-Aug-77 10:09:14, EDIT BY MILLER
;ADD DTEPWF ROUTINE
;<3-MONITOR>DTESRV.MAC.261, 23-Aug-77 12:45:03, Edit by MCLEAN
;FIX SO CORRECT SETSPD IS RUN
;<3-MONITOR>DTESRV.MAC.260, 19-Aug-77 13:28:05, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.259, 19-Aug-77 09:02:43, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.258, 19-Aug-77 08:55:50, EDIT BY MILLER
;TCO 1852. STORE -11 ERROR WORDS IN SYSERR BLOCK
;<3-MONITOR>DTESRV.MAC.257, 18-Aug-77 10:54:58, EDIT BY MILLER
;FIX DTREAL AND CHKDTE
;<3-MONITOR>DTESRV.MAC.256, 18-Aug-77 10:50:48, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.255, 15-Aug-77 08:33:49, EDIT BY MILLER
;MAKE DTE INT SERVICE PURE
;<3-MONITOR>DTESRV.MAC.254, 14-Aug-77 14:59:07, EDIT BY MILLER
;DON'T PRINT "CONTINED" MESSAGE UNTIL SETSPD IS FINISHED
;<3-MONITOR>DTESRV.MAC.253, 11-Aug-77 09:16:51, EDIT BY MILLER
;POLL SECONDARY FE'S EVEN IF POWER FAIL DETECTED
;<3-MONITOR>DTESRV.MAC.252, 3-Aug-77 16:51:50, EDIT BY MILLER
;CHANGE MCB INIT TIMEOUT TO 1.5 SECS
;<3-MONITOR>DTESRV.MAC.251, 29-Jul-77 11:23:26, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.250, 29-Jul-77 10:37:36, EDIT BY MILLER
;DEFINE DCNMSO
;<3-MONITOR>DTESRV.MAC.249, 28-Jul-77 08:45:07, EDIT BY MILLER
;MAKE BOOT JSYS INIT AND TERMINATE PROTOCOL CORRECTLY
;<3-MONITOR>DTESRV.MAC.248, 19-Jul-77 13:50:27, EDIT BY MILLER
;ADD CALL TO DFNDL1 IN PROINI ROUTINE
;<3-MONITOR>DTESRV.MAC.247, 19-Jul-77 08:06:07, EDIT BY MILLER
;DISABLE PARSING OF IO PAGE FAIL DUE TO UCODE BUG
;<3-MONITOR>DTESRV.MAC.246, 18-Jul-77 10:37:27, EDIT BY MILLER
;FIX DTINIT FOR RSX20F PROTOCOL
;<3-MONITOR>DTESRV.MAC.245, 12-Jul-77 12:34:46, EDIT BY MILLER
;RELOAD FE ON PROTOCOL ERRORS
;<3-MONITOR>DTESRV.MAC.244, 11-Jul-77 14:49:22, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.243, 11-Jul-77 08:18:08, EDIT BY MILLER
;CLEAR TO -11 BYTE POINTER TO MINIMIZE I/O PAGE FAIL OCCURRENCES
;<3-MONITOR>DTESRV.MAC.242, 9-Jul-77 12:58:18, EDIT BY MILLER
;MAKE SCHEDULER TURN OFF THE DTE BEFORE CALLING CLRDTE
;<3-MONITOR>DTESRV.MAC.241, 9-Jul-77 12:48:33, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.240, 9-Jul-77 11:28:29, EDIT BY MILLER
;ADD CODE TO CHECK FOR A DTE CAUSING AN I/O PAGE FAIL
;<3-MONITOR>DTESRV.MAC.239, 9-Jul-77 11:03:17, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.238, 7-Jul-77 17:58:00, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.237, 7-Jul-77 07:59:27, EDIT BY MILLER
;IF MCB SETS INI BIT, RELOAD IT
;<3-MONITOR>DTESRV.MAC.236, 1-Jul-77 14:00:22, EDIT BY MILLER
;FIX RELOAD CODE
;<3-MONITOR>DTESRV.MAC.235, 1-Jul-77 09:57:24, EDIT BY MILLER
;ISSUE A BUGINF WHENEVER A DN20 STOPS
;<3-MONITOR>DTESRV.MAC.234, 29-Jun-77 09:10:32, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.233, 29-Jun-77 08:51:51, EDIT BY MILLER
;MAKE ANY FE STOP INFORM ALL MONITOR DRIVERS
;<3-MONITOR>DTESRV.MAC.232, 28-Jun-77 15:50:45, EDIT BY MILLER
;DEFER SETTING VALID EXAMINE UNTIL READY TO DO PROTOCOL INIT
;<3-MONITOR>DTESRV.MAC.231, 27-Jun-77 10:30:58, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.230, 23-Jun-77 16:34:02, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.229, 22-Jun-77 08:04:02, EDIT BY MILLER
;FIX UP MCB DATA TRANSFERS
;<3-MONITOR>DTESRV.MAC.228, 20-Jun-77 10:18:33, EDIT BY MILLER
;STORE KLINK DATA SO IT CAN BE SENT IN WORD MODE
;<3-MONITOR>DTESRV.MAC.227, 17-Jun-77 17:02:48, EDIT BY MILLER
;CHANGE PROTOCOL INIT
;<3-MONITOR>DTESRV.MAC.226, 17-Jun-77 10:25:43, EDIT BY MILLER
;SEND KLINK DATA IN WORD MODE
;<3-MONITOR>DTESRV.MAC.225, 16-Jun-77 17:25:10, EDIT BY MILLER
;MORE FIXES TO MCB INIT
;<3-MONITOR>DTESRV.MAC.224, 16-Jun-77 17:08:33, EDIT BY MILLER
;FIX MCB PROTOCOL TRANSITION CODE
;<3-MONITOR>DTESRV.MAC.223, 15-Jun-77 10:21:29, EDIT BY MILLER
;MAKE MCB PROTOCOL CONDITIONAL ON DECNET SUPPORT IN THE MONITOR
;<3-MONITOR>DTESRV.MAC.222, 13-Jun-77 09:44:45, EDIT BY MILLER
;ADD INTERFACE TO NSPSRV
;<3-MONITOR>DTESRV.MAC.221, 10-Jun-77 09:05:11, EDIT BY MILLER
;MAKE TAKE KLINK DATA FUNCTION AN INDIRECT
;<3-MONITOR>DTESRV.MAC.220, 8-Jun-77 13:07:12, EDIT BY HURLEY
;FIX UP MCB PROTOCOL CODE
;<3-MONITOR>DTESRV.MAC.219, 27-May-77 11:35:26, EDIT BY MILLER
;REMOVE MCB CODE FOR NOW
;<3-MONITOR>DTESRV.MAC.218, 19-May-77 16:36:29, EDIT BY KIRSCHEN
;TCO 1799 - PURGE DTE BUFFER PAGE WHEN NEEDED
;<3-MONITOR>DTESRV.MAC.217, 19-May-77 09:42:20, EDIT BY MILLER
;CHANGE MCB MESSAGE DEFINITIONS
;<3-MONITOR>DTESRV.MAC.216, 12-May-77 09:32:57, EDIT BY MILLER
;CHECK FOR INCONSISTENT COUNTS ON INDIRECT PACKETS
;<3-MONITOR>DTESRV.MAC.215, 11-May-77 12:16:57, EDIT BY MILLER
;FIX TYPEO IN DTINIT
;<3-MONITOR>DTESRV.MAC.214, 10-May-77 20:16:07, EDIT BY BOSACK
;MOVE STORAGE TO STG
;<3-MONITOR>DTESRV.MAC.213, 9-May-77 10:37:30, EDIT BY MILLER
;TURN OFF DTE POLLER FOR NO
;<3-MONITOR>DTESRV.MAC.212, 5-May-77 13:58:40, EDIT BY MILLER
;TCO 1794. NEED ONLY ONE KLINIK DATA FUNCTION
;<3-MONITOR>DTESRV.MAC.211, 5-May-77 12:01:03, EDIT BY MILLER
;FIX TYPOES
;<3-MONITOR>DTESRV.MAC.210, 5-May-77 11:29:24, EDIT BY MILLER
;TCO 1794. SEND KLINIK DATA TO -11 ON RELOAD
;<3-MONITOR>DTESRV.MAC.209, 5-May-77 11:17:06, EDIT BY MILLER
;TCO 1794. SAVE KLINIK DATA WHEN SENT BY -11
;<3-MONITOR>DTESRV.MAC.208, 4-May-77 16:57:18, EDIT BY MILLER
;tco 1740. make ttspwd swappable
;<3-MONITOR>DTESRV.MAC.207, 3-May-77 16:03:05, EDIT BY MILLER
;FIX PROCESSING OF INTERRUPTS
;<3-MONITOR>DTESRV.MAC.206, 2-May-77 15:45:46, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.205, 2-May-77 08:56:56, EDIT BY MILLER
;RELEASE QUEUES AFTER REQUEST FOR RELOAD AS WELL
;<3-MONITOR>DTESRV.MAC.204, 29-Apr-77 13:57:26, EDIT BY MILLER
;RELEASE ALL QUEUE ENTRIES WHEN A SECONDARY -11 DIES
;<3-MONITOR>DTESRV.MAC.203, 26-Apr-77 18:50:49, EDIT BY HURLEY
;MAKE FE DEVICE ERRORS HAVE A LEGAL USER NUMBER IN THEM
;<3-MONITOR>DTESRV.MAC.202, 26-Apr-77 11:23:22, EDIT BY KIRSCHEN
;TURN OFF TO-20 DOORBELL AFTER FINDING IT ON IN BTBEL FUNCTION OF BOOT JSYS
;<3-MONITOR>DTESRV.MAC.201, 22-Apr-77 10:45:39, EDIT BY MILLER
;CHANGE CHKDTE TO CALL DTREAL
;<3-MONITOR>DTESRV.MAC.200, 19-Apr-77 13:27:15, EDIT BY MILLER
;ALLOW ANY DTE TO RUN RSX20F PROTOCOL
;<3-MONITOR>DTESRV.MAC.199, 4-Apr-77 10:09:11, EDIT BY KIRSCHEN
;DO NOT TRIGGER ROM ON BOOT JSYS DUMP FUNCTION (DO .BTROM FUNCTION FIRST)
;<3-MONITOR>DTESRV.MAC.198, 23-Mar-77 16:22:07, Edit by MCLEAN
;INSERT KEPALV HERE SINCE IT IS DTE20 DEPENDENT
;<3-MONITOR>DTESRV.MAC.197, 22-Mar-77 12:56:57, EDIT BY HALL
;TCO 1740 - IN DTECHK CONVERT LINE NUMBER TO DYNAMIC ADDRESS BEFORE TTCOBF
;<3-MONITOR>DTESRV.MAC.196, 16-Mar-77 14:06:32, Edit by MCLEAN
;CHANGE DTEINI TO PROINI TO INDICATE NEW USAGE AS A PROTOCOL
;INITILIZATION (SM10 USES IT FOR MULTI/TERMINAL/SINGLE TERMINAL DEFINITION)
;<3-MONITOR>DTESRV.MAC.195, 13-Mar-77 16:21:16, Edit by MCLEAN
;<3-MONITOR>DTESRV.MAC.194, 13-Mar-77 03:01:56, Edit by MCLEAN
;<3-MONITOR>DTESRV.MAC.193, 13-Mar-77 00:33:44, Edit by MCLEAN
;MOVE DTRMEN AND DTRMDS TO TTYSRV
;<3-MONITOR>DTESRV.MAC.192, 24-Feb-77 10:31:32, EDIT BY MILLER
;SET RS%SE0 WHEN ASGRES IS CALLED
;<3-MONITOR>DTESRV.MAC.191, 23-Feb-77 19:48:33, EDIT BY HALL
;TCO 1740 - CHANGE NTTYS TO NTTFE, CALL IDCTY
;<3-MONITOR>DTESRV.MAC.190, 23-Feb-77 15:36:18, EDIT BY MILLER
;ADD REST OF MCB PROTOCOL
;<3-MONITOR>DTESRV.MAC.189, 4-Feb-77 11:49:51, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.188, 3-Feb-77 15:33:01, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.187, 2-Feb-77 17:37:23, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.186, 2-Feb-77 10:23:35, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.185, 1-Feb-77 17:56:54, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.184, 1-Feb-77 17:42:34, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.183, 31-Jan-77 12:56:05, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.182, 28-Jan-77 13:23:15, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.181, 28-Jan-77 10:12:40, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.180, 28-Jan-77 10:01:25, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.179, 27-Jan-77 18:13:11, EDIT BY MILLER
;FIX RMGRNK TO ERROR OUT IF READ ONLY FUNCTION FAILS
;<3-MONITOR>DTESRV.MAC.178, 27-Jan-77 11:06:32, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.177, 26-Jan-77 17:04:39, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.176, 25-Jan-77 17:45:20, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.175, 25-Jan-77 17:22:06, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.174, 25-Jan-77 17:13:53, EDIT BY KIRSCHEN
;<3-MONITOR>DTESRV.MAC.172, 24-Jan-77 13:37:22, EDIT BY KIRSCHEN
;ADD BOOT JSYS
;<3-MONITOR>DTESRV.MAC.171, 24-Jan-77 09:01:41, EDIT BY MILLER
;FIX UP CODE FOR MCB DATA TRANSFERS
;<3-MONITOR>DTESRV.MAC.170, 17-Jan-77 09:57:36, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.169, 5-Jan-77 14:55:31, Edit by HESS
;TCO 1705 - CORRECT TIME ZONE INFO IN FE
;<3-MONITOR>DTESRV.MAC.168, 27-Dec-76 17:31:48, EDIT BY HURLEY
;<3-MONITOR>DTESRV.MAC.167, 13-Dec-76 13:54:18, EDIT BY MILLER
;MOVE CHECKING OF FEDBSW FROM DINGME TO JOB 0 CODE
;<1MILLER>DTESRV.MAC.44, 13-Jan-77 11:48:52, EDIT BY MILLER
;<1MILLER>DTESRV.MAC.39, 12-Jan-77 13:16:37, EDIT BY MILLER
;<1MILLER>DTESRV.MAC.26, 6-Jan-77 13:12:36, EDIT BY MILLER
;<3-MONITOR>DTESRV.MAC.168, 27-Dec-76 17:31:48, EDIT BY HURLEY
;<3-MONITOR>DTESRV.MAC.167, 13-Dec-76 13:54:18, EDIT BY MILLER
;MOVE CHECKING OF FEDBSW FROM DINGME TO JOB 0 CODE
;<3-MONITOR>DTESRV.MAC.166, 10-Dec-76 20:09:43, Edit by MCLEAN
;<3-MONITOR>DTESRV.MAC.165, 10-Dec-76 17:17:50, Edit by MCLEAN
;<3-MONITOR>DTESRV.MAC.164, 10-Dec-76 17:14:14, Edit by MCLEAN
;<2-MONITOR>DTESRV.MAC.161, 10-Dec-76 15:10:03, EDIT BY HELLIWELL
;MOVE LINE NUMBER TRANSLATION FROM DTEFLO INTO TTYSRV
;<3-MONITOR>DTESRV.MAC.162, 26-Nov-76 14:01:18, Edit by MCLEAN
;TCO 1669 EXTENDED ADDRESSING
;<2-MONITOR>DTESRV.MAC.160, 29-Oct-76 16:36:33, EDIT BY HELLIWELL
;CHANGE TTYSRV ROUTINE CALLED FROM BIGSTO TO DTESTO
;<2-MONITOR>DTESRV.MAC.159, 18-Oct-76 10:11:36, EDIT BY MILLER
;TCO 1603. STORE # OF -11 BYTES IN FORNT-END ERROR MESSAGE
;<2-MONITOR>DTESRV.MAC.158, 29-Sep-76 15:37:57, EDIT BY MILLER
;TCO 1554. CLEAR CTY OUTPUT BUFFER ON -11 RELOAD
;<2-MONITOR>DTESRV.MAC.157, 15-Sep-76 16:07:33, EDIT BY MILLER
;INHIBIT MESSAGES AND TIME SETTING ON TOPS20 PROCEEDS IF DBUGSW=2
;<2-MONITOR>DTESRV.MAC.156, 15-Jul-76 13:20:03, EDIT BY MILLER
;TCO 1467. FIX SKDPDL OVERFLOW
;<2-MONITOR>DTESRV.MAC.155, 28-Jun-76 09:44:24, EDIT BY MILLER
;TCO 1457. FIX JOB 0 SYSERR CODE
;<2-MONITOR>DTESRV.MAC.1, 22-Jun-76 17:54:42, EDIT BY HALL
;MADE RUNDII CALL SPECIFY OFFSET 0 IN ENTRY VECTOR
;<1B-MONITOR>DTESRV.MAC.153, 20-MAY-76 13:13:00, EDIT BY MILLER
;TCO 1306. FIX HANDLING OF DEAD11 BIT
;<1B-MONITOR>DTESRV.MAC.5, 7-MAY-76 08:58:14, EDIT BY MILLER
;TCO 1282. FIX DTE UNIT POSITIONING
;<1B-MONITOR>DTESRV.MAC.4, 5-MAY-76 14:47:46, EDIT BY MILLER
;<1B-MONITOR>DTESRV.MAC.3, 27-APR-76 18:20:25, EDIT BY MILLER
;TCO 1265. FIX RACE IN DTEQ
;<1B-MONITOR>DTESRV.MAC.2, 15-APR-76 09:42:05, EDIT BY KIRSCHEN
;<1B-MONITOR>DTESRV.MAC.1, 8-APR-76 11:14:28, EDIT BY KIRSCHEN
;TCO 1243 - MAKE DTBYTM INTERNAL
;<1MONITOR>DTESRV.MAC.151, 25-MAR-76 13:13:23, EDIT BY MILLER
;<1MONITOR>DTESRV.MAC.150, 25-MAR-76 11:38:53, EDIT BY MILLER
;TCO 1133 AGAIN. FINISH FIXING THE POLLER
;<1MONITOR>DTESRV.MAC.149, 23-MAR-76 15:53:20, EDIT BY HURLEY
;TCO 1212 - REFERENCE SHLTW INSTEAD OF 30 (CODE CLEAN UP)
;<1MONITOR>DTESRV.MAC.148, 9-MAR-76 11:15:27, EDIT BY MILLER
;TCO 1168. ALLOW DRIVERS TO FORCE BYTE MODE INDIRECTS
;<1MONITOR>DTESRV.MAC.147, 2-MAR-76 13:30:19, EDIT BY MILLER
;TCO 1145. ENABLE/DISABEL DATATSET ANSWER
;<2MONITOR>DTESRV.MAC.146, 15-FEB-76 12:12:45, EDIT BY MILLER
;TCO 1093. IMPLEMENT RELOAD WORD IN DTE VECTOR
;<2MONITOR>DTESRV.MAC.145, 15-FEB-76 11:50:04, EDIT BY MILLER
;TCO 1092. DON'T SEND TIME TO -11 ON POWER RESTART
;<2MONITOR>DTESRV.MAC.144, 13-FEB-76 17:14:27, EDIT BY MILLER
;MCO 21. EDIT TO TIME FUNCTION TO FIND MASTER -11
;<2MONITOR>DTESRV.MAC.143, 9-FEB-76 10:20:33, EDIT BY MILLER
;MCO 21. LOADME SHOULD FIND MASTER -11
;<2MONITOR>DTESRV.MAC.142, 27-JAN-76 13:16:55, EDIT BY MILLER
;MCO 33 FIX POLLER
;<2MONITOR>DTESRV.MAC.141, 25-JAN-76 11:44:55, EDIT BY MILLER
;MCO #27. MAKE RELOAD CODE SWAPPABLE
;<2MONITOR>DTESRV.MAC.140, 19-JAN-76 18:52:08, EDIT BY MILLER
;MCO 12. FIX KLERR DATA
;<2MONITOR>DTESRV.MAC.139, 19-JAN-76 10:46:09, EDIT BY MILLER
;MCO # 9. FIX TAKTOD TO HANDLE DST CORRECTLY
;<2MONITOR>DTESRV.MAC.138, 16-JAN-76 17:46:30, EDIT BY MURPHY
;<MILLER>DTESRV.MAC.1, 7-JAN-76 12:22:57, EDIT BY MILLER
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1977 BY DIGITAL EQUIPMENT CORPORATION
SEARCH PROLOG,SERCOD
TTITLE DTESRV
IFN KLFLG,<
SEARCH PROKL>
RESCD
MAXSGL==6
SNGHDR==3
SNGONQ==1B2
SNGAVL==1B3
SNGACT==1B4
;LOCAL DEFINITIONS FOR RELOAD WAITS
PWRDN1==^D1150 ;-11 MUST COMPLETE POWER DOWN IN THIS TIME
ROMTIM==^D2000 ;ROM MUST ACK -10 IN THIS TIME
BUTTIM==^D5000 ;-11 BOOTSTRAP TRANSFER TIME
DRBTIM==^D60000 ;-11 RELOAD TIME
T10TIM==^D3000 ;MAX TIME FOR 1K OF -11 CORE TO BE
; TRANSFERRED TO THE -10
MONPRO==^D5000 ;MUST ENTER MONITOR PROTOCOL IN THIS TIME
PRIPRO==^D10000 ;MUST ENTER PRIMARY IN THIS TIME
MCINI0==^D1500 ;TIME FOR MCB TO INIT COMM REGIONS
MCINI1==^D500 ;TIME TO COMPLETE PROTOCOL TRANSITION
;EXTERNAL DEFINITIONS DEFINED IN STORAGE
EXTN <TAD11,TO11TM,DTETIM> ;WORDS TO TRANSMIT TIME
EXTN <DLSRCF,DLSCXF,CARONB> ;TTYSRV DEFINITIONS
EXTN <TTYHGU,TTYDLU> ;MORE TTYSRV DEFS
EXTN <IEXSIZ,CTYUNT,DTEDTE>
EXTN <DTEQS,COMQ,COMH,DTESTS,DTEST1>
EXTN <DTBFWD,DTETRA,DTEACB>
EXTN <DTEIND,PKTADR,COMBUF>
EXTN <DTESTK,BUFSIZ,NQPKT>
EXTN <DTEN,COMSIZ>
EXTN <DTETRP,TTYINT,SVDTRJ>
EXTN <PKTSIZ,QPKT>
EXTN <CNDO,DATO,BYTBUF>
EXTN <DTESTO,KIEPT,TMZONE>
EXTN <MAXDEV,MINDEV,DTEDTV>
EXTN <INIDV1,MCPRON>
DTENL==^D256 ;LINES PER DTE20
SDTE==3 ;SHIFT VALUE FOR DTE UNITS
MAXINP==^D254 ;MAX NUMBER OF BYTES IN AN INDIRECT
; PACKET WHICH IS EVEN
DSK11==1B28 ;RP RELOAD DEVICE IN -11 ROM
;SPECIAL DEFINITIONS FOR SCHEDULER PRIORITY WORDS
BOTPRI==1 ;SPECIAL PRIORITY WORD FOR BOOT JSYS INIT
RLDPRI==<XWD ^D80,1> ;SPECIAL MASTER -11 RELOAD PRIORITY
;DTE20 EPT DEFINITIONS
DTEEPW==:KIEPT+144 ;EXAMINE PROTECTION WORD
DTEERW==KIEPT+145 ;EXAMINE RELOCATION WORD
DTEDPW==KIEPT+146 ;DEPOSIT PROTECTION WORD
DTEDRW==KIEPT+147 ;DEPOSIT RELOCATION WORD
DTEINT==:KIEPT+142 ;INTERRUPT LOCATION
DTEEBP==KIEPT+140 ;TO -11 BYTE POINTER
DTETBP==KIEPT+141 ;TO -10 BYTE POINTER
;DTE SERVICE ROUTINE. THIS CODE CONTAINS THE INITIALIZATION CODE,
;THE QUEUE HANDLING AND SCHEDULING CODE AND THE INTERRUPT HANDLER
;FOR THE DTE.
;LOCAL DEFINITIONS
PVERSN==1 ;PROTOCOL VERSION NUMBER
CVERSN==2 ;COMMUNICATIONS VERSION NUMBER
LDTEPI==DTEPI0+DLSCHN+DTEPIE ;TURN ON ALL PI'S
MAG11N==1365 ;THE RELOAD INDICATOR FOR THE -11 ROM
;DEFINE LOCAL STORAGE
DEFSTR (QLINK,0,35,18) ;LINK TO NEXT PACKET
DEFSTR (QINT,0,17,18) ;INT LOC FOR THIS FUNCTION
DEFSTR (QFNC,1,17,18) ;FUNCTION WORD FOR THIS REQUEST
DEFSTR (QDEV,1,35,18) ;DTE DEVICE CODE FOR THIS REQUEST
DEFSTR (QNSPH,1,35,36) ;FULL WORD FOR NSP BYTE POINTER
DEFSTR (QLIN,2,17,18) ;DEVICE UNIT NUMBER
DEFSTR (QMODE,2,18,1) ;IF ONE, INDIRECT DATA MUST BE BYTE MODE
DEFSTR (QCNT,2,35,17) ;BYTE COUNT OR BYTE OR 0
DEFSTR (QPNTR,3,35,36) ;BYTE POINTER FOR INDIRECT OPERATION
;OR LOCAL 8-BIT DATUM IF QCNT=0
DEFSTR (QCOD,4,35,36) ;UNIQUE CODE RETURNED TO INTERRUPT
; ROUTINE
;DTE STATUS DEFINITIONS IN DTESTS
DEFSTR (DTEST,DTESTS,35,6) ;DTE STATUS
DTET10==1 ;-10 IS RECIEVING LAST FRAGMENT OF A MESSAGE
DTE11==2 ;-11 IS RECEIVING BYTES
DTE11I==4 ;-11 IS RECEIVING AN INDIRECT QUEUE ENTRY
DTET1F==10 ;10 RECEIVING FIRST FRAFMENT OF
; A MESSAGE
DEFSTR(DTERL,DTESTS,0,1) ;BIT TO SAY DTE IS RUNNING A PROTOCOL
DEFSTR(DTEBF,DTESTS,1,1) ;WHICH BUFFER IS IN USE FOR RSX20F
DEFSTR(DTEBC,DTESTS,29,12) ;BYTE COUNT REMAINING FOR SUBSEQUENT
DEFSTR (DTBLK,DTESTS,2,1) ;FOR MCB, TO -10 IS BLOCKED ON FREE
; SPACE
DEFSTR(DTRLD,DTESTS,3,1) ;IF ONE, THIS -11 BEING RELOADED
DEFSTR (DTKAC,DTESTS,4,1) ;IF ONE, THIS -11 IS ILL
DEFSTR (DTSTI,DTESTS,5,1) ;STATUS PACKET IS SPLIT
DEFSTR(DTEB1,DTESTS,17,12) ;BYTE COUNT OF LAST TRANSFER
;PARALLEL STATUS TABLE CONTAINING CURRENT OPERATION DATA
DEFSTR(DT1FC,DTEST1,15,16) ;CURRENT FUNCTION CODE
DEFSTR(DT1DV,DTEST1,31,16) ;CURRENT DEVICE CODE
;
;SPECIAL REQUEST BITS FOR TO 11 CONDITIONS
DEFSTR(DT1TM,DTEST1,32,1) ;-11 WANTS TIME OF DAY
DEFSTR(DT1ID,DTEST1,33,1) ;WAITING FOR INDIRECT SETUP
;MORE STORAGE DEFINITIONS
;STORAGE FOR INDIRECT PACKETS
DEFSTR (INUNT,DTEIND,7,8)
DEFSTR (INCNT,DTEIND,15,8)
DEFSTR (INVLD,DTEIND,16,1) ;SAYS IF UNIT FIELD IS VALID
;********* FOR MCB, DTEIND CONTAINS FREE SPACE BLOCK ********
;DEFINITIONS FOR DTE PACKETS
DEFSTR (HDCNT,0,15,16) ;COUNT
DEFSTR (HDFNC,0,31,16) ;FUNCTION
DEFSTR (HDDEV,1,15,16) ;DEVICE CODE
DEFSTR (HDSPR,1,31,16) ;SPARE
DEFSTR (HDLIN,2,7,8) ;LINE NUMBER
DEFSTR (HDDAT,2,15,8) ;DATUM
DEFSTR (HDDT1,2,15,16) ;DATUM FOR SINGLE DATUM PACKET
;DEFINE THE COMMUNICATIONS REGION
;FIELD DEFINITIONS FOR THE COMMUNCIATIONS REGION
;FIRST THE OWNED AREA
DEFSTR (CMTEN,0,0,1) ;TEN INDICATOR IN HEADER
DEFSTR (CMVER,0,3,3) ;VERSION NUMBER
DEFSTR (CPVER,0,11,6) ;COMMUNCIATIONS PROTOCOL VERSION NUMBER
DEFSTR (CMNPR,0,16,5) ;NUMBER OF PROCESSORS HERE
DEFSTR (CMSIZ,0,19,3) ;SIZE IN MULTIPLES OF 8 WORDS
DEFSTR (CMNAM,0,35,16) ;PROCESSOR NAME
DEFSTR (CMLNK,1,35,36) ;POINTER TO NEXT PROCESSOR
DEFSTR (CMKAC,KPALIV,35,36) ;PROCESSOR KEEP ALIVE COUNTER
CMPCW==6 ;PC WORD
CMPIWD==7 ;CONI PI, WORD
CMPGWD==10 ;CONI PAG, WORD
CMPDWD==11 ;DATI PAG, WORD
CMAPRW==12 ;CONI APR, WORD
CMDAPR==13 ;DATI APR, WORD
;NOW THE "TO" AREA
DEFSTR (CMPRO,0,0,1) ;1 IF THIS IS CONNECTION TO A -10
DEFSTR (CMDTE,0,1,1) ;I IF A DTE IS CONNECTING THESE TWO
DEFSTR (CMDTN,0,3,2) ;DTE NUMBER
DEFSTR (CMSZ,0,19,3) ;SIZE OF BLOCK/8
DEFSTR (CMVRR,0,16,5) ;PROTOCOL IN USE BY THE TWO PROCESSORS
DEFSTR (CMPNM,0,35,16) ;PROCESSOR NUMBER
DEFSTR (CMPPT,1,35,36) ;POINTER TO ASSOCIATE PROCESSOR
DEFSTR (CMPWF,2,0,1) ;POWER FAIL INDICATOR
DEFSTR (CML11,2,1,1) ;LOAD-11 INDICATOR
DEFSTR (CMINI,2,2,1) ;INI BIT FOR MCB PROTOCOL ONLY
DEFSTR (CMTST,2,3,1) ;VALID EXAMINE BIT
DEFSTR (CMQP,2,13,1) ;1 IF USING QUEUED PROTOCOL
DEFSTR (CMFWD,2,17,1) ;SAYS TO DO FULL WORD TRANSFER
MSKSTR (CMIP,2,400000) ;INDIRECT POINTER IS SET UP
MSKSTR (CMTOT,2,200000) ;TOIT BIT
DEFSTR (CM0IC,2,27,8) ;TO10IC FOR QUEUE TRANSFERS
DEFSTR (CM1IC,2,35,8) ;TO11IC FOR QUEUE TRANSFERS
DEFSTR (CMQCT,3,35,16) ;COUNT OF WORDS IN CURRENT QUEUE
;DEFINITIONS FOR PROTOCOL VERSION .VNMCB ONLY
DEFSTR (CMPCT,3,19,16) ;PIECEMEAL COUNTER
DEFSTR (CMTMD,3,3,4) ;MODE OF THE TRANSFER
;COMMON DEFINITIONS
DEFSTR (CMRLF,4,35,36) ;RELOAD PARAMETER FOR THIS -11
DEFSTR (CMKAK,5,35,36) ;MY COPY OF HIS CMKAC
CMCLR1==2 ;FIRST DYNAMIC WORD TO CLEAR
CMCLR2==3 ;OTHER WORD TO CLEAR
;FUNCTION TRANSFER VECTOR FOR RSX20F PROTOCOL (.VN20F) ONLY
FNCTBL: TAKCTY ;FE TELLING ABOUT THE CTY
400000,,TAKDS ;STRING DATA (FOR CDR)
TAKLC ;LINE CHARACTERS (FOR DLS)
NOOP ;NOT YET IMPLEMENTED
NOOP ;NOT YET IMPLEMENTED
400000,,TAKSTD ;-11 SENDING ERROR INFORMATION
NOOP ;UNSUPPORTED
SNDTOD ;-11 WANTS TIME OF DAY
400000,,TAKTOD ;-11 IS SENDING TIME OF DAY
NOOP ;FLUSH OUTPUT NOT SUPPORTED
NOOP ;SEND ALL NOT SUPPORTED
DIALUP ;A LINE DIALED UP
HANGUP ;A LINE HUNG UP
EMPTY ;LINE BUFFER EMPTY
NOOP ;XOFF
NOOP ;XON
400000,,TAKSPD ;SET LINE SPEED
LINEAL ;SET LINE ALLOCATION
TAKRLW ;TAKE -11 RELOAD INFORMATION
TAKACK ;ACK ALL DEVICES AND UNITS
NOOP ;TURN ON/OFF LINES
NOOP ;ENABLE/DISABLE DATASETS
NOOP ;LOAD TRANSLATION RAM
NOOP ;LOAD VFU
NOOP ;SUPPRESS SYSTEM MESSAGES
400000,,TAKKLI ;TAKE KLINIK DATA
MINFNC==2 ;FIRST IMPLEMENTED FUNCTION
MAXFNC==.-FNCTBL+MINFNC-1 ;MAX FUNCTION NUMBER
;DEFINITIONS FOR NSP HEADER PACKET USING MCB PROTOCOL
NSPDN==177777B23 ;POSITION OF DEST NODE ADDRESS
NSPMF==377B15 ;POSIITON OF MESSAGE FLAGS (WORD 1)
NSPRF==377B7 ;POSITION OF ROUTING FLAGS
NSPS0==377B31 ;POSITION OF FIRST BYTE OF SOURCE NODE
NSPS1==377B7 ;POSITION OF SECOND BYTE OF SOURCE NODE
; (WORD 1)
;COMM REGION MODE TYPES FOR MCB BYTE TRANSFERS
.TMBYT==0 ;BYTE MODE TRANSFERS
.TMWRD==2 ;WORD MODE TRANSFERS
.TMBWD==1 ;BYTES IN WORD MODE TRNASFERS
;THIS IS THE DTE INITIALIZATION CODE. IT SETS UP THE
;COMMUNICATIONS AREA FOR THE MASTER DTE ONLY (WHICH RUNS .VN20F PROTOCOL)
SWAPCD ;IS CALLED FROM JOB 0
PROINI::SETOM BTLOCK ;INITIALIZE BOOT PAGE LOCK
MOVEI A,^D5000 ;MAKE 5 SEC CHECK
MOVEM A,DTETIM ;TO THE TIMER
SETZM CTYUNT ;****TEMP VALUE FOR CTY
SETZM TO11TM ;FREE UP TIME PACKET
NOSKED ;NO SCHEDULING
CHNOFF DLSCHN ;TURN OFF THE DTE CHANNEL
MOVE A,[DTEEPW,,DTEEPW+1]
BLT A,DTEDRW+<DTEN-1>*10 ;CLEAR ENTIRE REGION IN THE EPT
STBUF1: SETZ A, ;FIRST COMMUNICATIONS REGION
MOVEI B,DTEN ;NUMBER TO DO
STOBUF: MOVEM A,COMBUF(B) ;STORE THIS GUY
ADD A,[1B11+COMSIZ] ;NEXT REGION
CAIN B,DTEN ;IS THIS THE -10'S REGION?
ADDI A,COMRGN*<DTEN-1> ;YES. ADD IN SPACE FOR ALL OF THE -11'S
SOJGE B,STOBUF ;DO ALL OF REGION
SETZM COMBAS ;SET UP TO CLEAR ENTIRE COM AREA
MOVSI A,COMBAS ;FIRST WORD
HRRI A,COMBUF+DTEN+2 ;FIRST WORD BEYOND THAT
BLT A,COMBUF+DTEN+IEXSIZ ;CLEAR ENTIRE COMM REGION
;NOW CREATE THE REQUEST QUEUE
MOVSI A,1-NQPKT ;NUMBER OF LINKS TO MAKE
DOQLNK: MOVEI B,QPKT+COMQ(A) ;THE NEXT PACKET
MOVEM B,COMQ(A) ;MAKE A LINK
ADDI A,QPKT-1 ;TO MAKE THE AOBJN WORK
AOBJN A,DOQLNK ;DO ALL PACKETS
MOVEI A,COMQ ;THE FIRST PACKET
MOVEM A,COMH ;MAKE THE HEADER POINT TO THE FIRST
; ..
;DTEINI...
; INIT QUEUE HEADERS
MOVSI A,-DTEN ;NUMBER TO DO
BUFFLP: SETZM DTEQS(A) ;INIT SCHEDULER QUEUE
AOBJN A,BUFFLP ;DO ALL DTE'S
MOVE A,MSTRDT ;GET NUMBER OF MASTER DTE
MOVEI B,.VN20F ;INIT IT TO RSX20F PROTOCOL
CALL DTINIT ;DO IT
CHNON DLSCHN ;TURN ON DTE CHANNEL
OKSKED ;AND ALLOW SCHEDULING AGAIN
CALL DFNDL1 ;GO FIX UP SPECIAL LINES ON THE FE
CALLRET INIDV1 ;AND GO DO THE FRONT END DEVICES
;ROUTINE TO DO POWER FAIL INIT FOR EACH OF THE DTE'S.
RESCD ;MUST BE RESIDENT SO RESTART WORKS
STODT2: SAVEP ;SAVE PERMANENT REGISTERS
MOVSI P1,-DTEN ;NUMBER OF DTE'S
STODTE: JE DTERL,(P1),NODTEH ;RUNNING?
MOVEI A,0(P1) ;YES. GET DTE NUMBER
CALL DTINTP ;GO DO POWER FAIL RECOVERY
NODTEH: AOBJN P1,STODTE ;GO DO ALL OF THEM
CHNON DLSCHN ;ALLOW INTS NOW
OKSKD1 ;TURN ON SCHEDULING IF NECESSARY
RET ;AND DONE
;CODE TO RESTART THE DTE'S ONE SYSTEM RESTART.
;CALLED FROM SYSRST
DTERST::NOSKD1 ;NO SCHEDULING PLEASE
CHNOFF DLSCHN ;AND NO DTE INTS
CALLRET STODT2 ;GO DO THE WORK
;ROUTINE TO CHECK IF A GIVEN DTE IS RUNNING A PROTOCOL
; A/ DTE NUMBER
;RETURNS:
; +1 /NOT RUNNING A PROTOCOL
; +2/RUNNING A PROTOCOL
SWAPCD ;IS SWAPPABLE
CHKDTE::CAIL A,DTEN ;AN EXTANT DTE?
RETBAD ;NO
JE DTERL,(A),R ;IF NOT RUNNING A PROTOCOL FAIL
RETSKP ;SUCCESS
;ROUTINES TO INIT INDIVIDUAL DTE DATA BASES. CALLED FROM DTEINI
;AS WELL AS FROM THE REBOOT CODE
;MAY RUN WITH INTS AND SCHEDULING ENABLED
;ACCEPTS A/ DTE NUMBER
; B/ PROTOCOL VERSION TO INIT IF ENTRY IS AT DTINIT
;IF ENTRY IS AT DTINTP, PROTOCOL WILL BE INITED TO PREVAILING TYPE
;ACCEPTS: A/ DTE #
; B/ PROTOCOL VERSION NUMBER FOR DTINIT ONLY
;DTINTP WILL INIT DTE TO THE PROTOCOL IN EFFECT BEFORE THE POWER FAIL
RESCD ;MUST BE RESIDENT FOR RESTART
DTINTP: SETO B, ;REMEMBER POWER RESTART ENTRY
DTINIT: STKVAR <DTNUMB,PROVER> ;TO SAVE DTE NUMBER
HRRZS A ;GET DTE NUMBER ONLY
MOVEM B,PROVER ;SAVE PROTOCOL VERSION NUMBER
SETZM DTESTS(A) ;CLEAR STATUS WORD
SETZM DTEST1(A) ;AND THE OTHER ONE
CALL DTREST ;GO RESET THIS DTE
SKIPGE PROVER ;POWER RESTART ENTRY?
JRST DTINP1 ;YES.
SETONE DT1TM,(A) ;NO. SAY HE NEEDS TIME THEN
DTINP1: LSH A,SDTE ;TO FIND THE EPT REGION
SETZM DTEEPW(A) ;FORCE SECONDARY PROTOCOL
LSH A,-SDTE ;RESTORE A
CALL SETRGN ;GO FIND THE REGIONS
SUBI D,COMDAT ;POINT TO FIXED PART OF -11'S REGION
MOVEI C,COMBAS ;GET -10'S FIXED REGION
EXCH D,C ;REVERSE MEANINGS OF REGISTERS
CAME A,MSTRDT ;IS THIS THE MASTER?
JRST [ CALL DING11 ;NO. JUST RING BELL
JRST DTINI1] ;AND PROCEED WITH INIT
SETZM DTEFLG ;CLEAR FLAG WORD
MOVEI B,DTEEMP ;ENTER SECONDARY COMMAND
MOVEM B,DTECMD ;TO THE COMMAND WORD
CALL DING11 ;GO DING HIM
MOVEI B,MONPRO ;TIME TO ENTER PROTOCOL
CALL NEWTIM ;GET TIME IN FUTURE
DTINI2: SKIPN DTEFLG ;GOT IT YET?
JRST [ CALL CHKTIM ;IS TIME UP YET?
JRST DTINI2 ;NO. GO WAIT SOME MORE
SETONE DTRLD,(A) ;YES. HE DIDN'T MAKE IT
AOS LOAD11 ;JUST IN CASE
RET] ;AND DONE
DTINI1: MOVEM A,DTNUMB ;SAVE DTE NUMBER
MOVEI A,1 ;TENIND
STOR A,CMTEN,(D) ;SAY FIRST BLOCK IS FOR A TEN
SETZRO CMTEN,(C) ;HE IS NOT
MOVEI A,CVERSN ;CURRENT COMMUNICATIONS VERSION
STOR A,CMVER,(D) ;STORE IT
STOR A,CMVER,(C) ;FOR THE -11 ALSO
MOVEI A,PVERSN ;PROTOCOL VERSION
STOR A,CPVER,(C)
STOR A,CPVER,(D) ;STORE THIS AS WELL
MOVEI A,2 ;EACH -11 ADDRESSES TWO PROCESSORS
STOR A,CMNPR,(C)
MOVEI A,DTEN+1 ;NUMBER OF PROCESSORS
STOR A,CMNPR,(D) ;STORE THESE
SKIPGE B,PROVER ;DOING INIT?
JRST DTINI7 ;NO.
MOVEI A,COMSIZ/COMRGN ;INTEGRAL SIZE OF A REGION
CAIE B,.VN20F ;RSX20F PROTOCOL?
MOVEI A,2 ;NO. MCB HEADER IS ALWAYS 2
STOR A,CMSIZ,(C)
MOVEI A,2 ;HEADER IN 10'S AREA IS 2
STOR A,CMSIZ,(D) ;REMEMBER THE SIZE
DTINI7: MOVE A,DTNUMB ;GET DTE NUMBER
AOS A ;GET OFFSET INDEX
STOR A,CMNAM,(C) ;HIS NUMBER
SETZRO CMNAM,(D) ;MY NUMBER IS ZERO
MOVEI B,COMBAS ;FIRST REGION
DTINI3: JE CMLNK,(B),[ SETZRO CMLNK,(C)
SUBI C,COMBAS ;OFFSET FOR -11
STOR C,CMLNK,(B) ;LINK IT IN TO ACTIVE LIST
JRST DTINI4] ;AND DONE
LOAD B,CMLNK,(B) ;GET THE LINK
ADDI B,COMBAS ;MAKE IT ABSOLUTE
CAME B,C ;IS THIS THE ONE WE WANT?
JRST DTINI3 ;NO, GO CHECK IT
; ..
;DTINIT ...
;NOW INIT THE PER PROCESSOR REGION OF EACH COM REGION
DTINI4: MOVE A,DTNUMB
CALL SETRGN ;GO FIND REGIONS AGAIN
EXCH C,D ;REVERSE REGS AGAIN
SETZM CMCLR1(C)
SETZM CMCLR2(C) ;CLEAR DYNAMIC WORDS IN -11'S REGION
SETZM CMCLR1(D)
SETZM CMCLR2(D) ;CLEAR TEN DYNAMIC WORDS
MOVEI A,1 ;TENIND WORD
STOR A,CMPRO,(C) ;TELL -11 HE IS CONNECTED TO A -10
STOR A,CMDTE,(C)
STOR A,CMDTE,(D) ;A DTE CONNECTS THESE TWO
STOR A,CMTST,(D) ;SET VALID EXAMINE
STOR A,CMSZ,(C)
STOR A,CMSZ,(D) ;TO THE REGIONS
MOVE A,DTNUMB ;GET DTE NUMBER
STOR A,CMDTN,(C) ;TO HIS REGION
STOR A,CMDTN,(D) ;AND TO MINE
AOS A ;INDEX
STOR A,CMPNM,(D) ;HIS NAME
SETZRO CMPNM,(C) ;AND MY NAME IN HIS REGION
SETZRO CMPPT,(C) ;HIS POINTER TO ME
SUBI C,COMBAS+COMDAT ;HIS RELATIVE OFFSET IN COMM REGION
STOR C,CMPPT,(D) ;MAKE MY REGION POINT TO HIM
ADDI C,COMBAS+COMDAT ;RESTORE POINTER
SKIPGE B,PROVER ;NEED TO DO MORE INITING?
JRST DTINI5 ;NO. ALL DONE FOR NOW
STOR B,CMVRR,(D) ;YES. STORE PROTOCOL VERSION NUMBER
STOR B,CMVRR,(C) ; IN BOTH REGIONS
CAIE B,.VN20F ;DOING RSX20F?
JRST DTINI5 ;NO. ALL DONE WITH COMM REGION
MOVEI A,1 ;YES. GET A ONE
STOR A,CMQP,(D) ;USING THE QUEUED PROTOCOL
STOR A,CMQP,(C) ;FOR HIS AS WELL
; ..
;NOW SET UP THE EPT FOR THIS DTE/-11 AND DO THE PROTOCOL
;TRANSITION
DTINI5: MOVEM D,PROVER ;SAVE COMM REGION POINTER
MOVE D,DTNUMB ;GET DTE NUMBER
LSH D,SDTE ;GET TO THE EPT OFFSET
MOVEI A,COMBUF+DTEN-1 ;HIS EXAMINE REGION
SUB A,DTNUMB ;WHERE IT REALLY IS
MOVEI B,IEXSIZ+2 ;GET INITIAL EXAMINE SIZE
ADD B,DTNUMB ;ADD IN DTE NUMBER
MOVEM A,DTEERW(D) ;EXAMINE RELOCATION WORD
SUBI C,COMDAT ;STORE DEPOSIT RELOCATION
MOVEM C,DTEDRW(D) ;STORE DEPOSIT RELOCATION
ADDI C,COMDAT ;GET BACK COMM REGION POINTER
MOVEM B,DTEEPW(D) ;STORE EXAMINE PROTECTION WORD
MOVEI B,COMSIZ ;SIZE OF A SINGLE REGION
MOVEM B,DTEDPW(D) ;STORE AS THE DEPOSIT PROTECTION
MOVE A,DTNUMB ;THE DTE NUMBER
MOVE B,DTETRP(A) ;GET TRAP INSTRUCTION
MOVEM B,DTEINT(D) ;TO THE EPT
MOVE D,PROVER ;RESTORE COMM REGION POINTER
LOAD B,CMVRR,(C) ;GET PROTOCOL VERSION TO USE
CAIE B,.VN20F ;WANT RSX20F?
JRST DTINMC ;NO. GO DO OTHER
;HERE TO INIT RSX20F PROTOCOL FOR THIS DTE AND THIS -11
SETZM DTEIND(A) ;CLEAR ANY RESIDUAL INDIRECT INFO
SKIPE DTBFWD(A) ;HAVE BUFFERS YET?
JRST DTIN10 ;YES. USE THEM THEN
MOVE A,[.RESP1,,BUFSIZ*2] ;NO. GET SOME SPACE THEN
MOVX B,<RS%SE0+.RESGP> ;FROM THE GENERAL POOL
CALL ASGRES ;GET THE SPACE
JRST [ MOVE A,DTNUMB ;FAILED. GET BACK DTE NUMBER
CAMN A,MSTRDT ;IS THIS THE MASTER?
BUG (HLT,NORSXF,<FAILED TO GET SPACE FOR MASTER DTE>)
SETONE DTRLD,(A) ;NO. SET RELOAD BIT
AOS LOAD11 ;SAY A SICK -11 ABOUNDS
RET] ;AND DONE
MOVE B,DTNUMB ;GOT IT. GET BACK DTE NUMBER
HRLI A,BUFSIZ(A) ;FORM BUFFER WORD
MOVEM A,DTBFWD(B) ;STORE IT
MOVE A,B ;GET DTE NUMBER
DTIN10: SETZM DTEFLG ;SET UP TO LEAVE MONITOR MODE
MOVEI B,DTEEPP+1 ;ENTER PRIMARY AND RESET COMM REGION
MOVEM B,DTECMD ;THE COMMAND TO MONFE
CALL DING11 ;GO DING HIM
CAME A,MSTRDT ;IS THIS THE MASTER?
JRST DTINI6 ;NO. SKIP PROTOCOL TRANSITION THEN
MOVEI B,PRIPRO ;TIME TO DO IT
CALL NEWTIM ;WHEN TIME IS UP
SKIPN DTEFLG ;WAIT FOR THE 11 TO ACKNOWLEDGE
JRST [ CALL CHKTIM ;TIME UP YET?
JRST .-1 ;NO. GO WAIT
SETONE DTRLD,(A) ;YES. HE BLEW IT
AOS LOAD11 ;JUST IN CASE
RET] ;AND DONE
SETOM FEFLG ;PRIMARY PROTOCL NOW AVAILABLE
DTINI6: CALL CLRBEL ;CLEAR OUT RESIDUAL DOORBELLS
CALL DTEON ;TURN ON PROTOCOL
;NOW THAT THE PROTOCOL EXISTS, QUERY THE FRONT END ON THE STATE
;OF THE CTY
CALL DTESKD ;START UP SCHEDULER IF NECESSARY
PUSH P,A ;SAVE DTE NUMBER
CALL LINFRQ ;GO GET THE LINE FREQUENCY
CAIN A,^D60 ;60 HZ?
SETZ A, ;YES. REMEMBER AS A 0
EXCH A,0(P) ;SAVE LINE FREQUENCY, RESTORE DTE NO
SETZ C, ;DIRECT
MOVE B,[.DFLCI,,.FEDLS] ;GIVE LINE COUNT
MOVEI D,NTTFE-1 ;THE NUMBER OF FE LINES
SKIPE 0(P) ;60 HZ?
TRO D,(1B2) ;NO. SET 50 HZ BIT
POP P,0(P) ;CLEAN UP STACK
CALL DTEQ ;DO IT
JFCL ;WILL GO
RET ;AND DONE
;HERE TO INIT THE DTE AND THE -11 FOR MCB PROTOCOL. AT THIS POINT:
; A/ DTE #
; C/ POINTER TO -11'S COMM REGION
; D/ POINTER TO -10'S COMM REGION
; DTNUMB IS A STKVAR WITH THE DTE NUMBER IN IT
DTINMC: SETONE <CMTST,CMINI>,(D) ;SET MY INI BIT
MOVE B,CNDO(A) ;GET PROTOTYPE CONO
IORI B,DTEPIE!DTEPI0 ;TURN ON PI0 ONLY
XCT B ; SO -11 CAN EXAMINE ITS REGION
CALL DING11 ;GO RING -11'S BELL
MOVE B,[CONSO DTE0,DTETDB]
LSH A,^D26 ;POSOITION DTE NUMBER
ADD B,A ;MAKE PROPER WORD
MOVEM B,PROVER ;SAVE IT
MOVE A,DTNUMB ;RESTORE DTE NUMBER
MOVEI B,MCINI0 ;TIMEOUT FOR FIRST PHASE
CALL NEWTIM ;GET ABSOLUTE TIME
DTINM1: XCT PROVER ;SEE A DOORBELL YET?
JRST [ CALL CHKTIM ;TIME UP YET?
JRST DTINM1 ;NO. KEEP POLLING
JRST DTINM3] ;AND GO WRAP UP
JE CMINI,(C),DTINM3 ;SEE IF IT DID IT RIGHT
CALL CLRBEL ;CLEAR DOORBELL
SETZRO CMINI,(D) ;CLEAR INI BIT
CALL DING11 ;RING 11'S BELL AGAIN
MOVEI B,MCINI1 ;TIME FOR THIS PHASE
CALL NEWTIM ;ABSOLUTE TIME
DTINM2: XCT PROVER ;SEE A BELL YET?
JRST [ CALL CHKTIM ;NO. TIME UP YET?
JRST DTINM2 ;NO. KEEP POLLING
JRST DTINM3] ;GO WARP UP
JN CMINI,(C),DTINM3 ;MAKE SURE IT DID IT RIGHT
CALL DTEON ;GO TURN PROTOCOL ON
CALLRET DTESKD ;AND START THE PROTOCOL
;INIT FAILED. KILL OFF DTE
DTINM3: SETONE DTRLD,(A) ;SET RELOAD
SETZRO DTERL,(A) ;NO LONGER RUNNING A PROTOCOL
CALLRET DTREST ;AND RESET THE DTE
;TIMING ROUTINES USED BY PROTOCOL INIT CODE
;COMPUTE TIME IN FUTRURE.
; B/ INCREMENT
NEWTIM: PUSH P,A ;SAVE DTE #
PUSH P,B ;SAVE INCREMENT
CALL GETMST ;GET NOW
POP P,B ;GET BAC INCREMENT
ADD B,A ;TIME IN FUTURE
POP P,A ;DTE #
RET ;DONE
;CHECK IF TIME HAS ELAPSED.
; B/ ABSOLUTE TIME
;RETURNS: +1/ TIME NOT UP
; +2 TIME UP
CHKTIM: SAVEAC <A> ;SAVE DTE #
PUSH P,B ;SAVE TIME
CALL GETMST ;GET NOW
POP P,B ;GET BACK TIME
CAMLE B,A ;TIME UP?
RET ;NO
RETSKP ;YES
;DTE INTERRUPT SERVICE. THIS CODE IS ENTERED WHENEVER ANY FLAVOR
;OF DTE INTERRUPT IS GENERATED. THERE IS A SEPARATE ENTRY ROUTINE
;FOR EACH DTE.
;ROUTINE TO SAVE THE AC'S ON A DTE INTERRUPT
RESCD ;MUST BE RESIDENT
SVDTAC::MOVEM P,DTEACB+P ;GET A WORK REGISTER
MOVEI P,DTEACB ;BLT ARG
BLT P,DTEACB+P-1 ;SAVE REST OF ARGS
MOVE P,DTESTK ;GET LOCAL STACK
JRST @SVDTRJ ;RETURN TO INTERRUPT VECTOR
;DISMISS A DTE INTERRUPT
DTEDN1: JUMPE P4,DTEDNE ;IF NO MORE, GO DISMISS
MOVEI C,0(P4) ;PACKET SIZE
MOVE A,DTEDTE ;GET DTE NUMBER
JRST DOFNC3 ;GO DO THIS FUNCTION
DTEDNE: MOVSI P,DTEACB ;TO DO BLT
BLT P,P-1 ;DO ALL BUT P
MOVE P,DTEACB+P ;RESTORE P
XJEN DTETRA ;RESTORE STATE OF MACHINE
;INTERRUPT ON NON-EX OR RELOADING DTE. TURN OFF THE DTE
DTEPRG: CALL DTREST ;GO RESET THIS DTE
JRST DTEDNE ;AND GO DISMISS IT
;ROUTINE USED BY DTINIT TO TURN ON DTE PROTOCOL RACE FREE
; A/ DTE #
DTEON: NOSKD1 ;AVOID RACES WITH SCHEDULER
SETONE DTERL,(A) ;SAY NOW RUNNING A PROTOCOL
CALL DTPII ;TURN ON DTE PI'S
OKSKD1 ;ALLOW SCHEDULING AGAIN
RET ;AND DONE
;COMMON INTERRUPT ROUTINE. ENTERS WITH
; A/ DTE NUMBER WHICH CAUSED INTERRUPT
; P/ POINTS TO LOCAL DTE INTERRUPT STACK
; F/ RESULT OF CONI DTEN,
;
;THIS ROUTINE PROCESSES ALL DTE INTERRUPTS
INTDTE::JE DTERL,(A),DTEPRG ;IF NON-EX, FORGET IT
JN DTRLD,(A),DTEPRG ;IF RELOADING THE -11, FORGET THIS INTERRUPT
TXNE F,DTEPF ;-11 LOST POWER?
JRST POW11 ;YES. GO DO SOMETHING ABOUT IT
TXNE F,DTEEDN ;-11 DONE?
JRST [ CALL TO11DN ;CALL AS A SUBROUTINE
JRST DTEDNE] ;GO DISMISS THE INTERRUPT
TXNE F,DTETDN ;TO 10 DONE?
JRST TO10DN ;YES. GO MAKE SURE WE WERE TRANSFERRING
TXNE F,DTETDB ;-10 DOORBELL INTERRUPT
JRST DINGME ;YES. I WAS DINGED
TXNE F,DTEEER ;TO -11 ERROR TERMINATION
JRST TO11ER ;YES. GO TRY AGAIN THEN
TXNE F,DTETER ;TO 10 ERROR?
JRST TO10ER ;YES. BAD NEWS
JRST DTEDNE ;GO DISMISS THE INTERRUPT
TO10DN: STKVAR<OSTATE> ;WORD TO SAVE OLD STATE
MOVEM A,DTEDTE ;SAVE DTE NUMBER
MOVE B,CNDO(A) ;PROTOTYPE CONO
IORI B,DTETDN ;SET TO CLEAR THIS BIT
XCT B ;CLEAR IT
LOAD B,DTEST,(A) ;GET STATUS OF THE DTE
MOVEM B,OSTATE ;SAVE THE STATE
TXZE B,DTET10!DTET1F ;RECEIVING ANY FLAVOR OF MESSAGE?
JRST DODMSG ;YES. GO DO THE MESSAGE THEN
BUG(CHK,DTETIP,<DTETDN-TO10 DONE RECEIVED WITH NO TRANSFER IN PROGRESS>)
JRST DTEDNE ;GO DISMISS THIS INTERRUPT
;PROCESS TO -10 DONE. FIRST DETERMINE WHICH PROTOCOL IS IN USE...
DODMSG: STOR B,DTEST,(A) ;NEW STATUS
CALL SETRGN ;GO GET COMM REGION POINTERS
LOAD B,CMVRR,(C) ;GET PROTOCOL IN USE ON THIS DTE
MOVE B,DN10VC(B) ;GET ADDRESS OF PROCESSING ROUTINE
JRST 0(B) ;GO DO IT
;TRANSFER VECTOR FOR TO -10 DONE
DN10VC: DN10RS ;FOR RSX20F PROTOCOL
DN10MC ;FOR MCB PROTOCOL
;CODE TO PROCESS TO -10 DONE FOR RSX20F PROTOCOL
;AT THIS POINT:
; A/ DTE NUMBER
; C AND D POINT TO COMM REGIONS
DN10RS: LOAD B,DTEBC,(A) ;GET RESIDUE COUNT
SETZ P5, ;ASSUME NO HEADER ON MESSAGE
JUMPN B,[ CALL DOFRGM ;START THIS FRAGMENT
JRST DODMS1] ;AND MERGE THE CODES
SETZRO CMTOT,(C) ;CLEAR INTRANSIT BIT
LOAD C,DTEB1,(A) ;GET COUNT OF COMPLETED REQUEST
LOAD D,DTEBF,(A) ;THE BUFFER WE USED
DODMS1: XCT [ HRRZ D,DTBFWD(A)
HLRZ D,DTBFWD(A)](D) ;PICK UP THE BUFFER BASE ADDRESS
HRLI D,(<POINT ^D8,0>) ;MAKE IT A BYTE POINTER
JN INCNT,(A),[ ;HAVE A RESIDUAL FUNCTION COUNT?
LOAD P3,INCNT,(A) ;YES. GET IT
JRST OLDFC2] ;GO DO IT
;..
;GET THE FUNCTION AND DEVICE FROM THIS INITIAL FRAGMENT
DOFNC3: SETO P5, ;PROCESSING HEADER
CAIGE C,12 ;VALID PACKET?
JRST [ BUG(CHK,DTEP2S,<TO10DN-PACKET TOO SMALL>)
JRST DTEDNE] ;NO. IGNORE IT
ILDB B,D ;SECOND BYTE
ILDB P3,D ;GET COUNT
LSH P3,10 ;THE FIRST BYTE
IORI P3,0(B) ;MAKE COUNT FIELD
ILDB P1,D ;LAST EIGHT BITS OF THE FUNCTION
ILDB B,D ;FIRST 8 BITS OF THE FUNCTION
LSH B,10 ;TO FORM FULL CODE
IOR P1,B ;GET FUNCTION CODE
PUSH P,P1 ;SAVE CODE
TRZ P1,1B20 ;CLEAR INDIRECT BIT
STOR P1,DT1FC,(A) ;SAVE IT
ILDB P1,D ;GET DEVICE CODE
ILDB B,D
LSH B,10
IOR P1,B ;FORM FULL DEVICE CODE
STOR P1,DT1DV,(A) ;SAVE THIS
REPEAT 2,<ILDB B,D> ;SKIP THE SPARE
POP P,P1 ;GET BACK FUNCTION
TRZE P1,1B20 ;INDIRECT?
JRST [ SETONE DT1ID,(A) ;YES. REMEMBER THIS
LOAD B,DTEST,(A) ;GET STATE
CAIN C,12 ;MUST BE TWO BYTES LEFT
TXNE B,DTET10!DTET1F ;IS IT QUIET?
BUG(HLT,DTEIDP,<DTESRV- INDIRECT POINTER WITH GARBAGE PACKET>)
ILDB B,D ;GET COUNT
STOR B,INCNT,(A) ;SAVE THIS TOO
ILDB B,D ;GET LINE
STOR B,INUNT,(A); SAVE IT
SETONE INVLD,(A); SAY UNIT IS VALID
JRST DTEDNE] ;AND DONE WITH THE REQUEST
SETZRO INVLD,(A) ;UNIT IN INDIRECT WORD IN INVALID
OLDFC2: CAILE P3,0(C) ;FUNCTION FULLY WITHIN PACKET?
JRST [ SETZ P4, ;NO. NO LOCAL RESIDUAL COUNT
SUBI P3,0(C) ;FIND HOW MANY IN NEXT PACKET
STOR P3,INCNT,(A) ;SAVE IT
JRST OLDFC1] ;GO DO IT
SETZRO INCNT,(A) ;NO NEXT RESIDUAL
EXCH P3,C
SUBI P3,0(C) ;FIND LOCAL RESIDUAL
MOVEI P4,0(P3) ;NEXT FUNCTION IS HERE
; ..
OLDFC1: SKIPE P5 ;NEED TO REMOVE HEADER?
SUBI C,10 ;BYTES IN HEADER
JUMPLE C,DTEDN1 ;IF NO BYTES, WE ARE DONE
LOAD B,DT1FC,(A) ;GET OPERATIVE FUNCTION CODE
CAIL B,MINFNC ;LEGAL FUNCTION?
CAILE B,MAXFNC ;STILL LEGAL?
BUG(HLT,DTEIFR,<DTESRV-ILLEGAL FUNCTION REQUEST FROM 11>)
JRST @FNCTBL-MINFNC(B) ;YES. GO DO IT THEN
NOOP: BUG(HLT,DTEUIF,<DTESRV-UNIMPLEMENTED FUNCTION FROM 11>)
JRST DMPBFR ;GO ALIGN BUFFERS
TAKLC: CALL TAKLC2 ;CALL PROCESSING ROUTINE
JRST DTEDN1 ;ALL DONE
TAKLC2: STKVAR <BYTC,BYTP,SAVOFS,SAVTYP>;-11 HAS SENT LINE CHARACTERS
TRNE C,1 ;AN EVEN NUMBER OF BYTES?
BUG(CHK,DTEODD,<TAKLC-ODD BYTE COUNT FOR LINE CHARACTERS>)
LOAD B,DT1DV,(A) ;GET DEVICE FOR THIS OPERATION
MOVEM B,SAVTYP ;SAVE DEVICE TYPE
CAIN B,.FECTY ;IS IT THE CTY?
JRST [ SETZM SAVOFS
JRST ISCTY]
CAIE B,.FEDLS ;IS IT "TTY"?
BUG(HLT,DTETTY,<TAKLC-NON-TTY DEVICE ON FUNCTION CODE 4>)
IMULI A,DTENL ;YES. GET LINE OFFSET
MOVEM A,SAVOFS ;SAVE IT FOR LATER
ISCTY: MOVEM C,BYTC ;SAVE COUNT OF BYTES
MOVEM D,BYTP ;AND THE BYTE POINTER
TAKLC1: SOS BYTC ;MUST BE AT LEAST TWO BYTES HERE
MOVE D,BYTP ;JUST IN CASE
SOSGE BYTC ;THIS MAKES TWO
RET ;ALL DONE
ILDB A,BYTP ;GET BYTE
ILDB B,BYTP ;GET LINE NUMBER
ADD B,SAVOFS ;MAKE IT A "REAL" LINE NUMBER
MOVE C,SAVTYP ;TYPE
CALL DTESTO ;STORE IN BIGBUF
JRST TAKLC1 ;DO ALL BYTES
TAKDS: LOAD B,DT1DV,(A) ;GET THE DEVICE
CAIL B,MINDEV ;A REASONABLE DEVICE?
CAILE B,MAXDEV ;STILL?
JRST DMPBFR ;NO. FLUSH THE REQUEST
SKIPE P1,DTEDTV(B) ;A KNOWN DEVICE?
SKIPN P1,DTVSD(P1) ;YES. THIS DEVICE HAVE STRING DATA?
JRST DMPBFR ;NO. FORGET IT
CALL GETUNT ;FIND APPROPRIATE UNIT NUMBER
HRLI A,0(C) ;THE COUNT
LOAD C,DT1DV,(A) ;GET THE DEVICE
MOVSS A ;PUT ARGS IN PROPER ORDER
CALL 0(P1) ;GO DO DEVICE STUFF
JRST DTEDN1 ;ALL DONE
;MORE FUNCTIONS,ETC.
;COMMON ROUTINE USED BY TAKDS AND TAKSTS TO FIND UNIT. MAY BE
;STASHED AWAY IN DTEIND IF PACKET IS INDIRECT OR IN CURRENT
;PACKET
GETUNT: JN INVLD,(A),[
LOAD B,INUNT,(A) ;GET IT FROM INDIRECT WORD
RET] ;AND DONE
ILDB B,D ;NOT INDIRECT. GET IT FROM CURRENT
ILDB B,D ;IS THE SECOND BYTE
SUBI C,2 ;TWO FEWER BYTES
RET ;AND DONE
;-11 IS PROVIDING TIME OF DAY
TAKTOD: CAIGE C,2 ;AT LEAST TWO MORE BYTES?
JRST DNTIME ;NO. MUST NOT BE A TIME THEN
ILDB P1,D ;AND ANOTHER
ILDB B,D ;GET ONE BYTE
SUBI C,2 ;TOOK TWO OF THEM
JUMPE P1,DNTIME ;IF ZERO,NO TIME IN THE -11
CAIGE C,10 ;ENOUGH BYTES
JRST [ BUG(CHK,DTEDAT,<TAKTOD- ILLEGAL FORMAT FOR TIME/DATE>)
JRST DNTIME] ;DONT BELIEVE IT
CALL GTTFLD ;GET YEAR FIELD
HRLM P1,TAD11 ;STORE YEAR
ILDB P1,D ;MONTH
HRRM P1,TAD11 ;TO MEMORY
ILDB P1,D ;DAY OF MONTH
HRLM P1,TAD11+1 ;TO MEMORY
ILDB P1,D ;DAY OF WEEK
HRRM P1,TAD11+1 ;TO MEMORY
MOVX C,IC%DSA!IC%UTZ ;IDCNV BITS
ILDB P1,D ;GET DST FLAG & TIME ZONE
TRZE P1,1B28 ;DST FLAG ON?
TXO C,IC%ADS ;YES - USE DST THEN
STOR P1,IC%TMZ,C ;STORE TIME ZONE
MOVEM C,TAD11+2 ;TO MEMORY
CALL GTTFLD ;GET SECONDS
LSH P1,1 ;*2
HRRM P1,TAD11+2 ;TO MEMORY
JRST DTEDN1 ;ALL FINISHED
DNTIME: SETOM TAD11 ;NONE GIVEN
DMPBFR: JUMPLE C,DTEDN1
IBP C,D ;ADJUST BYTE POINTER
MOVE D,C ;MOVE IT TO CORRECT REGISTER
JRST DTEDN1 ;AND RETURN
GTTFLD: ILDB P1,D ;GET NEXT TIME/DATE FIELD
ILDB C,D ;IN 2 BYTES
LSH P1,10 ;SLIDE FIRST PART OVER
IOR P1,C ;FORM -11 WORD
RET ;AND RETURN
SNDTOD: SETONE DT1TM,(A) ;SAY -11 WANTS TIME OF DAY
JRST DMPBFR ;MAKE SURE ALL IS OK
;MORE FUNCTIONS
;LINE HUNG UP OR DIALED UP
HANGUP: TDZA P1,P1 ;CLEAR P1
DIALUP: MOVEI P1,1 ;DIAL UP
CAIGE C,2 ;ENOUGH BYTES LEFT?
BUG(HLT,DTECAR,<DTESRV- CARRIER FUNCTION WITH NO LINE NUMBER PRESENT>)
LOAD P3,DT1DV,(A) ;GET DEVICE
IMULI A,DTENL ;BIAS THE LINE NUMBER
ALLLNE: ILDB B,D ;GET LINE NUMBER
ILDB P2,D ;THROW AWAY UPPER PART OF WORD
PUSH P,A ;SAVE BASE LINE NUMBER
ADDI B,0(A) ;LINE NUMBER IN B
PUSH P,C
PUSH P,D
MOVEI A,0(P3) ;DEVICE CODE
XCT [ CALL TTYHGU
CALL TTYDLU](P1) ;CALL PROPER ROUTINE
POP P,D
POP P,C
POP P,A ;GET BACK BASE LINE NUMBER
SOS C ;DECREMENT COUNT
SOJG C,ALLLNE ;DO ALL LINES
JRST DTEDN1 ;AND DONE
;LINE BUFFERS EMPTY
EMPTY: CALL EMPTY2 ;GO DO PROCESSING
JRST DMPBFR ;ALL DONE. MAKE SURE BUFFERS ALIGN
EMPTY2: STKVAR <CNTSV,DTESV,PTRSV>
MOVEM A,DTESV
MOVEM C,CNTSV
MOVEM D,PTRSV
LOAD D,DT1DV,(A) ;GET DEVICE -11 IS ACK-ING
CAIL D,MINDEV ;A REASONABLE DEVICE?
CAILE D,MAXDEV ;MAYBE, STILL SO?
JRST LINEA1 ;NO
SKIPE P1,DTEDTV(D) ;A KNOWN DEVICE?
SKIPN P1,DTVACK(P1) ;THIS DEVICE WANT AN ACK?
JRST EMPTY3 ;NO. SKIP THE PACKET
EMPTY1: MOVE A,DTESV ;GET DTE
LOAD A,DT1DV,(A) ;GET FUNCTION DEVICE
ILDB B,PTRSV ;GET LINE NUMBER
ILDB C,PTRSV ;THROW AWAY UPPER HALF
CALL 0(P1) ;GO DO THE POST
SOS CNTSV ;THE DUMMY BYTE
SOSLE CNTSV ;MORE LINES?
JRST EMPTY1 ;YES
EMPTY3: MOVE C,CNTSV ;GET COUNT
MOVE D,PTRSV ;RESTORE BYTE POINTER
RET ;END OF FUNCTION
; ..
;MORE FUNCTIONS....
;TAKE LINE SPEED FROM -11. DONE ON -10 RELOAD
TAKSPD: CAIGE C,6 ;ENOUGH BYTES?
JRST DMPBFR ;NO. IGNORE IT THEN
SUBI C,5 ;YES. WE WILL USE FIVE OF THEM
PUSH P,C ;SAVE RESIDUE COUNT
CALL GETUNT ;GO FIND UNIT NUMBER
LOAD A,DT1DV,(A) ;PICK UP DEVICE FIELD
CALL GTTFLD ;GET INPUT SPEED
MOVSI P2,0(P1) ;SAVE IT
CALL GTTFLD ;GET OUTPUT SPEED
HRRI P2,0(P1) ;FORM SPEED WORD
ILDB C,D ;GET REMOTE INDICATOR
PUSH P,D ;SAVE BP
MOVE D,P2 ;ARG FOR TTYSRV
CALL TTSPST ;GO SET IT UP
POP P,D
POP P,C ;RESTORE IMPORTANT PARAMETERS
JRST DMPBFR ;AND DONE
;MORE FUNCTIONSS
;-11 IS SENDING ITS RELOAD REGISTER INFORMATION:
TAKRLW: CAIGE C,2 ;MUST BE A WORD OF INFORMATION
JRST DMPBFR ;IGNORE IT
ILDB B,D ;GET LOW 8 BITS
ILDB P1,D ;GET HIGH 8 BITS
LSH P1,10 ;ADJUST IT
IORI P1,0(B) ;FORM SWITCH WORD
TRZ P1,(1B2) ;IGNORE RETRY BIT
PUSH P,C
PUSH P,D ;SAVE REGISTERS
CALL SETRGN ;FIND REGIONS
STOR P1,CMRLF,(C) ;SAVE IN MY REGION
POP P,D ;RESTORE REGISTERS
POP P,C
SUBI C,2 ;TOOK 2 BYTES
JRST DMPBFR ;GO ALIGN BUFFERS
;ROUTINE TO ACK ALL UNITS OF ALL DEVICES
TAKACK: MOVSI P1,MINDEV-MAXDEV+.FECTY
HRRI P1,.FECTY+1 ;START BEYOND THE CTY
PUSH P,D ;SAVE SP
PUSH P,C ;SAVE COUNTER
TKACK1: SKIPE C,DTEDTV(P1) ;THIS DEVICE EXIST?
SKIPN C,DTVACK(C) ;YES. WANT AN ACK?
JRST TKACK2 ;NO
MOVE A,DTEDTE ;GET DTE FOR THIS FUNCTION
SETO B, ;SAY TO ACK THEM ALL
CALL 0(C) ;GO DO IT
TKACK2: AOBJN P1,TKACK1 ;GO DO ALL DEVICES
POP P,C
POP P,D
AOS JB0FLG
MOVEI A,1
IORM 1,UPFLAG ;SAY WE NEED MESSAGE
JRST DMPBFR ;GO ALIGN BUFFERS
;MORE FUNCTIONS...
;CODE TO SAVE KLINIK DATA BASE SENT BY THE -11
TAKKLI: CAILE C,KLIMAX ;WILL IT FIT?
JRST [ BUG(CHK,KLIOVF,<DTESRV-KLINIK DATA BASE TOO LARGE>,<C>)
JRST DTEDNE] ;AND IGNORE DATA
MOVEM C,KLIDTA ;SAVE COUNT
MOVE A,[POINT ^D8,KLIDTA+1] ;GET POINTER TO BUFFER
TAKKL1: ILDB B,D ;GET NEXT BYTE
IDPB B,A ;SAVE IT
SOJG C,TAKKL1 ;MOVE ALL BYTES
JRST DTEDNE ;AND DONE
;MORE FUNCTIONS
;-11 IS ENDING LINE ALLOCATION INFORMATION
LINEAL: CALL LINEA2 ;GO DO PROCESSING
JRST DMPBFR ;ALL DONE. MAKE SURE BUFFERS ALIGN
LINEA2: STKVAR <CNTSV,DTESV,PTRSV>
MOVEM C,CNTSV ;SAVE COUNT
MOVEM A,DTESV ;SAVE DTE #
MOVEM D,PTRSV ;SAVE POINTER
LOAD D,DT1DV,(A) ;GET DEVICE CODE
CAIG D,MAXDEV ;A KNOWN DEVICE?
CAIGE D,MINDEV ;?
LINEA1: BUG(HLT,DTEDEV,<LINEAL -ILLEGAL DEVICE>)
SKIPE P1,DTEDTV(D) ;A KNOWN DEVICE?
SKIPN P1,DTVTLA(P1) ;YES. CAN SET LINE ALLOCATION?
JRST EMPTY3 ;NO. GIVE IT UP
CALLRET EMPTY1 ;GO DO COMMON PROCESSING
;-11 IS SENDING ID OF THE CTY
TAKCTY: ILDB B,D ;GET LINE NUMBER
CALL IDCTY ;IDENTIFY IT TO TELETYPE SERVICE
SUBI C,1 ;TOOK ONE BYTE
JRST DMPBFR ;GO ALIGN BUFFERS
;ROUTINE TO HANDLE SENDING OF DEVICE STATUS
TAKSTD: CALL GETUNT ;GET THE UNIT
STOR B,INUNT,(A) ;SAVE UNIT FOR SYSERR
JN DTSTI,(A),[ SETZRO DTSTI,(A) ;CLEAR SPLIT INDICATOR
MOVE B,D ;MOVE POINTER
JRST TAKSTF] ;AND GO
LOAD A,DT1DV,(A) ;GET DEVICE
CAIL A,MINDEV ;A REASONABLE DEVICE?
CAILE A,MAXDEV ;STILL?
TAKSTE: JRST SEEERR ;UNKNOWN, SEE IF SYSERR REQUESTED
SKIPE A,DTEDTV(A) ;A KNOWN DEVICE?
SKIPN A,DTVTLS(A) ;YES. WANT DEVICE STATUS?
JRST TAKSTE ;NO
PUSH P,C ;SAVE COUNT
PUSH P,D ;AND STRING POINTER
CALL 0(A) ;DISPATCH OFF
POP P,D ;RESTORE POINTER
POP P,C ;AND COUNT
SEEERR: ILDB B,D ;GET SOFTWARE STATUS
ILDB B,D ;LOW 8 BITS
SUBI C,2 ;COUNT DOWN THOSE BYTES
TXNN B,.DVFLG ;ERROR LOGGING REQUESTED?
JRST DMPBFR ;GO ALIGN BUFFERS
;CODE TO MAKE FIRST PASS AT SYSERR ENTRY. THIS CODE WILL QUEUE
;UP ALL OF THE DEVICE DEPENDENT ERROR DATA, AND WILL STORE
;THE DEVICE CODE AND THE WORD COUNT OF THE ERROR DATA. IT WILL
;ALSO SCHEDULE A JOB 0 SUBROUTINE TO COMPLETE THE BLOCK
ADDI C,2 ;GET BACK THE SOFTWARE STATUS
MOVNI B,2 ;NUMBER OF BYTES TO RECOVER
IBP B,D ;ADJUST THE BYTE POINTER
TAKSTF: PUSH P,C ;SAVE BYTE COUNT
PUSH P,B ;SAVE BYTE POINTER
ADDI C,3 ;CALCULATE WORDS IN ERROR REPORT
LSH C,-2 ;""
PUSH P,C ;SAVE WORD COUNT
MOVEI A,FE%LEN(C) ;WORDS TO ALLOCATE
MOVEI B,FE%SIZ(C) ;SIZE OF HEADER
CALL ALCSEB ;GET THEM
JRST SEEER1 ;NONE THERE. PUNT
MOVE B,DTEDTE ;GET DTE NUMBER
MOVEM B,FE%DTE+SEBDAT(A) ;SAVE DTE NUMBER IN THE PACKET
LOAD C,INUNT,(B) ;GET UNIT
LOAD B,DT1DV,(B) ;GET DEVICE CODE
HRLI B,0(C) ;MOVE UNIT TO LH
MOVEM B,FE%DEV+SEBDAT(A);SAVE DEVICE CODE
POP P,C ;WORD COUNT FOR ERROR STUFF
MOVNI D,0(C)
HRLM D,FE%PTR+SEBDAT(A) ;SAVE COUNT OF WORDS
POP P,D ;GET DATA STRING
POP P,C ;AND BYTE COUNT
MOVE B,[POINT ^D8,FE%INF+SEBDAT(A)] ;POINTER
MOVEM C,FE%BYT+SEBDAT(A) ;STORE # OF -11 BYTES
SEEER3: ILDB P1,D ;ERROR BYTE
IDPB P1,B ;SAVE IT
SOJG C,SEEER3 ;DO ALL BYTES
MOVE B,[-2,,[ ;INSERT EVENT CODE AND RECALL
SEBPTR 0,SBTEVC,SEC%FE ;EVENT CODE
SEBPTR 0,SBTFNA,SEEER2]] ;RECALL
MOVE P1,D ;SAVE SP
MOVE P2,A ;SAVE POINTER
CALL SEBCPY ;DO COPY
JFCL
MOVE A,P2 ;GET BACK POINTER
CALL QUESEB ;NOW QUEUE IT UP
MOVE D,P1
CALL CHKFRG ;SEE IF MORE TO COME
JRST DTEDN1 ;ALL DONE
SEEER1: POP P,0(P) ;CLEAN UP STACK
POP P,D ;SP
POP P,C ;BYTE COUNT
CALL CHKFRG ;SEE IF MORE TO DO
JRST DMPBFR ;GO ALIGN BUFFERS
;COLLECTION OF ROUTINES TO DO ERROR PROCESSING.
TO11ER:
TO10ER: BUG (CHK,DTEERR,<DTESRV-DTE DEVICE ERROR>,<A,F>)
JRST DINGER ;GO RELOAD THE MACHINE
POW11: CALL DTEPF1 ;TELL -11 ABOUT THE POWER FAIL
JRST DTEPRG ;GO SHUT OFF THIS -11
;ROUTINE TO REQUEST A RELOAD OF THIS MACHINE
LOADME::MOVE A,MSTRDT ;THE MASTER -11
CALL SETRGN ;GO FIND REGIONS
SETONE CML11,(C) ;SET MY RELOAD INDICATOR
CALLRET DING11 ;GO TELL HIM TO DO IT
;ROUTINE CALLED FROM SCHED TO TELL MASTER -11 ABOUT A POWER FAIL
;INTERRUPT
DTEPWF::MOVE A,MSTRDT ;GET MASTER -11
DTEPF1: CALL SETRGN ;FIND COMM REGIONS
SETONE CMPWF,(C) ;SET OUR POWER-FAIL INDICATOR
CALLRET DING11 ;AND TELL THE -11
;ROUTINE TO SEE IF STATUS PACKKET WAS FRAGMENTED
CHKFRG: MOVE A,DTEDTE ;GET DTE NUMBER
MOVE B,DTESTS(A) ;GET STATUS
TXNN B,DTET10!DTET1F ;NOW ACTIVE?
RET ;NO
SETONE DTSTI,(A) ;REMEMBER NEXT PART TO DO LOGGING
RET ;AND DONE
;CODE TO PROCESS TO -10 DONE FROM AN MCB FRONT END TRANSFER
; A/ DTE NUMBER
; C AND D POINT TO COMM REGIONS
DN10MC: JN DTEBC,(A),DTEDNE ;IF MORE TO DO, GO WAIT.
MOVE B,DTEIND(A) ;GET BLOCK ADDRESS
CALL NSPQ ;GO QUEUE IT UP
JRST DTEDNE ;AND DONE
;-10 HAS RECEIVED A TO 10 DOORBELL. MUST FIGURE OUT WHAT THE -11
;WANTS AND HOW TO DO IT
DINGME: CALL SETRGN ;GO FIND THE COMM REGIONS
JN <CMINI,CML11>,(D),DINGER ;WANT RELOAD OR REINIT?
DINGM1: LOAD B,CMVRR,(C) ;GET PROTOCOL TYPE
CAIE B,.VN20F ;IS THIS THE RSX20F FRONT END?
JRST DINGM2 ;NO. DON'T CHECK FOR INDIRECT THEN
JN DT1ID,(A),INDRCT ;YES, COMPLETING AN INDIRECT?
DINGM2: LOAD P1,CM0IC,(C) ;MY TO 10 COUNTER
LOAD P2,CM0IC,(D) ;HIS TO 10 COUNTER
CAMN P2,P1 ;DIFFERENT?
JRST [ CALL CLRBEL ;CLEAR BELL
JRST DTEDNE] ;GO AWAY
CAIE P2,1(P1) ;WITHIN ONE OF ME?
JRST [ CAIN P2,0 ;DID HIS WRAP AROUND?
CAIE P1,377 ;YES. IS MINE AT MAX VALUE?
JRST DINGM3 ;NO. ERROR
JRST .+1] ;YES. ALL IS WELL
STOR P2,CM0IC,(C) ;MAKE COUNTS THE SAME
INDRC1: MOVX B,DTET10!DTET1F ;TO 10 BITS
TDNE B,DTESTS(A) ;IS THERE A TO 10 GOING?
JRST DINGM4 ;YES. ERROR
SETONE CMTOT,(C) ;SET IN TRANSIT BIT
CALL CLRBEL ;CLEAR DOORBELL
LOAD B,CMQCT,(D) ;GET QUEUE COUNT
SKIPG B ;IS IT A VALID COUNT
JRST DINGM5 ;NO. ERROR
CALL DOFRGM ;START TRANSFER IN PROPER PROTOCOL
JRST DTEDNE ;AND DONE
;COMPLETING AN INDIRECT FOR RSX20F PROTOCOL ONLY
INDRCT: JE CMIP,(D),[
LOAD P1,CM0IC,(C) ;MY TO 10 COUNT
LOAD P2,CM0IC,(D) ;HIS TO 10 COUNT
CAIE P1,0(P2) ;COUNTS THE SAME?
JRST DINGM6 ;NO. ERROR
CALL CLRBEL ;YES. CLEAR EXTRANEOUS BELL
JRST DTEDNE] ;GO DISMISS THE INTERRUPT
SETZRO DT1ID,(A) ;CLEAR EXPECTING INDIRECT
LOAD B,INCNT,(A) ;GET COUNT FROM HEADER
OPSTR <CAME B,>,CMQCT,(D) ;SAME AS DATA NOW BEING SENT?
JRST [ BUG (INF,INDCNT,<DTESRV- BAD INDIRECT COUNT>)
JRST DINGER] ;AND DO A RELOAD
JRST INDRC1 ;GO DO THE REQUEST
;ERROR ROUTINES FOR DOORBELL SERVICE
DINGER: SKIPE FEDBSW## ;YES. WANT TO SUPPRESS RELOADS?
JRST DTEDNE ;YES. IGNORE CONDITION
CAME A,MSTRDT ;IS THIS THE MASTER?
CALL [ CALL DTREST ;NO. CLEAR IT
SETZRO DTERL,(A) ;AND SAY NOT RUNNING A PROTOCOL
CALLRET CLRDTE] ;AND DONE
SETONE DTRLD,(A) ;YES. SET RELOAD FLAG
AOS LOAD11 ;TELL JOB 0 OF RELOAD
AOS JB0FLG ;SCHEDULE JOB 0
JRST DTEDNE ;AND GO DISMISS INTERRUPT
;TO -10 COUNTS ARE WRONG
DINGM3: BUG(INF,DTECDM,<DTESRV- TO -10 COUNTS DON'T MATCH>,<A>)
JRST DINGER ;AND GO RELOAD
;TO -10 REQUEST FROM FE WHILE ONE IS IN PROGRESS
DINGM4: BUG (INF,DTEDIN,<DTESRV- TO -10 IN PROGRESS ON DOORBELL>,<A>)
JRST DINGER
;INVALID Q COUNT FROM -11
DINGM5: BUG (INF,DTEDME,<DTESRV- ZERO Q COUNT>,<A>)
JRST DINGER
;INCORRECT INDIRECT SET UP FROM FE
DINGM6: BUG (INF,DTEPNR,<DTESRV- INCORRECT INDIRECT SETUP>,<A>)
JRST DINGER
;ROUTINE TO PROCESS A TO 11 DONE INTERRUPT
TO11DN: MOVE B,CNDO(A) ;CONO WORD
IORI B,DTEEDN ;TO CLEAR 11 DONE
XCT B ;CLEAR THE BIT
CALL SETRGN
LOAD B,CMVRR,(C) ;GET PROTOCOL IN USE
MOVE B,DN11TR(B) ;GET ROUTINE TO PROCESS THIS
JRST 0(B) ;GO TO IT
;PROCESS RSX20F TO -11 DONE
DN11X: LOAD B,DTEST,(A) ;GET STATE OF DTE
TXZE B,DTE11 ;DOING TO 11?
JRST DN11 ;YES. GO HANDLE IT
TXZE B,DTE11I ;DOING INDIRECT?
JRST DN11I ;YES
RET ;ALL DONE
DN11I: TXO B,DTE11 ;DOING REGULAR 11
STOR B,DTEST,(A) ;NEW STATE
HRRZ B,DTEQS(A) ;GET QUEUE PACKET
LOAD D,QCNT,(B) ;GET BYTE SIZE
CAILE D,MAXINP ;TOO BIG FOR PROTOCOL?
MOVEI D,MAXINP ;YES. FRAGMENT IT THEN
STOR D,CMQCT,(C) ;TO MY REGION
LSH A,SDTE ;*4
JN QMODE,(B),[ ;FORCE BYTE MODE?
LOAD B,QPNTR,(B) ;YES. GET BYTE POINTER
JRST NOTWRD] ;AND GO DO IT
LOAD B,QPNTR,(B) ;GET BYTE POINTER
TLNN B,100000 ;EVEN # OF BYTES IN FIRST WORD?
TRNE D,1 ;YES. EVEN # OF BYTES IN MESSAGE?
JRST NOTWRD ;NO. SEND IN BYTE MODE THEN
LDB D,[POINT 6,B,11] ;GET BYTE SIZE
CAIN D,10 ;8 BITS?
JRST [ MOVEI D,^D16 ;YES. DO IT FULL WORD THEN
DPB D,[POINT 6,B,11]
SETONE CMFWD,(C) ;TELL -11 IT IS FULL WORD
JRST .+1]
NOTWRD: MOVEM B,DTEEBP(A) ;SET UP BYTE POINTER
LSH A,-SDTE ;RESTORE A
SETONE CMIP,(C) ;TELL -11 ALL IS OKAY
CALL DING11 ;GO DING -11
RET ;ALL DONE
DN11: STOR B,DTEST,(A) ;NEW STATE
SETZRO CMIP,(C) ;NOT DOING INDIRECT ANYMORE
HRRZ B,DTEQS(A) ;DEQUEUE THE PACKET
CALL TSTSGL ;IS THIS A SINGLE PACKET GROUP?
JRST DNSNGL ;YES. GO DO SPECIAL POSTING
LOAD D,QCNT,(B) ;SEE IF IT WAS INDIRECT
JUMPE D,DEQDTE ;NO. GO ON TO THE DEQUEUE LOGIC
CAIG D,MAXINP ;YES. DID WE SEND IT ALL?
JRST DEQDTE ;YES. GO ON
;..
;INDIRECT REQUEST MUST BE PARTITIONED. DO NEXT PART
SUBI D,MAXINP ;SAY SENT ONE SECTION
STOR D,QCNT,(B) ;ABD STASH AWAY NEW COUNT
MOVEI D,MAXINP ;COUNT OF BYTES SENT
LOAD C,QPNTR,(B) ;GET BYTE POINTER
IBP D,C ;ADJUST IT
STOR D,QPNTR,(B) ;NEW BYTE POINTER
CALL DTESKD ;GO DO NEXT PART
RET ;AND DONE
;DEQUEUE COMPLETED REQUEST,POST IT, AND SCHEDULE NEXT REQUEST
DEQDTE: LOAD C,QLINK,(B) ;GET NEXT GUY
HRRM C,DTEQS(A) ;NEW HEAD
SKIPN C ;HAVE A HEAD?
SETZM DTEQS(A) ;NO. CLEAR THE WORD
LOAD C,QINT,(B) ;INTERRUPT GUY
PUSH P,C ;SAVE INTERRUPT
LOAD C,QDEV,(B) ;DEVICE CODE
PUSH P,C ;SAVE IT
LOAD C,QCOD,(B) ;UNIQUE CODE
PUSH P,C ;SAVE THIS AS WELL
LOAD C,QLIN,(B) ;UNIT
PUSH P,C ;SAVE IT
PUSH P,A ;SAVE DTE NUMBER
LSH A,SDTE ;FIND EPT OFFSET FOR THIS DTE
SETZM DTEEBP(A) ;CLEAR TO -11 POINTER
MOVE A,B
CALL RELNOD ;FREE THE NODE
POP P,A ;DTE NUMBER
MSTSKD: OPSTR <SKIPE>,DTERL,(A) ;MAKE SURE DTE IS ACTIVE
CALL DTESKD ;START DTE AGAIN
POP P,B ;UNIT
POP P,A ;CODE
POP P,C ;DEVICE CODE
POP P,D ;ADDRESS
SKIPE D ;HAVE ONE?
CALL 0(D) ;YES. GO HANDLE IT
RET ;ALL DONE
;TRANSFER VECTOR FOR TO -11 DONE
DN11TR: DN11X ;RSX20F PROTOCOL
DN11MC ;MCB PROTOCOL
;ROUTINE TO POST A SINGLE CHARACTER DONE
DNSNGL: LDB P1,[POINT 6,0(B),17] ;GET COUNT OF ENTRIES
LOAD C,QLINK,(B) ;GET Q LINK
HRRM C,DTEQS(A) ;NEW HEADER
SKIPN C ;Q NOW EMPTY?
SETZM DTEQS(A) ;YES
SETZM 0(B) ;CLEAR ALL FLAGS
MOVEI P2,SNGHDR(B) ;FIRST CHARACTER
CALL DTESKD ;REACTIVATE THE DTE
HRLI P2,(POINT ^D16,) ;MAKE A BYTE POINTER
SNGPST: ILDB B,P2 ;GET AN ENTRY
LSH B,-^D8 ;LINE NUMBER ONLY
SETZ A, ;NO CODE
MOVEI C,.FEDLS ;THE DSL
CALL TTYINT ;GO DO THE POST
SOJG P1,SNGPST ;DO ALL
RET ;AND DONE
;TEST IF PACKET POINTED TO BY B IS A SINGLE PACKET GROUP.
;INPUT B/ POINTER
;RETURNS: +1 IS A SINGLE GROUP
; +2 IS NOT
TSTSGL: MOVE D,0(B) ;GET FLAGS
TLNE D,(1B0) ;IS IT?
TLNN D,(1B1) ;MAYVE
RETSKP ;NO
RET ;YES
;ROUTINE TO PROCESS A TO -11 DONE FOR A FE RUNNING MCB PROTOCOL
DN11MC: SAVEQ ;GET WORK REGS
HRRZ B,DTEQS(A) ;GET PACKET WE JUST COMPLETED
LOAD Q1,DTEST,(A) ;GET CURRENT STATE OF THE DTE
TXZN Q1,DTE11 ;DONE WITH DATA TRANSFER?
RET ;NO. IGNORE THE INTERRUPT THEN
STOR Q1,DTEST,(A) ;YES. SAVE NEW STATE
JRST DEQDTE ;AND GO FINISH UP THIS REQUEST
;ROUTINE TO START A TO 10 TRANSFER. ACCEPTS:
; A/DTE NUMBER
; B/ BYTES LEFT IN QUEUE
;RETURNS +1 WITH
; A/DTE NUMBER
; B/CLOBBERED
; C/OLD COUNT FROM DTEB1
; D/BUFFER POINTER BIT FOR LAST OPERATION
DOFRGM: SAVEP ;PRESERVE THESE
PUSH P,B ;SAVE INPUT
CALL SETRGN ;GO FIND HIS REGION
POP P,B
LOAD P5,CMVRR,(C) ;GET PROTOCOL TYPE
JRST @DOFRTR(P5) ;GO HANDLE PROPER PROTOCOL
;CODE FOR RSX20F PROTOCOL
DOFRRS: LOAD P5,CMFWD,(D) ;GET WORD/BYTE INDICATOR
LOAD C,DTEBF,(A) ;GET CURRENT BUFFER BIT
MOVE D,C ;SAVE FOR CALLER
TRC C,1 ;NEXT BUFFER
STOR C,DTEBF,(A) ;STORE THIS AS CURRENT BUFFER
XCT [ HRRZ P4,DTBFWD(A)
HLRZ P4,DTBFWD(A)](C) ;PICK UP BUFFER BASE
HRLI P4,(<POINT ^D8,0>) ;MAKE IT A POINTER
SKIPE P5 ;DOING BYTE MODE?
HRLI P4,(<POINT ^D16,0>) ;NO. GET WORD POINTER THEN
LOAD C,DTEB1,(A) ;GET PREVIOUS COUNT
CAIG B,BYTBUF ;ROOM IN A BUFFER FOR THIS MESSAGE?
JRST [ SETZRO DTEBC,(A) ;YES. NO PENDING OPERATION THEN
STOR B,DTEB1,(A) ;NCURRENT COUNT
SKIPE P5 ;BYTE TRANSFER?
LSH B,-1 ;NO. CALCULATE 16 BIT COUNT
MOVNI B,0(B) ;GET NEG WORD COUNT
ANDI B,7777 ;ONLY 12 BITS FOR THE DTE
IORI B,1B23 ;SET I BIT TO INFORM 11
MOVEI P2,DTET10 ;DOING A TO 10 TRANSFER
JRST SET1] ;AND GO DO IT
MOVEI P2,DTET1F ;DOING A FRAGMENTED MESSAGE
SUBI B,BYTBUF ;FIND RESIDUE
STOR B,DTEBC,(A) ;SAVE IT FOR LATER
MOVNI B,BYTBUF ;NUMBER OF BYTES
SKIPE P5 ;BYTE MODE?
ASH B,-1 ;NO. GET WORD COUNT THEN
ANDI B,7777 ;ONLY WANT 12 BITS
MOVEI P1,BYTBUF
STOR P1,DTEB1,(A) ;REMEMBER THIS COUNT
; ..
; ..
;READY TO START THE TO -10 TRNASFER
SET1: LSH A,SDTE ;FIND DTE REGION
MOVEM P4,DTETBP(A) ;STORE APPROPRIATE BYTE POINTER
LSH A,-SDTE ;RESTORE DTE NUMBER
SET2: IORM P2,DTESTS(A) ;INSERT STATUS WORD
MOVE P1,DATO(A) ;DATAO WORD
IORI P1,B ;WHERE DATA LIVES
XCT P1 ;DO TRANSFER
RET ;AND DONE
;TRANSFER VECTOR FOR DOFRGM
DOFRTR: IFIW!DOFRRS ;FOR RSX20F
IFIW!DOFRMC ;FOR MC PROTOCOL
;CODE TO HANDLE TO -10 TRANSFER FOR MCB PROTOCOL
DOFRMC: LOAD P5,DTEBC,(A) ;GET RESIDUAL COUNT
JUMPE P5,DOFMCI ;GO GET A FREE BLOCK
LOAD B,CMPCT,(D) ;GET PIECEMEAL COUNTER
LOAD P3,CMTMD,(D) ;AND GET MODE OF THIS TRANSFER
OPSTR <CAME P5,>,CMQCT,(D) ;DOES MCB AGREE WITH US?
BUG (HLT,DTEMCC,<DOFRGM-MCB DISAGREES WITH COUNT>) ;NO
SUB P5,B ;COMPUTE NEW RESIDUAL COUNT
STOR P5,DTEBC,(A) ;STASH IT
CAIE P3,.TMBYT ;BYTE MODE TRANSFER?
LSH B,-1 ;NO. HALVE NUMBER THEN
MOVNI B,0(B) ;GET NEG OF COUNT
ANDI B,7777 ;MAKE IT 12 BITS
IORI B,1B23 ;SET I BIT
MOVEI P2,DTET10 ;SAY DOING TO -10 TRANSFER
JRST SET2 ;AND GO DO THE TRANSFER
;ROUTINE TO START A NEW TRANSFER
DOFMCI: PUSH P,A ;SAVE DTE NUMBER
LOAD B,CMQCT,(D) ;GET COUNT OF ENTIRE MESSAGE
STOR B,DTEBC,(A) ;SAVE STARTING COUNT
CALL NSPSPC ;GO GET A BLOCK FOR MCB TRANSFER
; A= DTE #, B=BYTES REQUIRED
JRST [ POP P,A ;RESTORE DTE NUMBER
SETONE DTBLK,(A) ;SAY THIS DTE IS BLOCKED FOR FREE SPACE
RET] ;AND GIVE UP
MOVE P1,A ;SAVE ADDRESS
POP P,A ;GET BACK DTE NUMBER
MOVEM P1,DTEIND(A) ;SAVE STARTING ADDRESS
CALL SETRGN ;FIND REGIONS AGAIN
LOAD B,CMTMD,(D) ;GET MODE OF THESE TRANSFERS
HRLI P1,(<POINT ^D8,>) ;ASSUME BYTE MODE
CAIE B,.TMBYT ;IS IT?
HRLI P1,(<POINT ^D16,>) ;NO. MAKE IT WORDS THEN
LSH A,SDTE ;FIND PROPER DTE GROUP
MOVEM P1,DTETBP(A) ;STORE INTO THE EPT
LSH A,-SDTE ;RESTORE DTE NUMBER
JRST DOFRMC ;AND GO DO IT
;ROUTINE USED BY TTYSRV TO QUEUE UP A SINGLE CHARACTER OUTPUT
;REQUEST. THESE REQUESTS ARE HANDLED SPECIALLY IN THAT THEY ARE
;PACKED TOGETHER IN A SPECIAL PACKET.
;INPUT IS:
; B/ FUNCTION,,DEVICE
; C/ UNIT,,
; D/ BYTE
DTSNGL::CALL DTSNG0 ;DO WORK
JRST DTSNG3 ;COULDN'T DO IT
RETSKP ;SUCCESS
;WORKER ROUTINE
DTSNG0: SAVEP ;GET SOME WORK REGS
SE0ENT ;ENTER SEC 0 HERE
MOVE A,MSTRDT ;TO THE MASTER -11
MOVEI P3,SNGPK1 ;ADDRESS
MOVE P4,SNGPK1 ;LOOK AT THIS ONE
TXNN P4,SNGACT ;INACTIVE?
TXNE P4,SNGAVL ;YES, THIS PACKET AHVE SPACE IN IT?
JRST DTSNG1 ;NO. TRY OTHERS
JRST DTSNG6 ;GO DO COMMON CODE
DTSNG1: MOVE P4,SNGPK2 ;GET FLAGS
MOVEI P3,SNGPK2
TXNN P4,SNGACT ;INACTIVE?
TXNE P4,SNGAVL ;THIS ONE HAVE ROOM?
JRST [ SE1CAL ;RETRUN IN SEC1 IF NECESSARY
RET]
DTSNG6: CALL DTSNG2 ;GO ADD BYTE
SE1CAL ;RETURN IN SE1 IF NECESSARY
RETSKP ;DONE
; ..
;DTSNGL...
;WORKER ROUTINE TO ADD BYTE TO SINGLE PACKET
DTSNG2: TXOE P4,SNGONQ ;ON THE QUEUE YET?
JRST DTSNG4 ;YES. GO ADD THE DATUM
TXO P4,3B1 ;SAY IS A SINGLE PACKET GROUP
HLRZ P1,DTEQS(A) ;NO. MUST ADD IT
HRLM P3,DTEQS(A) ;ADD IT TO THE TAIL
SKIPN P1 ;EMPTY QUEUE?
JRST [ HRRM P3,DTEQS(A) ;YES. MAKE IT THE HEAD ALSO
JRST DTSNG5]
STOR P3,QLINK,(P1) ;NO. LINK THIS ONE IN
DTSNG5: SETZRO QLINK,(P3) ;THIS ONE DOESN'T LINK
DMOVE P1,[BYTE (^D16) 10,.DFHLC
BYTE (^D16) .FEDLS,0]
DMOVEM P1,1(P3)
DTSNG4: MOVSI P1,(2B15) ;INCREASE Q COUNT
ADDM P1,1(P3) ;DO IT
LDB P1,[POINT 6,P4,17] ;GET COUNT OF ENTRIES IN QUEUE
IDIVI P1,2 ;ENTRIES PER -10 WORD
ADDI P3,SNGHDR(P1) ;WORD TO PUT IT IN
MOVEI B,0(B) ;DEVICE
CAIN B,.FECTY ;IS THIS THE CTY?
MOVS C,CTYUNT ;YES. GET REAL NAME
LSH C,-^D10 ;POSITION LINE NUMBER
IORI C,0(D) ;MERGE IN BYTE
XCT [ DPB C,[POINT ^D16,0(P3),15]
DPB C,[POINT ^D16,0(P3),31]](P2)
LDB P2,[POINT 6,P4,17] ;GET RESIDENT COUNT
AOS P2 ;INCREASE IT
CAIL P2,MAXSGL ;FULL?
TXO P4,SNGAVL ;YES. NO MORE THEN
DPB P2,[POINT 6,P4,17] ;PUT BACK THE COUNT
SUBI P3,SNGHDR(P1) ;BACK TO TOP OF PACKET
HLLM P4,0(P3) ;SET UP NEW FLAGS
MOVX B,DTE11!DTE11I ;ACTIVE STATUS
TDNN B,DTESTS(A) ;IS IT ACTIVE?
CALL DTESKD ;NO. GO START IT
RET ;AND DONE
;COULD NOT PUT ENTRY IN EITHER SINGLE PACKET. USE CONVENTIONAL
;MECAHNISM
DTSNG3: MOVSI A,TTYINT ;THE INTERRUPT LOCATION
CALLRET DTEQ ;DO IT
;THIS IS THE DTE REQUEST QUEUER. FOR RSX20F PROTOCOL ACCEPTS:
; F/DRIVER UNIQUE CODE
; A/DRIVER INT LOC,,DTE NUMBER
; B/DTE FUNCTION CODE,,FE DEVICE CODE
; C/UNIT NUMBER,,BYTE COUNT OR ZERO
; BIT 18 OF C IS A ONE IF INDIRECT DATA MUST BE SENT
; IN BYTE MODE. IF 0, THEN DTESRV DECIDES HOW TO PACKAGE
; AND SEND THE BYTES
; D/INDIRECT BYTE POINTER (IF RH OF C NE 0) OR LOCAL DATUM
; IF LOCAL DATUM SPECIFIED (I.E. RH OF C EQ 0) THEN
; IF LH OF C =0, DATUM IS 16 BITS. IF LINE NUMBER
; IS NON-ZERO, THEN DATUM IS 8 BITS.
;AND FOR MCB PROTOCOL ACCEPTS:
; F/ DRIVER UNIQUE CODE
; A/ DRIVER INT LOC,,DTE NUMBER
; B/ BYTE POINTER TO NSP DATA (WITH OR WITHOUT HEADER)
; C/ COUNT OF BYTES IN DATA POINTED TO BE B
;
; RETURNS:
; +1 IF NO PACKETS AND CALLED FROM SCHEDULER. REQUEST NOT
; QUEUED.
; +2 REQUEST QUEUED
;
;MAY BE CALLED FROM PI OR NON-PI LEVEL .
; ..
; ..
;NOW FOR THE CODE OF DTEQ
RQTAD1:: ;ALTERNATE ENTRYPOINT FOR REQUEST TIME AND DATE 11
MOVSI B,.DFRTD ;GET TIME/DATE FUNCTION
MOVE A,MSTRDT ;THE MASTER -11
SETZM C ;NO UNIT - SEND DIRECT
DCNMSO::
DTEQ:: SE0ENT ;ENTER SECTION 0
CALL DTEQ12 ;CALL SUBROUTINE
SKIPA
AOS 0(P) ;PLAN FOR SKIP RETURN
SE1CAL ;CLEAR FLAGS
RET ;AND RETURN
DTEQ12: JE DTERL,(A),R ;IF NON-EX, GIVE UP NOW
STKVAR <SAVF,SAVA,SAVB,SAVC,SAVD,PISTAT,PROVER> ;SAVE REGS HERE
MOVEM A,SAVA ;SAVE ALL ARGS
HRRZS A ;ISOLATE DTE NUMBER
CAIL A,DTEN ;A KNOWN DTE?
BUG (HLT,INVDTE,<DTEQ- INVALID DTE SPECIFIED>)
CAMN A,MSTRDT ;IS THIS THE MASTER?
SKIPE FEFLG ;YES. PRIMARY PROTOCOL AVAILABLE?
SKIPA ;ALL SET
RETSKP ;NO PROTOCOL INIT. IGNORE REQUEST
MOVEM B,SAVB
MOVEM C,SAVC
MOVEM D,SAVD
MOVEM F,SAVF ;SAVE UNIQUE CODE AS WELL
CALL SETRGN ;GO GET COMM REGION POINTERS
LOAD C,CMVRR,(C) ;GET PROTOCOL VERSION
MOVEM C,PROVER ;SAVE IT FOR LATER
SETZM PISTAT ;ASSUME PI IS ON
CONSO PI,1B<DLSCHN+^D28> ; IS IT?
SETOM PISTAT ;NO. REMEMBER THIS
CONSO PI,1B<DLSCHN+^D20> ;AT DTE PI LEVEL?
SKIPE INSKED ;FROM SCHEDULER?
SKIPA ;YES. CAN'T BLOCK
SKIPE NSKED ;NO. ARE WE NOSKED?
JRST [ CALL ASGNDI ;YES. CANT BLOCK THEN
RET ;NONE THERE. FOO
JRST HAVNOD] ;GO INLINE WITH BUFFER
CALL ASGNOD ;GET A REQUEST NODE
JFCL ;WILL NOT HAPPEN IF NON PI
HAVNOD: MOVEI D,0(A) ;MOVE ADDRESS
HLRZ B,SAVA ;INT LOC
STOR B,QINT,(D) ;TO THE REQUEST
SETZRO QMODE,(D) ;ASSUME FREE CHOICE ON INDIRECT
HRRZ B,SAVC ;COUNT OR DATUM
STOR B,QCNT,(D) ;STORE COUNT
TXZE B,DTBYTM ;FORCE BYTE MODE?
JRST [ SETONE QMODE,(D) ;YES
JRST .+1] ;PROCEED
MOVE C,PROVER ;GET PROTOCOL VERSION NUMBER
CAIE C,.VN20F ;IS THIS RSX20F PROTOCOL?
JRST [ MOVE C,SAVB ;NO. GET NSP HEADER INFORMATION
STOR C,QPNTR,(D) ;STORE IT
JRST DTEQ13] ;AND CONTINUE
HLRZ C,SAVB ;THE FUNCTION CODE
SKIPE B ;AN INDIRECT INDICATOR?
TRO C,1B20 ;YES. MARK IT AS SUCH
STOR C,QFNC,(D) ;AND THE FUNCTION
HLRZ C,SAVC ;UNIT NUMBER
STOR C,QLIN,(D) ;TO THE PACKET
HRRZ B,SAVB ;DEVICE CODE
STOR B,QDEV,(D) ;TO REQUEST
MOVE B,SAVD ;BYTE POINTER OR DATUM
STOR B,QPNTR,(D) ;STORE POINTER OR DATUM
DTEQ13: MOVE B,SAVF ;GET UNIQUE CODE
STOR B,QCOD,(D) ;PUT IN THE PACKET
HRRZ A,SAVA ;DTE NUMBER
SKIPN PISTAT ;PI OFF BY CALLER?
CONSZ PI,1B<DLSCHN+^D20> ;AT DTE PI LEVEL?
JRST DTEQ1 ;YES
NOSKD1 ;PROTECT THE DATA STRUCTURES
CHNOFF DLSCHN ;AND AGAIN
DTEQ1: HLRZ B,DTEQS(A) ;GET TAIL
HRLM D,DTEQS(A) ;MAKE THIS THE TAIL
SKIPN B ;WAS Q EMPTY?
JRST [ HRRM D,DTEQS(A) ;YES
JRST OCUPID] ;AND GO INLINE
STOR D,QLINK,(B) ;NO. ADD THIS ONE
OCUPID: SETZRO QLINK,(D) ;THIS ONE HAS NO LINK
LOAD B,DTEST,(A) ;GET STATUS OF THIS DTE
TXNN B,DTE11!DTE11I ;IS TO 11 IDLE?
CALL DTESKD ;GO START UP THE DTE
SKIPN PISTAT ;PI OFF BY CALLER?
CONSZ PI,1B<DLSCHN+^D20> ;AT DTE PI?
RETSKP ;YES. JUST RETURN
CHNON DLSCHN ;TURN ON THE DTE AGAIN
OKSKD1 ;AND THE SCHEDULER
RETSKP ;AND RETURN
;ROUTINE TO START A TO 11 OPERATION FROM THE TOP OF THE DRIVER
;QUEUE
;ACCEPTS A/ DTE NUMBER
;TRANSFER VECTOR FOR PROTOCOL TYPES
SKDVEC: SKVER1 ;ROUTINE FOR RSX20F PROTOCOL
SKVER2 ;ROUTINE FOR MCB DECNET PROTOCOL
DTESKD: SKIPN DTEQS(A) ;A REQUEST?
RET ;NO. ALL DONE THEN
JN DTRLD,(A),R ;IF RELOADING -11, DON'T DO ANYTHING
CALL SETRGN ;GO FIND MY COMM REGION TO THIS -11
LOAD D,CMVRR,(C) ;GET PROTOCOL VERSION NUMBER
MOVE D,SKDVEC(D) ;GET ROUTINE TO DO THIS PROCESSING
SKIPE B,DTEQS(A) ;MAKE SURE STILL A REQUEST THERE
JRST 0(D) ;GO TO THE ROUTINE
RET ;NO REQUEST. GIVE UP
;CODE TO PROCESS PROTOCOL VERSION 1 PACKETS (RSX20F)
; A/ DTE NUMBER
; B/ PACKET
SKVER1: CALL TSTSGL ;IS IT A SINGLE CHARACTER GROUP?
JRST [ MOVX C,DTE11 ;TO -11 STATUS
IORM C,DTESTS(A) ;SET IT
MOVX C,SNGACT ;GET ACTIVE BIT
IORM C,0(B) ;SAY SO
CALL SETRGN
MOVEI B,1(B) ;THE DATA
EXCH B,C
LDB D,[POINT ^D16,0(C),15] ;BYTES
JRST DTSKDM] ;GO DO IT
JE QFNC,(B),DEQDTE ;IF FLUSHED, POST ONLY
MOVEI C,0(A) ;DTE NUMBER
IMULI C,PKTSIZ ;SIZE OF QUEUE PACKET
ADDI C,PKTADR ;GET BASE ADDRESS OF THIS PACKET
LOAD D,QDEV,(B) ;DEVICE CODE
STOR D,HDDEV,(C) ;TO THE QUEUE
LOAD D,QFNC,(B) ;THE FUNCTION
STOR D,HDFNC,(C) ;TO THE QUEUE
SETZRO HDSPR,(C) ;ZERO THE SPARE
LOAD D,QCNT,(B) ;GET THE COUNT
JUMPN D,[CAILE D,MAXINP ;CAN WE SEND IT ALL?
MOVEI D,MAXINP ;NO. SEND MAX NUMBER
STOR D,HDDAT,(C) ;PUT SIZE IN PACKET
LOAD D,DTEST,(A) ;DTE STATE
TXO D,DTE11I ;DOING INDIRECT
STOR D,DTEST,(A);NEW STATE
SETZRO HDLIN,(C) ;CLEAR OUT LINE NUMBER FIELD
JRST STOREG] ;GO STORE IN MY REGION
LOAD D,QPNTR,(B) ;GET DATUM
STOR D,HDDT1,(C) ;STORE IN PACKET
LOAD D,DTEST,(A) ;DTE STATE
TXO D,DTE11 ;REGULAR 11
STOR D,DTEST,(A) ;NEW STATE
; ..
; ..
STOREG: MOVEI D,12 ;INCLUDE DATUM
STOR D,HDCNT,(C) ;TO THE PACKET
LOAD D,QLIN,(B) ;UNIT
JUMPE D,STORG1 ;IF NO LINE GIVEN,ALLOW FOR 16 BIT DATUM
STOR D,HDLIN,(C) ;TO THE QUEUE
STORG1: PUSH P,C ;SAVE QUEUE POINTER
CALL SETRGN ;GET MY COMM REGION
MOVE B,C ;MOVE MY COMM REGION POINTER
POP P,C ;RESTORE Q POINTER
MOVEI D,12 ;THE COUNT OF THIS ONE
DTSKDM: HRLI C,(<POINT ^D8,0>) ;POINTER
SETZRO CMFWD,(B) ;DOING BYTE MODE
DTSTRT: STOR D,CMQCT,(B) ;STORE THE COUNT
LOAD D,CM1IC,(B) ;TO -11 COUNT
AOS D
STOR D,CM1IC,(B) ;UP IT
LSH A,SDTE ;*4
MOVEM C,DTEEBP(A) ;STORE POINTER
LSH A,-SDTE ;/4
CALL DING11 ;GO START THE -11
RET ;AND DONE
;ROUTINE TO HANDLE PROTOCOL VERSION 2 PACKETS (MCB)
; A/ DTE NUMBER
; B/ PACKET
; C/ COMM REGION POINTER
SKVER2: SAVEQ ;SAVE REGS
LOAD Q3,QPNTR,(B) ;GET POINTER
LDB Q1,[POINT 6,Q3,11] ;GET BYTE SIZE
MOVEI Q2,.TMBYT ;ASSUME BYTE
CAIN Q1,^D16 ;A WORD POINTER?
MOVEI Q2,.TMWRD ;YES. DO WORD MODE THEN
CAIE Q1,^D8 ;EIGHT BITS?
JRST SKVR22 ;NO. ALL SET THEN
REPEAT 0,< ;UNIMPLEMENTED MODE
LOAD Q1,QCNT,(B) ;YES. GET THE CURRENT COUNT
TRNE Q1,1 ;IS IT AN EVEN NUMBER OF BYTES?
JRST SKVR22 ;NO. DO BYTE MODE THEN
MOVEI Q2,.TMBWD ;YES. DO BYTES IN WORD MODE
MOVEI Q1,^D16 ;MAKE IT 16 BIT BYTE POINTER
DPB Q1,[POINT 6,Q3,11] ; BY CHANGING BYTE POINTER WORD
STOR Q3,QPNTR,(B) ;IN THE DATA PACKET
> ;END OF REPEAT 0
SKVR22: STOR Q2,CMTMD,(C) ;PUT IN MODE OF THE TRANSFER
MOVX D,DTE11 ;SAY REGULAR TRANSFER IN PROGRESS
IORM D,DTESTS(A) ;""
LOAD D,QCNT,(B) ;GET Q COUNT
CAIN Q2,.TMWRD ;WORD MODE?
LSH D,1 ;YES. COMPUTE # OF 8 BIT BYTE THEN
STOR D,CMPCT,(C) ;STORE COUNT OF THIS TRANSFER
MOVE B,Q3 ;BYTE POINTER TO B
EXCH B,C ;FIX UP REGS
JRST DTSTRT ;AND GO START THE DTE
;SPECIAL ROUTINES TO RING -11'S DOORBELL ,TO MANIPULATE THE
;PI CAPABILITY, TO RESET THE DTE, AND TO FINE COMM REGION POINTERS
;RING -11'S DOORBELL
; A/ DTE NUMBER
;CLOBBERS B
DING11: MOVE B,CNDO(A)
IORI B,DTEEDB ;THE -11'S BELL
XCT B
RET ;AND DONE
;CLEAR DOORBELL
CLRBEL: MOVE B,CNDO(A)
IORI B,DTETDB ;DOORBELL BIT
XCT B ;CLEAR IT
RET ;AND DONE
;ROUTINE TO RESET A DTE. TURNS OFF ITS INTS. ANY CONDITIONS
;ACCEPTS: A/ DTE #
DTREST: MOVE B,CNDO(A) ;GET PROTOTYE CONO
IORI B,DTEPIE!DTETDB!DTETDN!DTEEDN
XCT B ;CLEAR ALL CONDITIONS
RET ;DONE
;ROUTINE TO INIT INT STATE OF A DTE
;ACCEPTS: A/ DTE #
DTPII: CALL DTREST ;FIRST RESET IT
MOVE B,CNDO(A) ;GET PROTOTYPE CONO
IORI B,LDTEPI ;GET PI ASSIGNMENT
XCT B ;SET IT
RET ;AND DONE
;ROUTINE TO SET UP COMM REGION POINTERS. ACCEPTS:
; A/ DTE NUMBER
;RETURNS:
; C/ POINTER TO -10'S PER PROCESS REGION
; D/ POINTER TO -11'S PER PROCESS REGION
SETRGN: MOVEI C,0(A) ;THE DTE NUMBER
IMULI C,COMRGN ;SIZE OF A PER PROCESS REGION
ADDI C,COMBAS+COMDAT ;BASE OF -10'S REGION TO THE -11
MOVNI D,2(A) ;NOW FIND THE -11'S
HRRZ D,COMBUF+DTEN+1(D) ;GET VALUE FROM POINTER
ADDI D,COMBAS+COMDAT ;MAKE IT ABSOLUTE POINTER TO -11'S REGION
RET ;AND DONE
;ROUTINE TO FLUSH ALL OUTPUT REQUEUST FOR A GIVEN TTY UNIT.
;ACCEPTS: A/DTE #
; B/DEVICE
; C/UNIT,,0
;RETURNS: +1 WITH OUTPUT REQUESTS FLUSHED
;CLOBBERS ALL TEMP REGISTERS EXCEPT A,B,C
;MUST BE NOINT AND CHNOFF ON THE DTE CHANNEL
RESCD ;IS RESIDENT
DTEFLO::STKVAR <SVDTN,SVLIN,SVDEV>
SE0ENT
MOVEM A,SVDTN ;SAVE DTE NUMBER
MOVEM B,SVDEV ;SAVE DEVICE CODE
MOVSM C,SVLIN ;SAVE LINE NUMBER (FROM LH)
HRLI A,DTEQS(A) ;INITIAL PREVIOUS
HRRZ C,DTEQS(A) ;TOP ITEM
JUMPE C,SKPPK1 ;IF EMPTY, JUST WRAP UP
CHKPKT: MOVE B,C ;MOVE POINTER
CALL TSTSGL ;IS THIS A SINGLE BYTE GROUP?
JRST SKPPKT ;YES. SKIP IT
LOAD B,QDEV,(C) ;DEVICE CODE
CAME B,SVDEV ;SAME DEVICE?
JRST SKPPKT ;NO. SKIP IT
LOAD B,QLIN,(C) ;LINE NUMBER
CAME B,SVLIN ;SAME LINE?
JRST SKPPKT ;NO. GO TO NEXT
LOAD B,QFNC,(C) ;SEE ABOUT FUNCTION
TRZ B,1B20 ;IGNORE INDIRECT CODE
CAIE B,.DFHLC ;AN OUTPUT?
CAIN B,.DFHSD ;OR THIS FLAVOR?
SKIPA ;YES. MUST FLUSH IT
JRST SKPPKT ;NO. LEAVE IT
SETZRO QFNC,(C) ;YES. MARK IT AS FLUSHED
SETZRO QCOD,(C) ;AND PREVENT ACCOUTNING
SKPPKT: HRL A,C ;ESTABLISH NEW PREVIOUS
LOAD C,QLINK,(C) ;GET LINK
JUMPN C,CHKPKT ;GO LOOK AT IT
SKPPK1: MOVE A,SVDTN ;RESTORE DTE NUMBER
MOVE B,SVDEV ;RESTORE DEVICE
MOVS C,SVLIN ;RESTORE LINE (TO LH)
SE1CAL ;ENTER SEC1 FOR RETURN
RET ;AND DONE
;ROUTINE CALLED FROM APRSRV TO WAIT FOR ALL DTE'S
;TO COMPLETE TRANSFERS.MUST BE CALLED PIOFF AND NOT
;FROM INTERRUPT LEVEL
DTEINA::ACVAR <Q1> ;GET A WORK REG
MOVSI Q1,-DTEN ;LOOK AT THEM ALL
DTENA0: JE DTERL,(Q1),DTENA1 ;IF NOT RUNNING, SKIP IT
MOVX A,DTET10!DTET1F ;SEE IF TO -10 IN PROGRESS
TDNN A,DTESTS(Q1) ;IS IT?
JRST DTENA2 ;NO. CHECK ON TO -11
MOVE B,CNDO(Q1) ;YES. GET A CONO WORD
TXO B,<<CONSO 0>-<CONO 0>+DTETDN+DTETER> ;GET CONSO WORD
XCT B ;DONE YET?
JRST .-1 ;NO. WAIT FOR IT THEN
DTENA2: MOVX A,DTE11!DTE11I ;SEE IF ANY TO -11 IN PROGRESS
TDNN A,DTESTS(Q1) ;IS IT?
JRST DTENA1 ;NO. GO TO NEXT DTE THEN
MOVE B,CNDO(Q1) ;YES. GET CONO WORD
TXO B,<<CONSO 0>-<CONO 0>+DTEEDN+DTEEER>
XCT B ;WAIT FOR COMPLETTION
JRST .-1
DTENA1: AOBJN Q1,DTENA0 ;DO ALL OF THEM
CALLRET DTPAUS ;PAUSE ALL DTE ACIVIITY
;ROUTINE TO REQUEST PAUSE OF ALL DTE ACTIVITY. MAY BE CALLED
;FROM ANY LEVEL
DTPAUS::MOVEI A,[SETZM DTEEPW(B)
RET] ;ROUTINE TO EXECUTE
JRST DTACT0 ;GO TO WORKER ROUTINE
;ROUTINE TO REACTIVATE FE'S. THIS CODE MERELY TURNS ON
;VALID EXAMINE FOR ALL ACTIVE DEVICES.
DTEACT::MOVEI A,[MOVEI C,IEXSIZ+2(A) ;GET EXAMINE SIZE
MOVEM C,DTEEPW(B) ;STORE CORRECT VALUE
RET]
DTACT0: ACVAR <Q1,Q2> ;GET A WORK REG
SKIPN PROFLG ;DOING PRIMARY PROTOCOL?
RET ;NO. DON'T DO ANYTHING THEN
MOVE Q2,A ;SAVE SUBROUTINE ADDRESS
MOVSI Q1,-DTEN ;POLL ALL DEVICES
DTEAC0: HRRZ A,Q1 ;GET DTE NUMBER
JE DTERL,(A),DTEAC1 ;IF NOT ACTIVE, SKIP IT
SKIPE SVVEXM ;NOW IN FORCED SECONDARY PROTOCOL?
CAME A,MSTRDT ;YES. IS THIS THE MASTER -11?
SKIPA B,A ;NO. COPY DTE NUMBER AND PROCEED
JRST DTEAC1 ;YES. SKIP IT THEN
LSH B,SDTE ;GET EPT INDEX
CALL 0(Q2) ;DO ROUTINE
CALL DING11 ;MAKE FE SEE IT
DTEAC1: AOBJN Q1,DTEAC0 ;LOOK AT ALL FE
RET ;DONE
;SPECIAL ROUTINE TO INHIBIT "CONTINUED" MESSAGE
DTICON::MOVX A,1B0 ;GET "FIRST-TIME" BIT
ANDCAM A,UPFLAG ;NOT FIRST-TIME ANYMORE
RET ;DONE
;THESE ROUTINES ALLOCATE AND DEALLOCATE REQUEST NODES
;ASGNOD ACCEPTS NO ARGS. RETURNS:
; +2 WITH A/ADDRESS OF NODE
;THIS MAY BLOCK IF NO NODES ARE AVAILABLE BUT IS GUARNATEED TO
;ALWAYS HAVE A NODE IF CALLED FROM PI LEVEL.
;ASGNDI IS THE ENTRY FOR PI LEVEL (NON DTE LEVEL). IF NO NODES
;ARE AVAILABLE, THIS WILL NOT BLOCK AND RETURN +1
;RELNOD RELEASES A NODE
;ACCEPTS: A/THE NODE ADDRESS
;RETURNS +1 ALWAYS
RESCD ;MUST BE RESIDENT
ASGNOD: TDZA A,A ;ENTRY FLAG
ASGNDI: SETO A, ;THIS ENTRY FLAG
PUSH P,A ;SAVE A
PUSH P,B ;SAVE B
ASGND1: PIOFF ;PREVENT ALL INTS
SKIPN A,COMH ;HAVE A NODE?
JRST BLKNOD ;NO. GO WAIT
HRRZ B,0(A) ;GET LINK TO NEXT
HRRZM B,COMH ;MAKE NEW LINK
SETZM 0(A) ;CLEAR HEADER
PION ;ALLOW INTS AGAIN
PIASG: POP P,B ;RESTORE B
POP P,0(P) ;THROW AWAY FLAG
RETSKP ;GOOD RETURN
BLKNOD: PION ;ALLOW INTS AGAIN
SKIPE -1(P) ;PI ENTRY?
JRST [ POP P,B ;YES. GIVE UP
POP P,A ;CLEAN UP THE STACK
RET] ;AND DONE
MOVEI A,SPCTST ;SCHEDULER TEST ROUTINE
MDISMS ;WAIT HERE FOR A NODE
JRST ASGND1 ;GO TRY IT AGAIN
SPCTST::SKIPN COMH ;SCHEDULER TEST FOR NODE AVAILABLE
JRST 0(4) ;NONE YET
JRST 1(4) ;GOT ONE
RELNOD: PUSH P,B ;GET WORK REG
HRRZ B,COMH ; TOP OF QUEUE
MOVEM B,0(A) ;MAKE LINK TO THIS NEW HEAD
HRRZM A,COMH ;NEW HEAD
POP P,B ;RESTORE WORK REG
RET ;AND DONE
;THIS ROUTINE IS CALLED TO DEQUEUE AND POST ALL REQUESTS FOR
;A GIVEN DTE
;ACCEPTS: A/ DTE #
CLRDTE: JN DTERL,(A),R ;IF NOW ACITVE, IGNORE REQUEST
ASUBR <DTENM> ;SAVE DTE NUMBER
CLRDT1: SKIPN B,DTEQS(A) ;HAVE ANY REQUESTS?
RET ;NO. ALL DONE
HRRZS B ;YES. GET THE REQUEST
CALL DEQDTE ;AND DEQUEUE THIS REQUEST
MOVE A,DTENM ;GET BACK DTE NUMBER
JRST CLRDT1 ;AND GO GET NEXT ONE
;ROUTINE CALLED FROM APRSRV TO SEE IF A DTE CAUSED AN I/O
;PAGE FAIL.
;ACCEPTS: A/ PAGE NUMBER OF FAULT
;RETURNS: +1 NOT A DTE
; +2 A DTE CAUSED IT. DTE IS SHUT OFF
DTEIOP::ACVAR <IOFLAD> ;PLACE TO SAVE PAGE NUMBER
MOVEM A,IOFLAD ;SAVE PAGE NUMBER OF FAULT
MOVSI D,-DTEN ;LOOP OVER ALL DTE'S
IOPLOP: HRRZ A,D ;GET DTE NUMBER
JE DTERL,(A),IOPNXT ;IF NOT RUNNING, SKIP IT
CAMN A,MSTRDT ;IS IT THE MASTER?
JRST IOPNXT ;YES. CAN'T BE IT THEN
LSH A,SDTE ;FIND DTE'S EPT
LOAD B,VPGNO,DTEEBP(A) ;GET PAGE NUMBER OF TO -11 TRANSFER
CAME B,IOFLAD ;IS IT THE OFFENDING PAGE?
JRST IOPNXT ;NO
;FOUND A DTE THAT CAUSED IT
LSH A,-SDTE ;GET BACK DTE NUMBER
SETZRO DTERL,(A) ;NO LONGER RUNNING
CALL DTREST ;TURN OFF THE DTE
CALL CLRDTE ;GET RID OF ITS BLOCKS
SETONE DTRLD,(A) ;AND SAY IT NEEDS RELOADING
BUG (CHK,DTEPGF,<DTE TRANSFER PAGE FAIL>,<A>)
AOS LOAD11 ;SAY AN -11 DIED
AOS JB0FLG ;MAKE JOB 0 SEE IT ASAP
RETSKP ;AND DONE
;NOT THIS ONE. LOOK AT THE NEXT ONE
IOPNXT: AOBJN D,IOPLOP ;DO THEM ALL
RET ;DIDN'T FIND AN OFFENDING DTE
;THIS ROUTINE PERFORMS LOST INTERRUPT POLLING FOR THE DTE20 DEVICES.
;IT IS STARTED PERIODICALLY TO LOOK FOR ANY ANAMOLOUS CONDITIONS
;ON THE DTE'S.
DTECHK::SKIPE FEFLG ;IN SECONDARY PROTOCOL?
SKIPE LOAD11 ;RELOADING ANY -11'S
JRST DTCHK2 ;YES. DON'T POLL THIS TIME
SAVEQ ;SAVE PERMANENT REGS
STKVAR <PRCONI> ;PROTOTYPE CONI
MOVSI A,-DTEN ;NUMBER OF DTE'S IN CONFIGURATION
MOVE B,[CONI DTE0,D] ;THE CONI
MOVEM B,PRCONI ;SAVE IT
DTPOL1: JE DTERL,(A),DTPOL2 ;DONT POLL NON-EX DEVICE
JN DTRLD,(A),DTPL11 ;DON'T POLL IF BEING RELOADED
HRRZ B,A ;GET DTE NUMBER
CAMN B,MSTRDT ;IS THIS THE MASTER?
JRST [ XCT PRCONI ;YES. GET CONI BITS
TXNE D,DTEPF ;POWER FAILING?
JRST DTPOL2 ;YES. DON'T POLL IT NOW THEM
SKIPE FEDBSW## ;NO. WANT RELOADS?
JRST DTPL10 ;NO. DON'T LOOK THEN
JRST .+1] ;YES. POLL IT
CALL SETRGN ;GO FIND APPROPRIATE COMM REGIONS
SUBI D,COMDAT ;GET POINTER TO -11'S OWNED AREA
LOAD B,CMKAC,(D) ;GET HIS KEEP ALIVE COUNTER
LOAD D,CMKAK,(C) ;GET MY COPY OF LAST ONE
CAME B,D ;SAME?
JRST DTPOL9 ;NO. ALL IS OK
JE DTKAC,(A),[ ;IF FIRST TIME,LET HIM GO
SETONE DTKAC,(A) ;BUT REMEMBER THIS TRANSGRESSION
JRST DTPL10] ;AND GO ON
HRRZ B,A ;ISOLATE DTE NUMBER
CAME B,MSTRDT ;IS THIS THE MASTER?
JRST [ CALL DTREST ;NO. RESET THE DTE
SETZRO DTERL,(A) ;AND TURN OFF PROTOCOL
CHNOFF DLSCHN ;TURN OFF THE DTE
CALL CLRDTE ;RELEASE ALL ENTRIES
CHNON DLSCHN ;TURN ON DTE AGAIN
JRST .+1] ;AND MAKE RELOAD FORK RUN
SETONE DTRLD,(A) ;NOT FIRST TIME. HE IS SICK
AOS LOAD11 ;TELL JOB 0 OF THE FIND
AOS JB0FLG ;AND MAKE JOB 0 RUN NOW
DTPL11: PUSH P,A ;SAVE DTE NUMBER
MOVEI A,0(A) ;GET NUMBER ONLY
MOVE B,CTYLNO ;GET # OF THE CTY
CAMN A,MSTRDT ;IS THIS THE MASTER -11?
JRST [ PUSH P,B ;YES. SAVE LINE NUMBER
CALL STADYN ;POINT TO DYNAMIC DATA
SKIPA ;NOT ACTIVE. SHOULDN'T HAPPEN
CALL [ CALL TTSOBE ;SEE IF BUFFER NOW EMPTY
CALL TTCOBF ;NO. CLEAR IT
RET] ;AND PROCEED
POP P,B ;RESTORE LINE NUMBER
JRST .+1]
POP P,A ;RESTORE DTE #
JRST DTPOL2 ;FORGET ABOUT IT FOR NOW
DTPOL9: STOR B,CMKAK,(C) ;KEEP THIS COPY FOR NEXT TIME
SETZRO DTKAC,(A) ;IT PASSED THE TEST
;..
;DTECHK...
;NOW LOOK AT ITS STATE
DTPL10: CHNOFF DLSCHN ;PREVENT STATE CHANGES
XCT PRCONI ;LOOK AT THE DTE STATE
TRNE D,DLSCHN ;CHANNEL ASSIGNED?
JRST DTCHK1 ;YES. GO ON
CALL DTPII ;GO SET UP PI STUFF
BUG(INF,DTELPI,<DTECHK- DTE LOST PI ASSIGNMENT>)
DTCHK1:
REPEAT 0,<LOAD B,DTEST,(A) ;GET DEVICE'S STATE
TXNN B,DTE11!DTE11I ;SENDING TO -11?
JRST DTPOL3 ;NO. GO ON
CALL SETRGN ;FIND THE COMM REGIONS
MOVE B,D ;MOVE HIS POINTER
XCT PRCONI ;GET STATE OF DTE NOW
LOAD Q1,CM1IC,(B) ;HIS TO 11 COUNT
LOAD C,CM1IC,(C) ;MY TO 11 COUNT
CAMN C,Q1 ;SAME?
JRST DTPOL4 ;YES. GO SEE IF TRANSFER IS OK
TXNE D,DTEEDB ;IS -11 DOORBELL UP?
JRST DTPOL3 ;YES. ASSUME IT WILL FIND IT
CALL DING11 ;RING IT AGAIN
BUG(INF,DTELDB,<DTECHK- 11 LOST DOORBELL>)
JRST DTPOL3 ;GO TO NEXT
DTPOL4: LOAD D,CMVRR,(B) ;GET PROTOCOL VERSION
CAIN D,.VN20F ;RSX20F?
JRST DTPOL3 ;YES. DONE WITH POLLING THEN
JN CMTOT,(B),DTPOL3 ;IF IN TRANSIT, OK.
XCT PRCONI ;GET DEVICE STATE AGAIN
TXNE D,DTEEDN ;NOT IN TRANSIT. IS FLAG UP?
JRST DTPOL3 ;YES. ASSUME WE WILL SEE THE INTERRUPT
BUG(INF,DT11DN,<DTECHK- 10 LOST TO11DN INTERRUPT>)
PUSH P,A ;SAVE DTE POINTER
CALL TO11DN ;GO FAKE THE INTERRUPT
POP P,A ;RESTORE POINTER
> ;END OF REPEAT 0
DTPOL3: JN DTBLK,(A),[ SETZRO DTBLK,(A) ;CLEAR INDICATOR
CALL DOFRGM ;IF BLOCKED. TRY NOW
JRST .+1] ;AND GO ON
CHNON DLSCHN ;REENABLE CHANNEL
DTPOL2: MOVX B,4B11 ;NEXT DTE
ADDM B,PRCONI ;NEXT DTE FOR THE CONI
AOBJN A,DTPOL1 ;DO ALL DTE'S
DTCHK2: MOVEI A,^D5000 ;NEXT CHECK IN 5 SECS
MOVEM A,DTETIM ;TO THE TIME CELL
RET ;AND DONE
;ROUTINE CALLED FORM JOB 0 TO SEE IF ANY DTE'S NEED ATTENTION
SWAPCD ;PART OF JOB 0
DTEPOL::call ttmvsp ;go see if any speeds have been sent
SKIPN A,LODFRK ;HAVE A FORK NOW?
JRST DTPOL8 ;NO
RFSTS ;YES. GET ITS STATUS
HLRZS A ;ONLY LH PLEASE
CAIE A,2 ;HALTED?
CAIN A,3 ;OR AN ERROR?
SKIPA A,LODFRK ;YES
JRST DTPOL8 ;NO. GO ON
KFORK ;KILL IT
SETZM LODFRK ;AND THE HANDLE
DTPOL8: SKIPE LOAD11 ;-11'S TO LOAD?
SKIPE LODFRK ;YES. A FORK TO DO IT?
JRST DTPOL7 ;DON'T CREATE ANOTHER
MOVX A,1B1 ;SET CAPABILITIES TO WHEEL
SETZ B, ;NO START ADDRESS
CFORK ;GET ONE
JRST DTPOL7 ;FAILED WAIT TILL NEXT TIME
MOVEM A,LODFRK ;THE ID
MOVEI B,RELOAD ;START ADDRESS
MSFRK ;START IT IN MONITOR MODE
DTPOL7: MOVE C,DBUGSW ;GET DBUGSW FOR LATER TESTING
SKIPN LOAD11 ;ALL -11'S DONE RELOADING?
SKIPN A,UPFLAG ;DO WE NEED A CONTINUE MESSAGE?
JRST DTPL87 ;NO . GO ON THEN
TRZN A,1 ;WANT A MESSAGE?
JRST DTPL87 ;NO
JUMPGE A,[MOVSI A,(1B0) ;IS FIRST TIME
MOVEM A,UPFLAG ;NEXT TIME WILL DO IT
JRST DTPL87] ;AND DONE
MOVEM A,UPFLAG
SETO A, ;SEND TO ALL
HRROI B,[ASCIZ /
[DECsystem-20 continued]
/]
CAIE C,2 ;IF NOW DEBUGGING, SKIP THE MESSAGE
TTMSG ;TELL THE WORLD
DTPL87: SKIPE B,TAD11 ;HAVE A TIME?
CAMN B,[-1] ;?
JRST DTPL88 ;NO . GO ON
DMOVE C,TAD11+1 ;YES. GET REST OF IT
IDCNV ;GET INTERNAL FORMAT
JRST DTPL89 ;TIME IS BAD. INFORM HIM
PUSH P,B ;SAVE THE TIME
CALL LGTAD ;GET SYSTEM'S TIME
POP P,B ;GET -11'S TIME
MOVE D,DBUGSW ;GET THIS SWITCH
CAME A,[-1] ;HAVE A TIME YET?
CAIE D,2 ;YES. ARE WE DEBUGGING ALSO?
SKIPA ;NO. MUST CHECK THE TIME THEN
JRST DTPL88 ;YES. SKIP SETTING IT
CAMLE A,B ;NO. NEED TO SET THE TIME?
JRST DTPL89 ;NO. SKIP SETTING IT
MOVE A,B ;GET THE TIME
STAD ;AND SET IT
JFCL
JRST DTPL88 ;GO DO REST
DTPL89: MOVE A,MSTRDT ;TELL MASTER HE IS WRONG
SETONE DT1TM,(A) ;TELL HIM NOW
DTPL88: SETOM TAD11 ;NO TIME
SKIPE TO11TM ;TIME PACKET AVAILABLE?
RET ;NO. NO SENSE LOOKING THEN
SAVEPQ ;YES. SAVE ALL REGS
DTPOL6: MOVE A,MSTRDT ;GET MASTER -11
JE DT1TM,(A),DTPOL5 ;-11 WANT TIME?
SETZRO DT1TM,(A) ;SAY HE GOT IT
;..
;DTEPOL...
;-11 WANTS TIME OF DAY AND PACKET IS FREE
SETOM TO11TM ;IN USE
SETO B, ;GET CURRENT LOCAL TIME
SETZ D, ;SAY TO USE LOCAL TIME ZONE
ODCNV ;""
HLRZ A,B ;GET YEAR
DPB A,[POINT ^D16,TO11TM,31] ;STORE YEAR
MOVE P1,[POINT ^D8,TO11TM+1] ;WHERE REST IS GOING
IDPB B,P1 ;STORE MONTH
HLRZ A,C ;GET DAY OF MONTH
IDPB A,P1 ;STORE IT
IDPB C,P1 ;DAY OF WEEK
LOAD C,IC%TMZ,D ;GET TIMEZONE
TXNE D,IC%ADS ;DST IN EFFECT?
TRO C,1B28 ;YES - SET FLAG
IDPB C,P1 ;STORE INDICATOR
LSH D,-1 ;DIVIDE SECONDS BY 2
DPB D,[POINT ^D16,TO11TM+2,15];SECONDS SINCE MIDNIGHT
MOVSI A,TM1DON ;POSTING ROUTINE
HRR A,MSTRDT ;DTE NUMBER
MOVSI B,.DFHTD ;HERE IS TIME FUNCTION
MOVEI C,^D10 ;NUMBER OF BYTES IN MESSAGE
MOVE D,[POINT ^D8,TO11TM] ;BYTE POINTER
CALL DTEQ ;Q THE REQUEST
JFCL ;WILL GO
DTPOL5: RET ;AND DONE
RESCD ;MUST BE RESIDENT
;ROUTINE TO POST TIME SENT TO -11
TM1DON: SETZM TO11TM ;SAY TIME PACKET IS FREE
RET ;AND DONE
;ROUTINE CALLED FROM STAD JSYS TO ARRANGE FOR TIME TO BE SENT TO
;ALL 11'S.
SWAPCD ;IS SWAPPABLE
DTTIME::MOVSI A,-DTEN ;FORM AOBJN WORD
DTTIM2: JE DTERL,(A),DTTIM1 ;IF NOT EXISTANT, DON'T DO IT
SETONE DT1TM,(A) ;SAY HE NEEDS THE TIME
DTTIM1: AOBJN A,DTTIM2 ;DO ALL DTE'S
RET ;AND DONE
;ROUTINE CALLED BY JOB 0 TO COMPLETE A SYSERR PACKET.
;ARGS ARE:
; 1/ POINTER TO PACKET
;RETURNS +1 ALWAYS WITH REMAINDER OF INFO FILLED IN
;CALLS DEVICE DEPENDENT ROUTINES TO GET THE OWNING FORK. CALL IS
; CALL DEVICE-DEPENDENT-ROUTINE
;WITH:
; B/ UNIT,,DEVICE
;RETURNS:
; +1/NO OWNING PROCESS (AT LEAST, NOT NOW)
; +2/SUCCESS WITH 1=OWNING PROCESS ID
SWAPCD ;IS SWAPPABLE
SEEER2: HRRZ B,FE%DEV+SEBDAT(A) ;GET DEVICE CODE
CAIL B,MINDEV ;A KNOWN DEVICE?
CAILE B,MAXDEV ;?
JRST SEEER6 ;UNKNOWN
SKIPE C,DTEDTV(B) ;HAVE A TRANSFER VECTOR?
SKIPN C,DTVSER(C) ;THIS DEVICE PREPARED?
SEEER6: JRST [ MOVSI C,(1B0) ;UNKNOWN BIT
IORM C,FE%DEV+SEBDAT(A) ;SET IT
JRST SEEER4] ;GO SAY NO FORK,,JOB
PUSH P,A ;SAVE BLOCK
CALL 0(C) ;GET INFORMATION
JRST [ POP P,A ;CLEAN UP THE STACK
JRST SEEER4] ;AND ASSUME UNKNOWN
MOVE B,A ;FORK #
POP P,A ;BLOCK
CAIN B,-1 ;UNASSIGNED?
JRST [ HRLS B ;YES. PROPOGATE THE -1
MOVEM B,FE%FJB+SEBDAT(A) ;SAY IS UNASSIGNED
JRST SEEER5] ;AND GO WRAP UP
HLRZ C,FKJOB(B) ;GET JOB #
HRLI C,0(B) ;FORK
MOVEM C,FE%FJB+SEBDAT(A);STORE IN BLOCK
MOVE B,JOBDIR(C) ;GET DIRS
HRLI B,USRLH ;SET UP A USER NUMBER
MOVEM B,FE%DIR+SEBDAT(A);TO THE BLOCK
MOVE B,JOBPNM(C) ;GET NAME
MOVEM B,FE%NAM+SEBDAT(A);TO THE BLOCK
SEEER5: MOVEI B,FE%INF ;START OF ERROR WORDS
HRRM B,FE%PTR+SEBDAT(A);TO THE BLOCK
SETZM FE%ID+SEBDAT(A) ;NO VERSION NUMBER YET
RET ;AND DONE
SEEER4: MOVE C,[-2,,-2] ;UNASSIGNED
MOVEM C,FE%FJB+SEBDAT(A);SAY SO
JRST SEEER5 ;GO FINSISH THE SETUP
;THIS CODE IS A COLLECTION OF SUBROUTINES USED TO RELOAD AN -11.
;ROUTINE TO INITIATE ROM BOOT AND OPTIONALLY DUMP OR LOAD THE -11
;ACCEPTS: A/FLAGS,, DTE #
;FLAGS ARE: GRONK/DON'T GRONK ROM
; B/ COROUTINE ADDRESS FOR DUMPING
; IF B=0, NO DUMP
; C/ COROUTINE ADDRESS TO GET NEXT PAGE TO LOAD
; IF C=0 NO LOAD WILL BE DONE
; D/ ERROR ROUTINE IF LOAD OR DUMP FAILED (FOR UNLOCKING PAGES)
;RETURNS: +1 FAILED. A CONTAINS THE CODE FOR THE FAILURE
; -1 MEANS NO SUCH DTE
; +2 SUCCESS. DUMP IS TAKEN AND BOOT IS ACTIVATED
;NOTE: THIS ROUTINE MUST HAVE RESET THE DTE AND INTERLOCKED THE
;BOOT LOCK
;NOTE SOME MORE: THE COROUTINES ARE CALLED WITH THE Q REGISTERS
;INTACT. THAT IS, Q1,Q2, AND Q3 WILL HAVE WHAT THE CALLER OF
;RMGRNK PUT IN THEM. THIS IS USEFUL FOR PASSING ARGS TO THE COROUTINES
;COROUTINES WORK AS FOLLOWS:
;RETURNS +1 IF NO MORE TO DO. AC1=0 SAYS NO EXTRA DOORBELL
; +2 MORE TO DO. IF LOADING, AC1 CONTAINS BYTE POINTER
; TO NEXT CHUNK OF CORE TO LOAD
; AND AC2 CONTAINS A ZERO IF NO DOORBELL
; WANTED AFTER BYTE POINTER IS SET UP. IF DUMPING,
; AC1 CONTAINS COUNT OF BYTES TO DUMP, AND
; AC2 CONTAINS BYTE POINTER.
SWAPCD ;IS SWAPPABLE
RMGRNK: SAVEP ;GET PERM REGISTERS
MOVEI P1,3 ;MAX TRIES
SETZ P2, ;NO ERRORS YET
ASUBR <RMDTE,RMJFN,RMCORT,RMERR>
TXNN A,RM%ROM ;WANT TO GRONK ROM?
JRST RMWAT1 ;NO. SEE ABOUT DUMPING THEN
RMGRN1: HRRZ A,RMDTE ;GET DTE NUMBER AGAIN
CALL DTREAL ;GO VERIFY DTE EXISTS
JRST [ SETOM T1 ;NO SUCH DTE
RET ] ;RETURN FAILURE
MOVE B,CNDO(A) ;GET PROTOTYPE CONO
IORI B,DTEPIE ;FIRST, TURN OFF PI0 TO RESET THE DTE
XCT B ;""
IORI B,DTESER!DTEPIE!DTEPI0 ;THE RELOAD INDICATOR AND PI
XCT B ;SET THE RELOAD INDICATOR
MOVEI B,PWRDN1 ;TIME TO COMPLETE POWER-FAIL
ADD B,TODCLK ;ABSOLUTE TIME WHEN IT IS OVER
CAML B,TODCLK ;READY?
JRST .-1 ;NO. KEEP WAITING
;ROM SHOULD BE READY FOR US NOW
MOVE B,CNDO(A) ;GET A CONO WORD AGAIN
IORI B,DTECER ;CLEAR RELOAD BIT
XCT B ;TURN OFF RELOAD
; ..
; ..
;NOW PUT A MAGIC NUMBER IN BYTE COUNT REGISTER SO ROM CAN FIND US
MOVE B,DATO(A) ;GET A DATAO WORD
IORI B,C ;MAGIC NUMBER WILL BE IN C
MOVEI C,MAG11N ;THE MAGIC NUMBER
XCT B ;DO IT
CALL DING11 ;AND RING -11'S DOORBELL
MOVE P3,[CONSO DTE0,DTEEDB] ;TEST WORD
LSH A,^D26 ;POSITION DTE #
ADD P3,A ;GET PROPER I/O WORD
HRRZ A,RMDTE ;RESTORE A
MOVEI B,ROMTIM ;TIME FOR ROM TO MAKE IT
ADD B,TODCLK ;ABSOLUTE TIME
RMWAT0: XCT P3 ;IS DOORBELL STILL UP?
JRST RMWAT1 ;NO. ROM RESPONDED
CAML B,TODCLK ;IS TIME UP YET?
JRST RMWAT0 ;NO. TRY AGAIN
TXO P2,.R1RMF ;NO ROM RESPONSE
RMTRY: MOVX A,RM%ROM ;MAKE SURE WE CAN RETRY
TDNE A,RMDTE ;CAN WE REGRONK ROM?
SOJG P1,RMGRN1 ;YES, GO TRY AGAIN
RMTRY1: HRRZ A,RMDTE ;ERROR-- GET BACK DTE #
CALL DTREST ;RESET DTE PI0 ENABLE
MOVE A,P2 ;GET ERROR INIDCATION
RET ;AND RETURN FAILURE
;ROM IS PROPERLY INITIALIZED HERE. TRY DOING THE BOOT
RMWAT1: SETZ P4, ;INIT COROUTINE COUNTER
RMWAT2: SKIPN B,RMJFN ;A DUMP ROUTINE GIVEN?
JRST RMLOAD ;NO. DON'T DO THE DUMP THEN
MOVEI A,0(P4) ;ARG TO COROUTINE
CALL 0(B) ;CALL THE DUMP COROUTINE
JRST [ SETZM RMJFN ;DON'T DO DUMP ON RETRY
CALL CHKBEL ;SEE IF A BELL IS NEEDED
JRST RMLOAD] ;AND GO SEE ABOUT LOADING
;COROUTINE RETURNED WITH:
; A/ COUNT OF WORDS TO DUMP
; B/ BYTE POINTER TO USE
MOVE C,A ;PUT COUNT INTO C
HRRZ A,RMDTE ;GET DTE NUMBER
CALL DODUMP ;TRY DUMPING THIS BUNCH
JRST [ TXO P2,.R1DPF ;DUMP ABORTED
TDO P2,A ;ADD IN BITS FROM DODUMP
SETO A, ;SAY FAILURE IS FROM THE DUMP
SKIPE B,RMERR ;WANT ERROR POSTING?
CALL 0(B) ;YES. DO IT
SKIPN RMCORT ;WANT TO LOAD IT TOO?
JRST RMTRY1 ;NO. ERROR OUT NOW THEN
SETZM RMJFN ;DON'T TRY DUMP AGAIN
JRST RMTRY] ;AND TRY, TRY AGAIN
AOJA P4,RMWAT2 ;GO DO NEXT PIECE OF DUMP
;ROUTINE CALLED BY DUMP AND LOAD CODE TO SEE IF A BELL IS NEEDED
;AFTER COMPLETION.
;ACCEPTS: A/ 0 => NO BELL
; RMDTE CONTAINS DTE NUMBER
CHKBEL: JUMPE A,R ;IF NO BELL NEEDED, RETURN
HRRZ A,RMDTE ;GET DTE NUMBER
CALLRET DING11 ;AND GO RING THE BELL
;-11 IS NOW DUMPED. SEE IF A LOAD IMAGE IS NEEDED
RMLOAD: SETZ P4, ;ARG TO COROUTINE
RMLOD0: SKIPN B,RMCORT ;HAVE A ROUTINE TO DO?
RETSKP ;NO. RETURN
HRRZ A,RMDTE ;GET DTE NUMBER
MOVE C,CNDO(A) ;GET A CONO WORD
IORI C,DTEEDN ;GET TEST BITS
XCT C ;TURN OFF TEST BITS
MOVE A,P4 ;TELL COROUTINE WHICH CALL THIS IS
CALL 0(B) ;GO GET NEXT PAGE
;RETURNS A=EXEC VIRT ADDRESS
; B=0 IF NO DOORBELL AFTER SETUP
JRST [ CALL CHKBEL ;SEE IF BELL IS NEEDED
RETSKP] ;AND DONE
MOVE C,A ;SAVE POINTER
HRRZ A,RMDTE ;GET DTE NUMBER AGAIN
LSH A,SDTE ;FIND THE EPT
MOVEM C,DTEEBP(A) ;PUT CORRECT BYTE POINTER IN EPT
HRRZ A,RMDTE ;DTE AGAIN
SKIPE B ;WANT A DOORBELL AFTER SETUP
CALL DING11 ;GO START TRANSFER
MOVEI B,BUTTIM ;TIME FOR THE PAGE TO CLEAR
ADD B,TODCLK ;WHEN IT MUST BE DONE
MOVE P3,CNDO(A) ;GET A CONO WORD
TXO P3,<<CONSO 0>-<CONO 0>+DTEEDN+DTEEER> ;MAKE IT A CONSO WORD
RMDNL1: XCT P3 ;DONE YET?
JRST [ CAML B,TODCLK ;NO. TIME UP?
JRST RMDNL1 ;NO. KEEP WAITING
CALL CLR11B ;YES. CLEAR BYTE POINTER
TXO P2,.R1BSF ;ERROR CODE
JRST RMLERR] ;AND GIVE ERROR
TXZ P3,DTEEDN ;FINISHED. SEE IF SUCCESSFUL
CALL CLR11B ;CLEAR BYTE POINTER
XCT P3 ;WAS IT AN ERROR
AOJA P4,RMLOD0 ;NO, GO SEE IF MORE LOAD WANTED
TXO P2,.R111E ;SAY ERROR
RMLERR: SETZ A, ;SAY ERROR OCCURRED ON LOAD
SKIPE B,RMERR ;WANT ERROR NOTICE?
CALL 0(B) ;YES. DO IT
JRST RMTRY ;GO TRY WHOLE THING AGAIN
;LOCAL ROUTINE TO CLEAR TO -11 BYTE POINTER IN THE EPT.
CLR11B: SAVEAC <A> ;SAVE ALL REGS
HRRZ A,RMDTE ;GET DTE #
LSH A,SDTE ;COMPUTE EPT REGION FOR THIS DTE
SETZM DTEEBP(A) ;ZERO THE BYTE POINTER
RET ;AND DONE
;PROCESS RUN BY JOB 0 TO RELOAD THE MASTER -11.
SWAPCD ;IS SWAPPABLE
RELOAD: MOVE P,UPP ;GET PROPER STACK
MCENTR ;ENTER MONITOR CONTEXT
MOVX A,RLDPRI ;GET SPECIAL PRIORITY WORD FOR RELOAD
MOVEM A,JOBBIT ;FOR REMAINDER OF RELOAD
RELOD2: MOVE A,MSTRDT ;GET ID OF MASTER
JN DTRLD,(A),RELOD1 ;FOUND ONE
MOVSI A,-DTEN ;NOW CHECK ALL OF THE OTHERS AS WELL
RELOD3: JE DTRLD,(A),RELOD4 ;THIS ONE NEED ATTENTION?
HRRZ B,A ;YES, GET DTE # ONLY
CAMN B,MSTRDT ;DID THE MASTER DIE AGAIN?
JRST RELOD1 ;YES. GO DO IT NOW
PUSH P,A ;NO.
SETZRO <DTRLD,DTKAC>,(A) ;TURN OFF ATTENTION BITS
BUG (INF,DN20ST,<DTESRV- DN20 STOPPED>,<B>)
LSH B,SDTE ;GET EPT OFFSET
SETZM DTEEPW(B) ;CLEAR "VALID EXAMINE"
CALL RELODR ;INFORM APPROPRIATE MONITOR ROUTINES
POP P,A ;GET BACK REG
RELOD4: AOBJN A,RELOD3 ;SCAN THEM ALL
SETZM LOAD11 ;ALL DONE
AOS JB0FLG ;MAKE JOB 0 SEE HALTED STATE ASAP
HALTF ;NONE LEFT. ALL DONE
;RELOAD MASTER -11. REGISTER USAGE AS FOLLOWS:
; Q1/ OFN,,JFN OF DUMP FILE (PASSED TO RELODD BY RMGRNK)
; Q2/ -11 ERROR WORDS RETURNED BY RELODD IF DUMP SUCCEEDED
; Q3/ CUMULATIVE ERROR REGISTER
; P5/ RETRY COUNT
RELOD1: SETZB Q3,Q2 ;CLEAR STATUS AND ERROR WORDS
CALL RELODR ;INFORM REST OF MONITOR
MOVE A,MSTRDT ;GET BACK DTE #
MOVEI P5,3 ;MAX TRIES
CALL FNDFIL ;GO GET JFN AND OFN FOR THE DUMP FILE
JRST [ TXO Q3,.R1DPF ;THE DUMP WON'T BE DONE
SETZ P1, ;NO JFN
JRST .+1] ;GO INLINE
HRR Q1,P1 ;Q1 NOW HAS OFN,,JFN
;READY TO GRONK THE ROM.
RELODA: MOVEI B,RELODD ;DUMP COROUTINE
CAIN P5,3 ;IS THIS THE FIRST TIME?
SKIPN P1 ;HAVE A JFN FOR DUMPING?
SETZ B, ;NO. DON'T DO THE DUMP THEN
MOVEI C,RELODL ;ADDRESS OF LOAD ROUTINE
MOVEI D,RELODE ;ERROR ADDRESS
TXO A,RM%ROM ;MUST DO ROM BOOT
CALL RMGRNK ;GO GRONK THE ROM
RELODF: JRST [ MOVE Q3,A ;SAVE ERROR FLAGS
MOVE A,MSTRDT ;THE DTE NUMBER
CALL RELOD7 ;GO DO SYSERR
AOS JB0FLG ;MAKE JOB 0 RUN NOW
MOVEI A,^D1000
DISMS ;WAIT HERE FOR IT TO RUN AND DO SYSERR
AOS SHLTW ;AND STOP SYSTEM
HALTF] ;DONE
; ..
; ..
;RELOAD OF THE -11 IS NOW IN PROGRESS. DO PROTOCOL INIT
CALL KILPAG ;GO PURGE THE BUFFER PAGE
MOVSI D,(<CONSO DTE0,>) ;GET A CONSO WORD
MOVE A,MSTRDT ;THE -11 NUMBER
LSH A,^D26 ;PSOITION IT
ADD D,A ;THE WORD
MOVE A,MSTRDT ;DTE # AGAIN
IORI D,DTETDB ;SET UP TO WAIT FOR A DOORBELL
MOVEI B,DRBTIM ;TIME TO WAIT FOR RELOAD TO COMPLETE
ADD B,TODCLK ;WHEN WAIT IS UP
RELD11: XCT D ;WAIT
JRST [ CAML B,TODCLK ;WAIT SOME MORE?
JRST RELD11 ;YES
TXO Q3,.R1NRL ;NO RELOAD
SOJG P5,RELODA ;SEE IF WE SHOULD TRY AGAIN
MOVE A,Q3 ;FLAGS
JRST RELODF] ;NO. FAIL!!!!!!
CALL DTREST ;GO RESET THE DTE
MOVEI B,.VN20F ; FOR RSX20F PROTOCOL
CALL DTINIT ;GO INIT THE COMM REGIONS
CALL RELOD7 ;GO DO SYSERR
MOVE A,MSTRDT ;RECOVER DTE NUMBER
JN DTRLD,(A),RELOD2 ;IF WANTS RELOAD AGAIN, GO DO IT NOW
MOVX A,GJ%OLD!GJ%SHT!GJ%PHY
HRROI B,SETSPD
SETZ C, ;C/OFFSET IN ENTRY VECTOR
CALL RUNDII ;GO SET DEFAULT SPEEDS AGAIN
JFCL ;CAN'T HELP IT
SKIPN C,KLIDTA ;HAVE ANY KLINIK DATA?
JRST RELOD2 ;NO,GO WRAP UP
HRRZ A,MSTRDT ;YES. GET I.D. OF MASTER
MOVSI B,.DFKLS ;GET FUNCTION TO SEND KLINIK DATA
MOVE D,[POINT ^D8,KLIDTA+1] ;GET KLINIK DATA BASE POINTER
CALL DTEQ ;GO SEND THE KLINIK DATA
JFCL ;WILL GO
JRST RELOD2 ;AND GO WRAP UP
;ROUTINE OF RELOAD TO INFORM APPROPRIATE MONITOR DRIVERS OF THIS RELOAD.
; A/ DTE #
RELODR: HRRZS A ;GET DTE #
ASUBR <DTENBR> ;SAVE DTE NUMBER
CALL SETRGN ;FIND COMM REGIONS
LOAD B,CMVRR,(C) ;GET PROTOCOL VERSION #
CAIE B,.VN20F ;RSX20F PROTOCOL?
CALLRET DEDMCB ;NO. INFORM NSP OF DEAD FRONT-END
MOVSI P5,MINDEV-MAXDEV+.FECTY ;TO SEARCH DTEDTV
HRRI P5,.FECTY+1 ;START AFTER CTY
RLODR1: MOVE A,DTENBR ;GET DTE #
SKIPE B,DTEDTV(P5) ;THIS DEVICE EXIST?
SKIPN B,DTVRLD(B) ;YES. WANT TO KNOW ABOUT RELOADS?
SKIPA ;NO
CALL 0(B) ;YES. TELL HIM
AOBJN P5,RLODR1 ;DO ALL DEVICES
RET ;AND DONE
;COROUTINES OF RMGRNK TO DO LOADING OF -11
;COROUTINE TO LOAD BOOTSTRAP
RELODL: JUMPG A,[CALL UNLPAG ;IF NOT FIRST TIME, UNLOCK PAGE
CALLRET RTRUE] ;AND GET A FINAL BELL
CALL LOKPAG ;GO LOCK DOWN BOOT PAGE
MOVE B,[DTERBT,,DTERBT+1]
SETZM DTERBT ;SET UP TO CLEAR REBOOT PAGE
BLT B,DTERBT+1_PGSFT-1 ;ZAP THE WHOLE PAGE
MOVE A,MSTRDT ;GET DTE NUMBER
CALL CLRBEL ;TURN OFF TO -10 DOORBELL
CALL SETRGN ;FIND COMM REGIONS
DMOVE A,[12700,,0 ; MOVE #0,R0
137,,173034] ; JMP 173034 (A MAGIC ADDRESS)
LOAD C,CMRLF,(C) ;GET RELOAD FLAGS
TXZ C,7 ;TURN OFF RELOAD -10 FLAGS
; AND SWITCH REGISTER REQUEST
HRRI A,4(C) ;TO THE BOOT PROGRAM
; AND TURN ON NO -10 REBOOT BIT
DMOVEM A,DTERBT ;TO THE PAGE
TXNE A,DSK11 ;IS THIS AN RP REBOOT?
JRST [ MOVE B,[DSKRBT,,DTERBT] ;YES. MOVE PORT CONTENTION
; CODE IN FIRST
BLT B,DTERBT+DSKPSZ-1 ;MOVE IT ALL
HRRM A,DTERBT ;STICK IN THE UNIT STUFF
JRST .+1] ;ALL READY TO GO
MOVE A,[POINT ^D18,DTERBT] ;GET POINTER TO BOOT CODE
SETO B, ;AND RING DOORBELL AFTER SETUP
RETSKP ;AND GO BOOT IT
;ROUTINE TO LOCK DOWN DTERBT
LOKPAG: NOINT ;NO INTERRUPTS WITH LOCK LOCKED
LOCK BTLOCK ;LOCK THE BOOT PAGE
MOVEI A,DTERBT ;THE PAGE
MOVES 0(A) ;CREATE IT
CALL FPTA
CALL MLKPG ;AND LOCK IT
RET ;DONE
;ROUTINE TO UNLOCK DTERBT
UNLPAG: UNLOCK BTLOCK ;UNLOCK THE BOOT PAGE
MOVEI A,DTERBT ;ADDRESS OF THE PAGE
CALL FPTA ;GET ID
CALL MULKPG ;GO DO IT
OKINT ;PERMIT INTERRUPTS AGAIN
RET ;RETURN
;ERROR ROUTINE
RELODE: CALL UNLPAG ;FREE THE PAGE
RET ;AND DONE
;COROUTINE TO PERFORM THE DUMP OF THE MASTER -11
;ARGS: Q1/ OFN,,JFN OF THE DUMP FILE
; A/PAGE NUMBER
RELODD: ASUBR <PAGENO> ;THE ARG TO THIS COROUTINE
JUMPE A,[CALL LOKPAG ;IF FIRST TIME, LOCK DOWN PAGE
JRST RELDD1] ;AND GO PROVIDE ARGS
;NOT THE FIRST TIME. DTERBT CONTAINS GOOD DATA, AND A CONTAINS PAGE NUMBER
CAIN A,1 ;IS THIS THE FIRST 1 K OF -11 MEMEORY?
MOVE Q2,DTERBT ;YES. GET CODE FOR SYSERR
NOINT
CALL ASGPAG ;GET A WORK PAGE FOR THIS
JRST [ OKINT ;FAILED. ALLOW INTS AGAIN
JRST RELODE] ;AND GIVE ERROR
PUSH P,A ;SAVE CORE ADDRESS
HLL A,Q1 ;OFN OF THE FILE
HRR A,PAGENO ;PAGE NUMBER OF THE FILE
SOS A ;PAGE NUMBER FOR THE DUMP FILE
MOVE B,0(P) ;THE TEMP PAGE WE JUST GOT
TXO B,PA%WT!PA%RD ;NEED ACCESS
CALL SETMPG ;MAP THE FILE TO THE PAGE
MOVSI B,DTERBT ;WHERE THE DATA IS
HRR B,0(P) ;THE DESTINATION
POP P,A ;AGAIN
BLT B,777(A) ;MOVE THE DATA
CALL RELPAG ;RELEASE AND UNMAP THE PAGE
OKINT ;ALLOW INTS AGAIN
MOVE A,PAGENO ;THE PAGE NUMBER
CAIL A,^D28 ;DONE ALL OF CORE?
JRST RELODC ;YES. GO CLOSE FILE
RELDD1: MOVEI A,2000 ;COUNT OF BYTES
MOVE B,[POINT ^D18,DTERBT] ;WHERE TO DO NEXT DUMP
RETSKP ;GO DO IT
;DUMP IS DONE. CLOSE FILE
RELODC: HRRZ A,Q1 ;THE JFN
TXO A,1B0 ;DON'T RELEASE THE JFN
CLOSF ;CLOSE IT
JFCL
CALL UNLPAG ;GO UNMAP THE PAGE
CALLRET RFALSE ;AND SAY NO BELL NEEDED
;ROUTINE TO GET JFN AND OFN FOR THE DUMP FILE
;INPUT: A/ DTE NUMBER
;RETURNS: +1 /FAILURE. CONDITION BIT ON IN Q3
; +2/ SUCCESS. P1/THE JFN Q1/ OFN,,
FNDFIL: SAVET ;SAVE TEMPS
HRROI B,DTERBT ;WHERE TO FORM THE NAME
MOVEI D,"0"(A) ;FIRST BYTE IS -11 NUMBER
SETZ C, ;TERMINATE ON NULL
HRROI A,[ASCIZ /<SYSTEM>/] ;PUT FILE IN SYSTEM
SIN ;COPY STIRNG
IDPB D,B ;PUT IN -11 NUMBER
HRROI A,[ASCIZ /DUMP11.BIN;P770000/]
SIN ;COPY REST OF NAME
IDPB C,B ;TIE IT OFF
MOVX A,GJ%FOU!GJ%PHY!GJ%SHT ;GTJFN BITS
HRROI B,DTERBT ;THE ADDRESS OF THE FILE PAGE
GTJFN ;GET A JFN
JRST [ TXO Q3,.R1GTF ;GTJFN FAILED
RET] ;AND GIVE UP
MOVEI P1,0(A) ;SAVE JFN
HRLI A,.FBBYV ;SET UP TO CHANGE BYTE SIZE
MOVX B,7777B11 ;SET RETENTION AND BYTE SIZE
MOVX C,0044B11 ;SET RETENTION TO INFINITE
CHFDB ;CHANGE IT
ERJMP FNDFL1 ;FAILED. PUNT IT
HRLI A,.FBSIZ ;EOF POINTER
SETO B, ;CHANGE WHOLE WORD
MOVEI C,^D28*^D512 ;SET TO 28 PAGES
CHFDB ;DO IT
ERJMP FNDFL1 ;FAILED. PUNT IT
FNDFL1: MOVE B,[440000+OF%WR] ;OPEN CONDITIONS
MOVEI A,0(P1) ;GET JFN AGAIN
OPENF ;OPEN THE FILE
JRST [ TXO Q3,.R1OPF ;OPENF FAILED
RET] ;GIVE IT UP
HRLZS A ;JFN TO LH
CALL JFNOFN ;GET THE OFN
JRST [TXO Q3,.R1OPF ;OPENF FAILED
RET]
MOVE Q1,A ;SAVE THE OFN
RETSKP ;MADE IT
;THIS ROUTINE PERFORMS THE ACTUAL DUMP OF THE -11. INPUT IS:
; A/ DTE NUMBER
; B/ BYTE POINTER TO USE FOR THE DUMP
; C/ FLAGS AND COUNT OF WORDS TO DUMP
; COUNT IS RIGHTMOST 12 BITS (DTEBYC)
; FLAGS: DTETI (SET "I" BIT ON TRANSFER)
;RETURNS:
; +1/ FAILED. CONDITION SET IN A
; +2/ SUCCESS
DODUMP: SAVEPQ ;SAVE ALL REGS
MOVE D,[CONSO DTE0,DTETDN!DTETER] ;DTE CONDITIONS
MOVE P3,DATO(A) ;GET A DATAO FOR THIS DTE
MOVE Q3,CNDO(A) ;GET A CONO WORD
IORI Q3,DTETDN ;TO SET UP PROPER STATE
IORI P3,A ;ARG WILL GO IN A
LSH A,^D26 ;POSITION DTE NUMBER
ADD D,A ;FORM HARDWARE TEST WORD
LSH A,-^D26+SDTE ;FORM EPT INDEX
MOVEM B,DTETBP(A) ;PUT BYTE POINTER IN EPT
XCT Q3 ;TURN OFF ALL TO -10 INDICATORS
;GO GET THE CORE
MOVE B,C ;COPY BYTE COUNT AND "I" BIT
MOVN A,C ;GET NEG OF COUNT
ANDI A,DTEBYC ;ONLY 12 BITS
TXNE B,DTETI ;WANT "I" BIT SET ?
TXO A,DTETI ;YES, SET "I" BIT
XCT P3 ;DO THE DATAO
MOVEI B,T10TIM ;TIME FOR IT TO COMPLETE
ADD B,TODCLK ;WHEN WAIT IS UP
DOPAG1: XCT D ;WAIT FOR IT TO COMPLETE
JRST [ CAML B,TODCLK ;WAIT SOME MORE?
JRST DOPAG1 ;YES. GO DO IT
SETZ A, ;NO. ASSUMED IT WON'T FINISH
XCT P3 ;ABORT TRANSFER
JRST DMPERR] ;AND GO MARK ERROR
TXZ D,DTETER ;SEE IF IT WAS ERROR OR NORMAL DONE
XCT D ;""
JRST DMPERR ;WAS AN ERROR. BAD NEWS
TXO D,DTETER ;RESTORE THIS
XCT Q3 ;TURN OFF DONE FLAGS
RETSKP ;DUMP IS DONE
;ERROR DOING THE DUMP
DMPERR: XCT Q3 ;RESET THE DTE
MOVX A,.R110E ;RETURN ERROR
RET ;DONE
;ROUTINE TO MAKE SYSERR ENTRY FOR -11 RELOAD. INPUT IS:
; A/ DTE NUMBER
; P1/ JFN
; P3/ RETRY COUNT
; Q2/ -11 ERROR WORDS
; Q3/ STATUS
RELOD7: TRVAR <DTNOM,SYBLK,ER11,<FILESP,^D20>> ;FOR SYSERR INFO
MOVEM Q2,ER11 ;SAVE -11 ERROR WORDS
MOVEM A,DTNOM ;SAVE DTE NUMBER
MOVEI A,R1%LEN ;SIZE OF PACKET
MOVEI B,R1%SIZ ;LENGHT (INCLUDING STIRNGS)
CALL ALCSEB ;ALLOCATE A BLOCK
JRST [ MOVE A,DTNOM
RET] ;DONE
MOVEM A,SYBLK ;SAVE BLOCK
MOVEI B,3 ;MAX TRIES
SUBM B,P5 ;NUMBER OF TRIES
IOR P5,Q3 ;FORM FINAL STATUS WORD
MOVE B,[-4,,[ ;TO DO THE COPIES
SEBPTR 0,SBTEVC,SEC%11 ;CODE
SEBPTR R1%NUM,SBTWD,DTNOM ;-11 NUMBER
SEBPTR R1%STS,SBTWD,P5 ;STATUS
SEBPTR R1%ERW,SBTWD,ER11]] ;-11 ERROR WORDS
MOVE A,SYBLK ;BLOCK ADDRESS
CALL SEBCPY ;COPY THE DATA
JFCL
TXNE Q3,.R1DPF ;DID THE DUMP SUCCEED?
JRST RELOD9 ;NO. GO ON
MOVEI B,0(P1) ;YES. GET JFN
HRROI A,FILESP ;A BUFFER FOR THE FILE NAME
MOVE C,[11110,,10011] ;JFNS BITS
JFNS ;GET THE NAME
MOVE A,SYBLK ;SYSERR BLOCK
MOVE B,[-1,,[
SEBPTR R1%FNM,SBTSTR,FILESP]] ;COPY STRING
CALL SEBCPY ;DO IT
JFCL
RELOD9: MOVE A,SYBLK ;GET SYSERR BLOCK
CALL QUESEB ;QUEUE IT UP
JFCL ;?
RET ;AND DONE
;CODE TO DO THE RP REBOOT OF THE -11. THIS INCLUDES THE PORT
;CONTENTION LOGIC AND THE BOOT CODE
DSKRBT: 12700,,0 ;MOV #0,R0
12704,,176700 ;MOV #RPEXP,R4
12703,,176710 ;MOV #RPEXP+10,R3
12713,,40 ;MOV #40,@R3
10005,,305 ;MOV R0,R5
; SWAB R5
42705,,177770 ;BIC #177770,R5
110513,,12701 ;MOVB R5,@R3
2,,12714 ;MOV#2,R1
23,,32714 ;MOV #23,@R4
4000,,1771 ;BIT #DVA,@R4
; BEQ 10$
5301,,1371 ;DEC R1
; BNE 20$
137,,173034 ;JUMP 173034
DSKPSZ==.-DSKRBT
;ROUTINE TO CHECK IF A DTE EXISTS
;ACCEPTS: A/ DTE NUMBER
;RETURNS: +1 DOESN'T EXIST
; +2 EXISTS
DTREAL: JN DTERL,(A),RSKP ;IF NOW ACTIVE, IT EXISTS
CALL DTREST ;PUT IT IN A KNOWN STATE
MOVE B,CNDO(A) ;GET A CONO WORD
IORI B,DTEPIE+DTEPI0 ;ENABLE PI 0 ONLY
XCT B ;GO SET THEM
TXC B,<<CONSO 0>-<CONO 0>> ;CHANGE CONO INTO A CONSO
XCT B ;SEE IF BITS ARE ON
RET ;NO. DEVICE DOESN'T EXIST
CALL DTREST ;YES. RESET DEVICE
RETSKP ;AND SAY IT EXISTS
; BOOT JSYS - PERFORMS BOOTSTRAP FUNCTIONS FOR ADJACENT COMPUTERS
; TABLE OF DISPATCH ADDRESSES
BOOTTB: BTROM ;ACTIVATE ROM
BTLDS ;LOAD SECONDARY BOOTSTRAP PROGRAM
BTLOD ;LOAD MEMORY
BTDMP ;DUMP MEMORY
BTIPR ;INITIALIZE PROTOCOL
BTTPR ;TERMINATE PROTOCOL
BTSTS ;RETURN STATUS
BTBEL ;WAIT FOR TO-10 DOORBELL
BTRMP ;READ MOP MESSAGE
BOOTLN==.-BOOTTB
.BOOT:: MCENT ;MONITOR CONTEXT ENTRY
MOVE T1,CAPENB ;GET ENABLED CAPABILITIES
TXNN T1,SC%WHL!SC%OPR!SC%MNT ;WHEEL, OPERATOR, OR MAINTENANCE ?
ITERR (CAPX1) ;NO, GIVE ERROR
; VALIDATE DTE-20 NUMBER
UMOVE Q1,2 ;GET ADDRESS OF USER'S ARGUMENT BLOCK
UMOVE Q2,.BTDTE(Q1) ;GET DTE-20 NUMBER FROM USER
CAIL Q2,DTEN ;VALID DTE-20 SPECIFIED ?
ITERR (BOTX01) ;NO, GIVE ERROR
; DISPATCH TO PROCESSING ROUTINE BASED ON REQUESTED FUNCTION
UMOVE T1,1 ;GET FUNCTION CODE FROM USER
CAIL T1,.BTROM ;CHECK RANGE OF GIVEN
CAIL T1,BOOTLN ; FUNCTION CODE
ITERR (ARGX02) ;INVALID FUNCTION CODE
MOVE T1,BOOTTB(T1) ;GET ADDRESS OF PROCESSING ROUTINE
CALL (T1) ;DISPATCH TO APPROPRIATE ROUTINE
ITERR (,<CALL KILPAG>) ;FAILED, RETURN ERROR TO USER
CALL KILPAG ;GO DELETE THE DTE BUFFER PAGE
MRETNG ;SUCCESS, RETURN TO USER
; COMMON ERROR ROUTINE TO STORE FAILURE STATUS IN ARG BLOCK AND RETURN
; ACCEPTS IN T1/ ERROR STATUS
BTERR: CAMN T1,[-1] ;NO SUCH DTE20 ?
JRST [ MOVX T1,BOTX01 ;YUP, GET CORRECT ERROR CODE
RET ] ;AND DONE
UMOVEM T1,.BTERR(Q1) ;SAVE ERROR STATUS
RET ;GIVE FAIL RETURN
; ROUTINE TO ACTIVATE (GRONK) THE ROM
BTROM: MOVE T1,Q2 ;GET DTE-20 NUMBER
TXO T1,RM%ROM ;INDICATE THAT ROM SHOULD BE GRONKED
SETZB T2,T3 ;DON'T DUMP, DON'T LOAD
CALL RMGRNK ;GO GRONK THE ROM
JRST BTERR ;FAILED, RETURN ERROR STATUS
RETSKP ;SUCCESS, GIVE GOOD RETURN
; ROUTINE TO ACTIVATE (GRONK) THE ROM AND LOAD A SECONDARY BOOTSTRAP
BTLDS: MOVE T1,Q2 ;GET NUMBER OF DTE-20
TXO T1,RM%ROM ;NOTE THAT ROM SHOULD BE ACTIVATED
SETZM T2 ;NO DUMP WANTED
MOVE T3,[LODSEC] ;ADR OF COROUTINE TO LOAD SECONDARY BOOT
MOVE T4,[RELODE] ;ADDRESS OF ERROR COROUTINE
CALL RMGRNK ;INITIATE LOAD OF SECONADRY BOOTSTRAP
JRST BTERR ;FAILED, RETURN ERROR STATUS
RETSKP ;SUCCESS, GIVE GOOD RETURN
; COROUTINE TO PERFORM LOADING OF SECONDARY BOOTSTRAP
LODSEC: JUMPG T1,LDSEC2 ;IF SECOND CALL, GO UNLOCK PAGE AND RETURN
CALL LOKPAG ;LOCK THE PAGE TO HOLD THE DATA TO TRANSFER
CALL CLRRBT ;ZERO THE BOOT PAGE
MOVEI T1,200 ;NUMBER OF WORDS TO TRANSFER IS MAXIMUM SIZE
; OF SECONDARY BOOTSTRAP
UMOVE T2,.BTSEC(Q1) ;GET SOURCE ADDRESS OF DATA IN USER SPACE
MOVE T3,[DTERBT] ;GET ADDRESS OF BOOT PAGE (DESTINATION)
CALL BLTUM ;COPY BOOTSTRAP INTO MONITOR SPACE
MOVE T1,Q2 ;GET DTE-20 NUMBER
CALL CLRBEL ;TURN OFF THE TO -10 DOORBELL
SETOM T2 ;NOTE THAT A DOORBELL IS REQUESTED
MOVE T1,[POINT ^D16,DTERBT] ;GET BYTE POINTER TO SECONDARY BOOT PGM
RETSKP ;RETURN TO CALLER
; HERE ON SECOND ENTRY AFTER DATA HAS BEEN TRANSFERRED
LDSEC2: CALL UNLPAG ;DONE WITH BOOT PAGE
CALLRET RTRUE ;RETURN AND REQUEST FINAL DOORBELL
; ROUTINE TO LOAD MEMORY OF AN ADJACENT COMPUTER HAVING LOADED A BOOTSTRAP
CNTBYT==2 ;NUMBER OF COUNT BYTES PRECEDING DATA BYTES
BTLOD: UMOVE T2,.BTCNT(Q1) ;GET TOTAL NUMBER OF DATA BYTES TO TRANSFER
JUMPLE T2,[RETBAD (BOTX04)] ;COUNT MUST BE POSITIVE
HRLM T2,Q2 ;SAVE NUMBER OF BYTES REMAINING TO LOAD
UMOVE T1,.BTFLG(Q1) ;GET FLAGS FROM USER SPACE
TXNE T1,BT%BEL ;USER WANT DOORBELL ?
TXO Q1,BT%BEL ;YES, NOTE REQUEST
UMOVE T1,.BTLPT(Q1) ;GET POINTER TO DATA BYTES IN USER SPACE
MOVEM T1,Q3 ;SAVE BYTE POINTER TO DATA
; VALIDATE THE USER'S BYTE POINTER
LDB T2,[POINT 6,T1,11] ;GET SIZE OF BYTES
CAIE T2,^D8 ;ONLY 8-BIT BYTES PERMITTED
RETBAD (BOTX02) ;INVALID BYTE SIZE SPECIFIED
; DETERMINE THE NUMBER OF DATA BYTES PER PAGE
MOVEI T1,^D36 ;GET NUMBER OF BITS/WORD
IDIV T1,T2 ;COMPUTE NUMBER OF BYTES/WORD
IMULI T1,PGSIZ ;FORM TOTAL NUMBER OF BYTES/PAGE
SUBI T1,CNTBYT ;COMPUTE NUMBER OF DATA BYTES/PAGE
HRRM T1,Q1 ;SAVE # OF DATA BYTES/PAGE
; SET UP TO DO THE TRANSFER
HRRZ T1,Q2 ;GET NUMBER OF DTE-20
SETZM T2 ;NO DUMP WANTED
MOVEI T3,LODRTN ;ADR OF COROUTINE TO LOAD DATA
MOVEI T4,RELODE ;ADDRESS OF ERROR COROUTINE
CALL RMGRNK ;INITIATE LOAD OF SECONADRY BOOTSTRAP
JRST BTERR ;FAILED, RETURN ERROR STATUS
RETSKP ;SUCCESS, GIVE GOOD RETURN
; COROUTINE TO PERFORM LOADING OF AN ADJACENT COMPUTER'S MEMORY
;
;ACCEPTS IN Q1/ FLAGS,,NUMBER OF DATA BYTES PER PAGE
; FLAGS: BT%BEL IF DOORBELL WANTED
; Q2/ # OF BYTES LEFT TO LOAD,,DTE-20 NUMBER
; Q3/ BYTE POINTER TO NEXT BYTE INTO USER'S ADDRESS SPACE
LODRTN: HLRZ T1,Q2 ;GET NUMBER OF BYTES LEFT TO DO
JUMPLE T1,LDRTN2 ;IF DONE ALL BYTES, UNLOCK BOOT PAGE AND RETURN
CALL LOKPAG ;LOCK THE BOOT PAGE
CALL CLRRBT ;ZERO THE BOOT PAGE
HLRZ T1,Q2 ;GET NUMBER OF BYTES LEFT TO DO
HRRZ T2,Q1 ;ASSUME AN ENTIRE PAGE OF BYTES LEFT TO DO
CAIGE T1,(Q1) ;LESS THAN A PAGE OF DATA BYTES LEFT ?
HLRZ T2,Q2 ;YES, GET JUST THE NUMBER LEFT TO LOAD
SUB T1,T2 ;COMPUTE BYTES REMAINING AFTER THIS LOAD
HRL Q2,T1 ;SAVE NEW NUMBER OF BYTES LEFT TO DO
; STORE THE NUMBER OF DATA BYTES TO TRANSFER AS THE FIRST TWO BYTES
MOVE T4,[POINT 8,DTERBT] ;SET UP DESTINATION POINTER
IDPB T2,T4 ;STORE LOW ORDER BYTE OF COUNT
LDB T3,[POINT 8,T2,27] ;GET HIGH ORDER BYTE OF COUNT
IDPB T3,T4 ;STORE HIGH ORDER BYTE OF COUNT
; GET THE DATA BYTES FROM THE USER (T2 NOW HAS NUMBER OF BYTES TO LOAD)
USRD10: XCTBU [ILDB T3,Q3] ;GET NEXT BYTE FROM THE USER
IDPB T3,T4 ;STORE NEXT DATA BYTE TO LOAD
SOJG T2,USRD10 ;LOOP FOR ALL BYTES TO LOAD
; NOW SET UP FLAGS AND POINTER TO DATA AND RETURN
HRRZ T1,Q2 ;GET NUMBER OF DTE-20
CALL CLRBEL ;TURN OFF THE TO -10 DOORBELL
SETZM T2 ;ASSUME NO TO -11 DOORBELL WANTED
TXNE Q1,BT%BEL ;USER WANT A TO -11 DORRBELL ?
SETOM T2 ;YES, NOTE THAT A DOORBELL IS REQUESTED
MOVE T1,[POINT 8,DTERBT] ;GET BYTE POINTER TO DATA
RETSKP ;RETURN AND DO TRANSFER
; HERE WHEN ALL DATA HAS BEEN LOADED - UNLOCK THE BOOT PAGE AND RETURN
LDRTN2: CALL UNLPAG ;UNLOCK THE BOOT PAGE
CALLRET RFALSE ;RETURN (NO DDORBELL)
; ROUTINE TO DUMP AN ADJACENT COMPUTER'S MEMORY
BTDMP: STKVAR <BTDBLK,BTDERR>
MOVEM Q1,BTDBLK ;SAVE ADDRESS OF USER ARG BLOCK
UMOVE T2,.BTCNT(Q1) ;GET TOTAL NUMBER OF DATA BYTES TO TRANSFER
HRLM T2,Q2 ;SAVE NUMBER OF BYTES REMAINING TO DUMP
UMOVE T1,.BTDPT(Q1) ;GET POINTER TO DATA BYTES IN USER SPACE
MOVEM T1,Q3 ;SAVE BYTE POINTER TO DATA
; DETERMINE THE NUMBER OF DATA BYTES PER PAGE
LDB T2,[POINT 6,T1,11] ;GET SIZE OF BYTES
MOVEI T1,^D36 ;GET NUMBER OF BITS/WORD
IDIV T1,T2 ;COMPUTE NUMBER OF BYTES/WORD
IMULI T1,PGSIZ ;FORM TOTAL NUMBER OF BYTES/PAGE
HRRZM T1,Q1 ;SAVE # OF DATA BYTES/PAGE
; SET UP TO DO THE TRANSFER
SETZM BTDERR ;INITIALIZE ERROR FLAG
HRRZ T1,Q2 ;GET NUMBER OF DTE-20
MOVE T2,[DMPRTN] ;GET ADDRESS OF DUMP COROUTINE
SETZM T3 ;NO LOAD ROUTINE NEEDED
MOVE T4,[RELODE] ;ADDRESS OF ERROR COROUTINE
CALL RMGRNK ;INITIATE DUMP
MOVEM T1,BTDERR ;SAVE ERROR STATUS
MOVE Q1,BTDBLK ;GET ADDRESS OF USER ARG BLOCK AGAIN
UMOVEM Q3,.BTDPT(Q1) ;STORE UPDATE POINTER INTO USER SPACE
HLRZ T1,Q2 ;GET # OF BYTES LEFT TO DUMP
UMOVEM T1,.BTCNT(Q1) ;STORE UPDATED COUNT IN USER SPACE
SKIPE T1,BTDERR ;DID AN ERROR OCCUR ON THE DUMP ?
JRST BTERR ;YES, GO STORE ERROR CODE AND RETURN
RETSKP ;SUCCESS, GIVE GOOD RETURN
; COROUTINE TO PERFORM DUMPING OF AN ADJACENT COMPUTER'S MEMORY
;
;ACCEPTS IN Q1/ # OF BYTES DUMPED ON LAST CALL,,NUMBER OF DATA BYTES PER PAGE
; Q2/ # OF BYTES LEFT TO DUMP,,DTE-20 NUMBER
; Q3/ BYTE POINTER TO NEXT BYTE INTO USER'S ADDRESS SPACE
DMPRTN: STKVAR <DMPNUM>
MOVEM T1,DMPNUM ;SAVE NUMBER OF THIS CALL
SKIPN DMPNUM ;FIRST TIME HERE ?
JRST DMPRT1 ;YES, SKIP RETURNING BYTES TO USER
; RETURN DUMPED BYTES TO USER PROGRAM
HLRZ T4,Q1 ;GET # OF BYTES DUMPED LAST TIME
MOVE T3,[POINT 8,DTERBT] ;GET BYTE POINTER
LDB T1,[POINT 6,Q3,11] ;GET SIZE OF USER'S BYTE POINTER
DPB T1,[POINT 6,T3,11] ;FORM BYTE POINTER FOR CORRECT SIZE BYTES
DMPRT0: ILDB T1,T3 ;GET A DUMPED BYTE
XCTBU [IDPB T1,Q3] ;STORE BYTE INTO USER SPACE
SOJG T4,DMPRT0 ;LOOP OVER ALL BYTES TO DUMP
DMPRT1: SKIPE DMPNUM ;IS THIS THE FIRST CALL ?
JRST DMPRT2 ;NO, DO NOT INITIALIZE BOOT PAGE
CALL LOKPAG ;YES, LOCK THE BOOT PAGE
CALL CLRRBT ;ZERO THE BOOT PAGE
DMPRT2: HLRZ T2,Q2 ;GET NUMBER OF BYTES LEFT TO DO
JUMPLE T2,DMPRT3 ;IF DONE ALL BYTES, UNLOCK BOOT PAGE AND RETURN
HLRZ T1,Q2 ;GET NUMBER OF BYTES LEFT TO DO
HRRZ T2,Q1 ;ASSUME AN ENTIRE PAGE OF BYTES LEFT TO DO
CAIGE T1,(Q1) ;LESS THAN A PAGE OF DATA BYTES LEFT ?
HLRZ T2,Q2 ;YES, GET JUST THE NUMBER LEFT TO DUMP
HRLM T2,Q1 ;SAVE # OF BYTES TO BE DUMPED THIS PASS
SUB T1,T2 ;COMPUTE BYTES REMAINING AFTER THIS DUMP
HRL Q2,T1 ;SAVE NEW NUMBER OF BYTES LEFT TO DO
;SET UP TO DO THE NEXT DUMP
MOVE T1,T2 ;GET # OF BYTES TO DUMP
MOVE T2,[POINT 8,DTERBT] ;GET POINTER TO WHERE DUMPED BYTES GO
LDB T3,[POINT 6,Q3,11] ;GET SIZE OF USER'S BYTE POINTER
DPB T3,[POINT 6,T2,11] ;FORM BYTE POINTER FOR CORRECT SIZE BYTES
RETSKP ;REQUEST NEXT SET OF BYTES TO BE DUMPED
; HERE AFTER FINAL SET OF BYTES HAS BEEN DUMPED
DMPRT3: CALL UNLPAG ;UNLOCK THE BOOT PAGE
CALLRET RFALSE ;NO EXTRA DOORBELL NEEDED
; ROUTINE TO WAIT FOR A TO-10 DOORBELL
BTBEL: SE0ENT ;ENTER SECTION 0
HRLZ T1,Q2 ;GET DTE-20 NUMBER
HRRI T1,DBWAIT ;GET SCHEDULER TEST ROUTINE ADDRESS
MDISMS ;WAIT FOR DOORBELL TO COME ON
MOVE T1,Q2 ;GET DTE-20 NUMBER
LSH T1,^D26 ;POSITION DTE-20 NUMBER
ADD T1,[CONO DTE0,DTETDB] ;FORM INSTRUCTION TO TURN OFF DOORBELL
XCT T1 ;TURN OFF TO-20 DOORBELL
RETSKP ;DOORBELL WAS ON, RETURN
; SCHEDULER TEST TO WAIT FOR A DOORBELL FROM A DTE-20
; ACCEPTS IN T1/ DTE-20 NUMBER
RESCD
DBWAIT: LSH T1,^D26 ;POSITION DTE-20 NUMBER
ADD T1,[CONSO DTE0,DTETDB] ;FORM TEST INSTRUCTION
XCT T1 ;IS DOORBELL ON YET ?
JRST 0(4) ;NO, WAIT SOME MORE
JRST 1(4) ;YES, RETURN SUCCESS
SWAPCD
; ROUTINE TO PURGE THE DTE BUFFER PAGE (DTERBT)
KILPAG: SAVET
MOVEI T2,DTERBT ;GET ADDRESS OF BUFFER PAGE
SETZ T1, ;DELETE THE PAGE
CALLRET SETMPG ;...
; ROUTINE TO READ A MOP MESSAGE FROM AN ADJACENT COMPUTER
;
; PROTOCOL: BYTE COUNT (2 BYTES, INCLUDING BYTE COUNT)
; MOP MESSAGE
; ONLY 8-BIT BYTES ARE PERMITTED. A SECONDARY BOOTSTRAP CAPABLE OF
; ADHERING TO THIS PROTOCOL MUST HAVE BEEN LOADED INTO THE ADJACENT
; COMPUTER PRIOR TO PERFORMING THIS FUNCTION.
BTRMP: SE0ENT ;ENTER SECTION 0
MOVE T1,Q2 ;GET DTE-20 NUMBER
MOVEI T2,RCVMOP ;ADDRESS OF DUMP COROUTINE
MOVEI T3,0 ;NO LOADING DESIRED
MOVEI T4,RELODE ;ADDRESS OF ERROR COROUTINE
CALL RMGRNK ;INITIATE THE TRANSFER
JRST BTERR ;FAILED, RETURN ERROR STATUS
; THE MESSAGE HAS BEEN TRANSFERRED TO MONITOR VIRTUAL ADDRESS SPACE.
; RETURN THE MESSAGE TO THE USER (Q3 CONTAINS THE # OF BYTES TRANSFERRED).
UMOVE T1,.BTMPT(Q1) ;GET DESTINATION BYTE POINTER TO USER SPACE
UMOVE T2,.BTCNT(Q1) ;GET MAX BYTE COUNT USER WILL ACCEPT
CAML T2,Q3 ;WAS LESS ACTUALLY TRANSFERRED ?
MOVE T2,Q3 ;YES, USE SMALLER BYTE COUNT
UMOVEM T2,.BTCNT(Q1) ;STORE UPDATED BYTE COUNT IN USER SPACE
MOVE T4,[POINT 8,DTERBT,15] ;GET BYTE POINTER TO SOURCE
JUMPE T2,BTRM20 ;IF DONE, RETURN
; LOOP TO RETURN THE MESSAGE TO THE USER
BTRM10: ILDB T3,T4 ;GET BYTE FROM MESSAGE
XCTBU [IDPB T3,T1] ;STORE BYTE INTO USER SPACE
SOJG T2,BTRM10 ;LOOP OVER ENTIRE MESSAGE
BTRM20: UMOVEM T1,.BTMPT(Q1) ;STORE UPDATED BYTE POINTER
RETSKP ;RETURN SUCCESS
; COROUTINE TO RECEIVE MOP MESSAGES
RCVMOP: JUMPN T1,RCVM10 ;IF NOT FIRST CALL, GO READ MSG OR RETURN
; THIS IS THE INITIAL CALL - SET UP TO READ THE BYTE COUNT
CALL LOKPAG ;LOCK THE BOOT PAGE
CALL CLRRBT ;ZERO THE BOOT PAGE
MOVEI T1,2 ;BYTE COUNT IS FIRST TWO BYTES
MOVE T2,[POINT 8,DTERBT] ;GET BYTE POINTER
RETSKP ;RETURN TO READ FIRST TWO BYTES
; HERE ON SECOND CALL - SET UP TO READ THE ACTUAL MOP MESSAGE
RCVM10: CAIE T1,1 ;IS THIS THE SECOND CALL ?
JRST RCVM20 ;NO, GO UNLOCK THE BOOT PAGE AND RETURN
LDB Q3,[POINT 8,DTERBT,7] ;YES, GET LOW ORDER BYTE OF BYTE COUNT
LDB T1,[POINT 8,DTERBT,15] ;GET HIGH ORDER BYTE OF BYTE COUNT
DPB T1,[POINT 8,Q3,27] ;FORM COMPLETE BYTE COUNT
MOVE T1,Q3 ;GET BYTE COUNT
CAILE T1,PGSIZ*4-2 ;MAX MESSAGE SIZE IS ONE PAGE-COUNT (2 BYTES)
MOVEI T1,PGSIZ*4-2 ;MESSAGE TOO LARGE, JUST GET ONE PAGE
TXO T1,DTETI ;REQUEST "I" BIT ALSO
MOVE T2,[POINT 8,DTERBT,15] ;START MESSAGE AT THIRD BYTE IN FIRST WORD
RETSKP ;RETURN AND TRANSFER DATA BYTES
; HERE ON THIRD CALL - ENTIRE MESSAGE HAS BEEN TRANSFERRED
RCVM20: CALL UNLPAG ;UNLOCK THE BOOT PAGE
UMOVE T2,.BTFLG(Q1) ;GET FLAGS FROM USER
SETZM T1 ;ASSUME NO DOORBELL WANTED
TXNE T2,BT%BEL ;USER ASK FOR A DOORBELL ?
SETOM T1 ;YES, REQUEST A DOORBELL
RET ;RETURN, TRANSFER COMPLETED
; ROUTINE TO TERMINATE PROTOCOL ON A DTE-20
BTTPR: CAMN Q2,MSTRDT ;IS THIS THE MASTER -11?
RETBAD (BOTX01) ;YES. ILLEGAL TO STOP IT
LOAD T1,DTERL,(Q2) ;GET CURRENT PROTOCOL STATE
PUSH P,T1 ;SAVE IT
SETZRO DTERL,(Q2) ;NOTE THAT THIS DTE NOT RUNNING A PROTOCOL
MOVE T1,Q2 ;GET DTE-20 NUMBER
CALL DTREST ;GO TURN OF INTERRUPTS FOR THIS DTE
POP P,T1 ;GET PREVIOUS PROTOCOL STATE
JUMPE T1,RSKP ;IF NOT IN PROTOCOL, DONE
SETONE DTRLD,(Q2) ;WAS. NEED RELOAD ATTENTION THEN
AOS LOAD11 ;SAY HAVE A FE THAT NEEDS ATTENTION
AOS JB0FLG ;AND MAKE JOB 0 DO IT
RETSKP ;RETURN
; ROUTINE TO RETURN STATU