User Tools

Site Tools


plato:source:plaopl:cld

Table of Contents

CLD

Table Of Contents

  • [00006] CLD–PLATO IV COMMUNICATION LINK DRIVER
  • [00033] DIRECT CELL ASSIGNMENTS
  • [00149] MAIN PROCESSING LOOP
  • [00191] PROCESS REQUEST
  • [00241] RESERVE LINK
  • [00283] RESERVE LOCAL EQUIPMENT AND CHANNEL
  • [00335] RELEASE LOCAL EQUIPMENT AND CHANNEL
  • [00374] REMOTE STARTUP
  • [00426] SEND AND RECEIVE A MESSAGE
  • [00452] DE-ESTABLISH LINK
  • [00542] SPECIAL ROUTINES
  • [00554] LOOPBACK TEST
  • [00619] LOCAL TERMINAL MODE DRIVER
  • [00662] TERMINAL MODE IO
  • [00720] GET KEY FROM ECS KEY BUFFER
  • [00793] SEND FRAME TO PLATO
  • [00869] MOVE FRAME
  • [00913] REMOTE TERMINAL MODE DRIVER
  • [00972] TERMINAL MODE IO
  • [01013] SEND KEY TO PLATO
  • [01153] GET FRAMES FROM ECS
  • [01239] MOVE KEY
  • [01360] TERMINAL MODE INPUT-OUTPUT
  • [01478] READ ECS
  • [01568] WRITE ECS
  • [01664] CLOCK
  • [01715] READ AND CLEAR PPU COMMUNICATIONS SWITCH
  • [01757] WRITE TO CM BUFFER.
  • [01798] CHARACTER I/O
  • [01930] WAIT CHARACTER READY OR REQUEST
  • [01986] ODD CHANNEL STATUS/PUT CHARACTER
  • [02039] GETCHR
  • [02100] PACK DATA
  • [02155] UNPACK
  • [02207] DATAIN
  • [02311] DATAOUT
  • [02366] SEND MESSAGE
  • [02419] RECEIVE A MESSAGE
  • [02475] SELECT 6681 DATA CONVERTER
  • [02566] SYNCHRONIZATION ESTABLISH
  • [02621] DIVIDE BY 5
  • [02648] INCREMENT 5 BYTE COUNTER
  • [02684] PARITY GENERATION
  • [02738] PAUSE–CHECK FOR STORAGE MOVE OR ERROR CONDITIONS
  • [02829] SOFTWARE AND HARDWARE ERROR ROUTINES
  • [02876] EXIT ROUTINES
  • [02899] SEND END LINK
  • [02946] TERMINAL MODE TERMINATION
  • [02991] SEND PLATO REQUEST
  • [03035] PROCESS 3266 INPUT
  • [03064] WAIT ON LINKCTL
  • [03088] EQUATES
  • [03131] STORAGE DEFINITIONS
  • [03208] COMMUNICATION BUFFERS
  • [03306] COMMUNICATION BUFFERS
  • [03343] ERROR CODES
  • [03372] COMMAND CODES AND CONTROL CHARACTERS
  • [03419] 6681 AND 311-B CODES
  • [03459] INITIALIZATIONS

Source Code

CLD.txt
  1. CLD
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK CLD 00 000 78/02/06 11.43
  4. IDENT CLD,CLD
  5. * CZZ
  6. TITLE CLD--PLATO IV COMMUNICATION LINK DRIVER
  7. PERIPH
  8. SST FNTL
  9. COMMENT LINK DRIVER
  10. *
  11. *CALL COMPMAC
  12. *CALL PTEXT
  13. *CALL PLAP501
  14. *
  15. *CALL AIDTEXT
  16.  
  17. QUAL CPS
  18. *CALL COMSCPS
  19. QUAL *
  20. PORT MACRO P1
  21. LOCAL N,N1
  22. N VFD 12/7700B+C=CH
  23. IFEO IFC EQ,*P1*EVEN*
  24. N1 VFD 12/5100B+E=CH
  25. CHAN E=CH,N1
  26. IFEO ELSE
  27. N1 VFD 12/5101B+O=CH
  28. CHAN O=CH,N1
  29. IFEO ENDIF
  30. CHAN C=CH,N
  31. ENDM
  32. * /--- BLOCK DIRECT 00 000 76/05/13 14.53
  33. TITLE DIRECT CELL ASSIGNMENTS
  34. ************************************************************************
  35. T0 EQU 0 *
  36. *
  37. T1 EQU 1 *
  38. *
  39. T2 EQU 2 *
  40. *
  41. T3 EQU 3 * TEMPORARY STORAGE
  42. *
  43. T4 EQU 4 *
  44. *
  45. T5 EQU 5 *
  46. *
  47. T6 EQU 6 *
  48. *
  49. T7 EQU 7 *
  50. *
  51. CM EQU 10B CM WORD BUFFER(5 WORDS)
  52. *
  53. LA EQU 15B PP PACKAGE LOAD ADDRESS
  54. *
  55. T8 EQU 16B TEMPORARY STORAGE
  56. *
  57. T9 EQU 17B TEMPORARY STORAGE
  58. *
  59. FUNC EQU 20B CURRENT REQUEST FUNCTION.
  60. *
  61. CHAR EQU 21B LAST CHARACTER INPUT
  62. *
  63. NC EQU 22B NUMBER OF TIMES TO CHECK FOR
  64. * CHARACTER READY.
  65. TI EQU 23B COUNTER SET IN PAUSE SO THAT
  66. * WE DO NOT LOOP TO LONG IN
  67. * CHARARCTER STATUS ROUTINES
  68. * WITHOUT CHECKING FOR STORAGE
  69. * RELOCATION.
  70. NAKFLAG EQU 24B 0=LAST BLOCK RECEIVED OKAY
  71. * 1=ERROR IN LAST BLOCK
  72. LT EQU 25B NUMBER CM WORDS IN LAST
  73. * LINKCTL COMMAND.
  74. DL EQU 26B NUMBER OF CM DATA WORDS IN
  75. * COMMUNICATION BUFFER.
  76. D0 EQU 27B TEMPORARY STORAGE
  77. *
  78. KEY EQU 30B POINTER TO NEXT KEY TO SEND
  79. * WHEN IN TERMINAL MODE.
  80. FRAME EQU 31B POINTER TO NEXT FRAME TO SEND
  81. * WHEN IN TERMINAL MODE
  82. MODE EQU 32B =0 FOR FILE TRANSFER MODE
  83. * =1 FOR TERMINAL MODE
  84. RESEND EQU 33B NUMBER OF TIMES A MESSAGE HAS
  85. * BEEN RESENT.
  86. TT EQU 34B TEMPORARY STORAGE
  87. *
  88. SC EQU 35B SYNC CODE COUNTER
  89. *
  90. OC EQU 36B OUTPUT CHARACTER
  91. *
  92. * /--- BLOCK DIRECT 00 000 78/01/05 09.02
  93. ULP EQU 37B UPPER-LOWER POINTER FOR PACKING
  94. *
  95. ULU EQU 40B UPPER-LOWER POINTER FOR
  96. * UNPACKING.
  97. WP EQU 41B PPU WORD CURRENTLY BEING PACKED
  98. *
  99. WU EQU 42B PPU WORD CURRENTLY BEING
  100. * UNPACKED.
  101. NW EQU 43B NUMBER OF PPU WORDS IN THIS
  102. * MESSAGE.
  103. CKO EQU 44B LONGITUDINAL PARITY WORD FOR
  104. * OUTPUT DATA.
  105. CKI EQU 45B LONGITUDINAL PARITY WORD FOR
  106. * INPUT DATA.
  107. FRCHK EQU 46B TIME OUT COUNTER FOR READING
  108. * FRAMAT STATUS WORD
  109. SENDI EQU 47B SEND KEY INDEX
  110. * EOD,EOB, OR EOF.
  111. IR EQU 50B INPUT REGISTER(5 WORDS)
  112. *
  113. RA EQU 55B REFERENCE ADDRESS/100
  114. *
  115. FL EQU 56B FIELD LENGTH/100
  116. *
  117. ECS EQU 60B POINTER TO ECS ADDRESS FOR
  118. * READ AND WRITE ECS ROUTINES
  119. STATION EQU 61B STATION NUMBER OF LINKCTL
  120. *
  121. BADC EQU 62B CONSECUTIVE BAD CHAR. COUNT.
  122. *
  123. ECSOFF EQU 63B OFFSET TO BE ADDED TO BASE
  124. * ECS ADDRESS
  125. TIME EQU 64B TIME-OUT COUNTER FOR TERMINAL
  126. * MODE, NO CHAR. READY STATUS.
  127. PS EQU 65B HARDWARE STATUS
  128. *
  129. TMSTAT EQU 66B TERMINAL MODE STATION
  130. *
  131. CLK EQU 67B LAST CLOCK TIME
  132. *
  133. ON EQU 70B CONSTANT 1
  134. *
  135. HN EQU 71B CONSTANT 100
  136. *
  137. TH EQU 72B CONSTANT 1000
  138. *
  139. TR EQU 73B CONSTANT 3
  140. *
  141. CP EQU 74B CONTROL POINT ADDRESS
  142. *
  143. IA EQU 75B INPUT REGISTER ADDRESS
  144. *
  145. OA EQU 76B OUTPUT REGISTER ADDRESS
  146. *
  147. MA EQU 77B MESSAGE BUFFER ADDRESS
  148. * /--- BLOCK MAIN LOOP 00 000 78/05/11 21.44
  149. TITLE MAIN PROCESSING LOOP
  150. ORG PPFW
  151. *
  152. CLD BSS 0 CZZ
  153. *
  154. * * * PERFORM INITIALIZATIONS
  155. *
  156. RJM INITIAL
  157. CALL PARGEN GENERATE PARITY TABLE
  158. *
  159. * * * CHECK TO SEE IF IT IS NECESSARY TO PAUSE
  160. * FOR STORAGE RELOCATION.
  161. *
  162. MAIN BSS 0
  163. RJM PAUSE CHECK FOR PAUSE CONDITIONS
  164. *
  165. * * * PROCESS ANY 3266 INPUT
  166. CALL LOOPCHK
  167. *
  168. * * * CHECK FOR DROP SIGNAL FROM PLATO LESSON
  169. *
  170. CALL DROPCHK
  171. *
  172. * * * CHECK FOR REQUEST PENDING
  173. * ON RETURN IF -A- IS ZERO NO NEW REQUEST
  174. *
  175. RJM READSW
  176. ZJN MAIN NO NEW REQUEST
  177. STD LT SAVE LENGTH OF NEW REQUEST
  178. *
  179. * * * READ REQUEST FROM CM TO -IBF-
  180. *
  181. RJM READ
  182. *
  183. * * * PROCESS NEW REQUEST
  184. *
  185. RJM PROC
  186. *
  187. * * * WAIT FOR NEW REQUEST
  188. *
  189. UJN MAIN
  190. *
  191. TITLE PROCESS REQUEST
  192. *
  193. * * PROC
  194. *
  195. * THIS ROUTINE DETERMINES WHAT FUNCTION IS BEING
  196. * REQUESTED AND JUMPS TO THE CORRECT ROUTINE TO
  197. * PROCESS IT. IF AN ILLEGAL FUNCTION CODE IS
  198. * RECEIVED AN ERROR CODE IS PLACED INTO THE
  199. * RESPONSE AND THE REQUEST IS MARKED DONE.
  200. *
  201. PROC SUBR
  202. *
  203. * * * ISOLATE FUNCTION CODE
  204. *
  205. LDM IBF+RFUNC
  206. STD FUNC
  207. *
  208. * * * CHECK FOR LEGAL FUNCTION
  209. *
  210. SBN FLST SUBTRACT HIGHEST LEGAL CODE+1
  211. PJN PRERR JUMP IF OUT OF RANGE
  212. *
  213. * * * JUMP TO PROCESS
  214. *
  215. PROCE BSS 0
  216. LDM PTABLE,FUNC
  217. STD D0
  218. LJM 0,D0
  219. *
  220. * * * JUMP TABLE FOR FUNCTION CODE PROCESSING
  221. *
  222. PTABLE BSS 0
  223. VFD 12/STUP 00 CHECK FOR STARTUP
  224. VFD 12/PRES 01 RESERVE LINK
  225. VFD 12/MESSIO 02 SEND AND RECEIVE MESSAGE
  226. VFD 12/PREL 03 RELEASE LINK
  227. VFD 12/STCOMD 04 RETURN 311 STATUS
  228. VFD 12/STATS 05 RETURN DRIVER STATISTICS
  229. VFD 12/TEST 06 RUN SPECIAL ROUTINE
  230. VFD 12/LTLINK 07 LOCAL TERMINAL MODE DRIVER
  231. VFD 12/RTLINK 10 REMOTE TERMINAL MODE DRIVER
  232. VFD 12/PRERR
  233. VFD 12/TLOP 12 LOOP BACK TEST
  234. FLST EQU *-PTABLE
  235. *
  236. * * * ERROR--ILLEGAL FUNCTION CODE
  237. *
  238. PRERR BSS 0
  239. CALL SERROR,SIFC
  240. * /--- BLOCK PRES 00 000 77/10/01 00.02
  241. TITLE RESERVE LINK
  242. *
  243. * *PRES
  244. *
  245. * THIS ROUTINE ATTEMPTS TO RESERVE THE LOCAL
  246. * AND REMOTE COMMUNICATION EQUIPMENT.
  247. *
  248. PRES BSS 0
  249. *
  250. * * * GET AND SAVE LINKCTL STATION NUMBER
  251. *
  252. LDM IHDR+STNO
  253. STD STATION
  254. *
  255. * * * SAVE PLATO*S ECS RA
  256. LDM XECU
  257. STM ECU
  258. LDM XECL
  259. STM ECL
  260. *
  261. * * * IS LINK ALREADY IN SYNC
  262. *
  263. LDM SFLAG
  264. NJP MESSIO JUMP IF YES
  265. *
  266. * * * RESERVE LOCAL EQUIPMENT FIRST.
  267. *
  268. RJM LRES
  269. *
  270. * * * SETUP 6681
  271. *
  272. PRES0 BSS 0
  273. RJM SELDC
  274. *
  275. * * * WAIT FOR SYNCHRONIZATION TO BE ESTABLISHED
  276. *
  277. CALL SEST,2400
  278. *
  279. * * * SEND START-UP MESSAGE
  280. *
  281. LJM MESSIO
  282. * /--- BLOCK LRES 00 000 77/08/29 15.39
  283. TITLE RESERVE LOCAL EQUIPMENT AND CHANNEL
  284. *
  285. * *LRES
  286. *
  287. * THIS ROUTINE ATTEMPTS TO RESERVE THE COMMUNICATION
  288. * LINK BY RESERVING EQUIPMENT -CL- AND CHANNEL
  289. * -CH-.
  290. *
  291. LRES SUBR
  292. *
  293. * * * DO NOT RESERVE EQUIPMENT IF ALREADY RESERVED
  294. LDC ALSEVEN
  295. SBM CLEQ
  296. NJN LRESX IF EQUIPMENT ALREADY RESERVED
  297. *
  298. * * * FIND EQUIPMENT ORDINAL AND CHANNEL NUMBER.
  299. LDC 2RCL
  300. CALL EQN
  301. MJP LRES1 JUMP IF EQUIP NOT AVAILABLE
  302. STD CM+1 SAVE EQUIPMENT ORDINAL
  303. LDD CM GET CHANNEL NUMBER
  304. STD TT SAVE IT.
  305. *
  306. * * * RESERVE CHANNEL AND EQUIPMENT
  307. MONITOR REQM RESERVE EQUIPMENT
  308. LDD CM+1 READ REPLY
  309. ZJP LRES1 JUMP IF EQUIP ALREADY RESERVED
  310. STM CLEQ SAVE ORDINAL
  311. *
  312. LDD TT GET CHANNEL NO.
  313. RCHAN
  314. LDD CM+1 CHECK MONITOR REPLY
  315. ZJP LRES2 JUMP CHANNEL NOT AVAILABLE
  316. STM CLCH SAVE CHANNEL NUMBER
  317. *
  318. * * * PLUG CHANNEL AND PORT NUMBERS
  319. PLANT CHANNEL,C=CH PLUG CHANNEL NUMBER.
  320. LDM XPORTCH GET 311 CHANNEL NUMBER
  321. PLANT CHANNEL,E=CH PLUG CHANNEL NUMBER.
  322. LDM XPORTCH
  323. ADN 1 MAKE ODD CHANNEL NUMBER
  324. PLANT CHANNEL,O=CH PLUG ODD CHANNEL.
  325. LJM LRESX
  326. *
  327. * * * ERROR--EQUIPMENT ALREADY RESERVED
  328. LRES1 BSS 0
  329. CALL SERROR,SENA
  330. *
  331. * * * ERROR--CHANNEL ALREADY RESERVED
  332. LRES2 BSS 0
  333. CALL SERROR,SCNA
  334. * /--- BLOCK LREL 00 000 77/08/29 15.40
  335. TITLE RELEASE LOCAL EQUIPMENT AND CHANNEL
  336. *
  337. * *LREL
  338. *
  339. * THIS ROUTINE RELEASES THE RESERVE ON THE LOCAL
  340. * COMMUNICATION LINK EQUIPMENT -CL- AND THE
  341. * ASSOCIATED CHANNEL(C=CH) IF IN FACT THEY HAVE
  342. * BEEN RESERVED.
  343. *
  344. LREL SUBR
  345. *
  346. * * * HAS -CL- BEEN RESERVED
  347. LDC ALSEVEN
  348. SBM CLEQ
  349. ZJN LREL1 JUMP IF NOT
  350. *
  351. * * * RELEASE EQUIPMENT
  352. LDM CLEQ GET EST ORDINAL OF -CL-
  353. STD CM+1
  354. MONITOR DEQM RELEASE THE EQUIPMENT
  355. *
  356. * * * CHECK IF CHANNEL HAS BEEN RESERVED
  357. LREL1 BSS 0
  358. LDC ALSEVEN
  359. SBM CLCH CHECK CHANNEL FLAG
  360. ZJN LREL2 IF ALL SEVENS CHANNEL HAS NOT
  361. * YET BEEN RESERVED
  362. *
  363. * * * RELEASE CHANNEL
  364. LDM CLCH
  365. DCHAN
  366. *
  367. * * * SET INDICATORS SHOW NO EQUIPMENT RESERVED
  368. LREL2 BSS 0
  369. LDC ALSEVEN
  370. STM CLEQ
  371. STM CLCH
  372. UJN LRELX
  373. * /--- BLOCK STARTUP 00 000 78/03/30 10.23
  374. TITLE REMOTE STARTUP
  375. *
  376. * * STUP
  377. *
  378. * CHECK TO SEE IF REMOTE SITE IS REQUESTING
  379. * USE OF LINK. IF SO SEND ACKNOWLEDGE AND
  380. * INFORM LINKCTL.
  381. *
  382. STUP BSS 0
  383. *
  384. * * * GET AND SAVE LINKCTL STATION NUMBER
  385. *
  386. LDM IHDR+STNO
  387. STD STATION
  388. *
  389. * * * SAVE PLATO*S ECS RA
  390. LDM XECU
  391. STM ECU
  392. LDM XECL
  393. STM ECL
  394. *
  395. * * * IS LINK ALREADY IN SYNC
  396. *
  397. LDM SFLAG
  398. NJP STUP1 JUMP IF YES
  399. *
  400. * * * RESERVE LOCAL EQUIPMENT
  401. *
  402. RJM LRES
  403. *
  404. * * * SET UP 6681
  405. *
  406. RJM SELDC
  407. *
  408. * * * ESTABLISH SYNCHRONIZATION
  409. *
  410. CALL SEST,750
  411. *
  412. * * * SET SYNC CODE COUNTER TO ZERO
  413. *
  414. STUP1 BSS 0
  415. LDN 0
  416. STD SC
  417. *
  418. * * * CHECK FOR MESSAGE.
  419. *
  420. CALL MESSIN
  421. *
  422. * * * RECEIVED STARTUP MESSAGE INFORM LINKCTL.
  423. *
  424. CALL WRITE
  425. LJM PROCX
  426. TITLE SEND AND RECEIVE A MESSAGE
  427. *
  428. * * MESSIO
  429. *
  430. * SEND MESSAGE TO REMOTE SITE AND WAIT FOR
  431. * A RETURNING MESSAGE.
  432. *
  433. MESSIO BSS 0
  434. *
  435. * * * MAKE SURE REMOTE STILL IN TOUCH
  436. *
  437. CALL SEST,2
  438. *
  439. * * * OUTPUT MESSAGE
  440. *
  441. CALL MESSOUT
  442. *
  443. * * * WAIT FOR RESPONSE
  444. *
  445. CALL MESSIN
  446. *
  447. * * * SEND MESSAGE TO LINKCTL
  448. *
  449. CALL WRITE
  450. LJM PROCX
  451. * /--- BLOCK REL/STATUS 00 000 77/10/02 22.39
  452. TITLE DE-ESTABLISH LINK
  453. *
  454. * *PREL
  455. *
  456. * RELEASE REMOTE AND LOCAL COMMUNICATION EQUIPMENT.
  457. *
  458. PREL BSS 0
  459. *
  460. * * * MAKE SURE REMOTE IS STILL IN TOUCH
  461. *
  462. CALL SEST,2
  463. *
  464. * * * SEND EOT MESSAGE TO REMOTE SITE
  465. *
  466. CALL MESSOUT
  467. *
  468. * * * INFORM -LINKCTL- THAT THE REQUEST IS COMPLETE
  469. *
  470. RJM WRITE
  471. LJM PROCX WAIT FOR NEXT COMMAND
  472. SPACE 2
  473. *
  474. * * STCOMD
  475. *
  476. * THIS ROUTINE INPUTS THE STATUS FROM BOTH THE ODD
  477. * AND EVEN CHANNELS AND RETURNS IT TO -LINKCTL-.
  478. *
  479. STCOMD BSS 0
  480. LDM IHDR+STNO
  481. STD STATION
  482. *
  483. * * * RESERVE EQUIPMENT AND CHANNEL
  484. *
  485. RJM LRES
  486. RJM SELDC
  487. *
  488. * * * GET ODD CHANNEL STATUS
  489. *
  490. CALL ICHR2
  491. STM OBF+RSTA SAVE FOR THE RESPNSE
  492. *
  493. * * * GET EVEN CHANNEL STATUS
  494. *
  495. RJM ICHR
  496. STM OBF+RSTA1 PUT INTO RESPONSE
  497. *
  498. * * * SEND RESPONSE TO LINKCTL
  499. *
  500. RJM WRITE
  501. LJM PROCX WAIT FOR NEXT COMMAND
  502. EJECT
  503. *
  504. *
  505. * * STATS
  506. *
  507. * THIS ROUTINE PASSES ALL STATISTICS CELLS
  508. * TO -LINKCTL-.
  509. *
  510. STATS SUBR
  511. *
  512. * * * MOVE STATISTICS CELLS TO COMMUNICATION BUFFER
  513. *
  514. LDM PECNT
  515. STM DSTATS
  516. LDM BDCNT
  517. STM DSTATS+4
  518. LDM LPCNT
  519. STM DSTATS+9
  520. LDM SCCNT
  521. STM DSTATS+14
  522. LDM BCCNT
  523. STM DSTATS+19
  524. LDN 0
  525. STM PECNT
  526. STM BDCNT
  527. STM LPCNT
  528. STM SCCNT
  529. STM BCCNT
  530. *
  531. * * * SET NUMBER OF WORDS USED IN DATA SECTION
  532. * OF COMMUNICATION BUFFER
  533. *
  534. LDN 6
  535. STD DL
  536. *
  537. * * * SEND RESPONSE
  538. *
  539. RJM WRITE
  540. LJM PROCX WAIT FOR NEXT COMMAND
  541. *
  542. TITLE SPECIAL ROUTINES
  543. *
  544. * * SPEC
  545. *
  546. * FUNCTION CODE RESERVED FOR SPECIAL FUNCTIONS
  547. *
  548. SPEC BSS 0
  549. *
  550. * * * SEND RESPONSE
  551. RJM WRITE
  552. LJM PROCX WAIT FOR NEXT COMMAND
  553. * /--- BLOCK TLOP 00 000 77/09/22 00.37
  554. TITLE LOOPBACK TEST
  555. *
  556. * * TLOP
  557. *
  558. * TEST LOOP BACK TO MAKE SURE DATA IS BEING SENT
  559. * AND RECEIVE AT THIS SITE PROPERLY, ALSO CHECKS
  560. * TELEPHONE EQUIPMENT.
  561. *
  562. TLOP BSS 0
  563. LDM IHDR+STNO
  564. STD STATION
  565. *
  566. * * * RESERVE LOCAL EQUIPMENT
  567. RJM LRES
  568. *
  569. * * * SETUP 6681
  570. RJM SELDC
  571. *
  572. * * * ESTABLISH SYNCHRONIZATION
  573. CALL SEST,100
  574. *
  575. * * * SET TO OUTPUT 100 CHARACTERS OF DATA
  576. LDC 99
  577. STD SC
  578. *
  579. * * * WAIT FOR CHARACTER READY OR CHARACTER REQUEST
  580. NTL1 BSS 0
  581. CALL WCR,MCRQ+MCRD
  582. SHN 6
  583. MJN NTL2 JUMP IF CHARACTER READY
  584. *
  585. * * * OUTPUT A CHARACTER
  586. LDM XPATTRN
  587. CALL PUTCHR
  588. UJN NTL1
  589. *
  590. * * * SAVE INPUT CHARACTER IN DATA BUFFER FOR LINKCTL
  591. NTL2 BSS 0
  592. LDD CHAR
  593. STM DBUFF,SC
  594. *
  595. * * * INFINITE LOOP OR ONLY A HUNDRED
  596. LDM XLOOPS
  597. NJP NTL1 JUMP IF INFINITE LOOP
  598. *
  599. * * * HAVE 100 CHARACTERS BEEN OUTPUT
  600. SOD SC
  601. PJN NTL1 JUMP IF NOT
  602. *
  603. * * * SET TO PASS ALL INPUT TO LINKCTL
  604. LDN 21
  605. STD DL
  606. *
  607. * * * SEND RESPONSE
  608. RJM WRITE
  609. LJM PROCX WAIT FOR NEXT COMMAND
  610. * /--- BLOCK TEST 00 000 78/01/04 10.52
  611. *
  612. * * SPECIAL TEST ROUTINES
  613. *
  614. EJECT
  615. TEST BSS 0
  616. LJM PROCX WAIT FOR NEXT COMMAND
  617.  
  618. * /--- BLOCK LTLINK 00 000 78/01/05 09.03
  619. TITLE LOCAL TERMINAL MODE DRIVER
  620. *
  621. * * LTLINK
  622. *
  623. * THIS ROUTINE COMMUNICATES WITH PLATO AT THE SYSTEM
  624. * LOCAL TO THE TERMINAL. ITS JOB IS TO GET
  625. * KEYS FROM PLATO AND SEND THEM OVER THE LINK TO THE
  626. * REMOTE SYSTEM, WHILE AT THE SAME TIME ACCEPTING
  627. * FRAMES FROM THE LINK AND PUTTING THEM INTO
  628. * FRAMERS LINK BUFFER.
  629. *
  630. LTLINK BSS 0
  631. *
  632. * * * SET MASKS IN -TMIN- AND -TMOUT-
  633. LDN 1
  634. STM TOMK SET TO 1, FOR KEY OUTPUT
  635. LDN 3
  636. STM TIMK SET TO 3, FOR FRAME INPUT
  637. *
  638. * * * DO INITIALIZATIONS
  639. CALL TMSTART
  640. *
  641. * * * CHECK IF TIME TO SEND KEY OR GET FRAME
  642. LT0 BSS 0
  643. CALL CLOCK,7
  644. NJN LT1
  645. *
  646. * * * TALK TO PLATO THROUGH ECS
  647. CALL SENDFRM SEND FRAME TO PLATO
  648. CALL LCHK SERVICE COMMUNICATION EQUIP.
  649. CALL GETKEY CHECK FOR KEY INPUT
  650. CALL FRMOVE READY ANOTHER FRAME IF ONE.
  651. LT1 BSS 0
  652. CALL LCHK SERVICE COMMUNICATION EQUIP.
  653. *
  654. * * * IS IT TIME TO CHECK FRAMAT STATUS
  655. SOD FRCHK
  656. NJP LT0
  657. *
  658. * * * CHECK FOR FRAMAT RE-INITIALIZING
  659. CALL FRMCHK
  660. UJP LT0
  661. * /--- BLOCK LCHK 00 000 84/11/15 11.33
  662. TITLE TERMINAL MODE IO
  663. *
  664. * * LCHK
  665. *
  666. * 'CHECK COMMUNICATION EQUIPMENT TO SEE IF INPUT
  667. * WAITING OR READY TO SEND OUTPUT.
  668. *
  669. LCHK SUBR
  670. *
  671. * * * CHECK FOR CHARACTER READY OR CHARACTER REQUEST
  672. CALL WCR,MCRD+MCRQ
  673. ZJN LCHKX IF NEITHER STATUS APPEARED
  674. SHN 6
  675. PJN LCHK1 JUMP IF CHARACTER REQUEST
  676. *
  677. * * * CHECK FOR BUFFER OVERFLOW
  678. LDD ULP NEXT *IN* POINTER
  679. ADN CHPF CHARACTERS PER FRAME
  680. SBD FRAME NEXT *OUT* POINTER
  681. LPC TMASK KEEP IN RANGE
  682. ZJP OVERFLOW
  683. *
  684. * * * CHARACTER READY STATUS - PROCESS INPUT
  685. CALL TMIN
  686. MJN LCHKX IF ONLY SYNC CHARACTER
  687. *
  688. * * * MOVE FRAME TO -FRBUFF- IF NECESSARY OR POSSIBLE
  689. LDM FRBUFF
  690. NJN LCHKX IF ALREADY FILLED
  691. CALL FRMOVE READY NEXT FRAME
  692. LCHK2 UJN LCHKX
  693. *
  694. * * * CHECK CHARACTER IN TIME OUT
  695. LCHK1 BSS 0
  696. AOD TIME BUMP TIME OUT COUNTER
  697. ADC -ALSEVEN CHECK VALUE OF COUNTER
  698. ZJP LOSTC JUMP IF TIMED OUT
  699. *
  700. * * * DO WE HAVE OUTPUT TO SEND
  701. LDD KEY
  702. SBD ULU
  703. ZJN LCHK2 IF NO OUTPUT
  704. *
  705. * * * SEND KEY TO REMOTE SYSTEM
  706. CALL TMOUT
  707. UJN LCHK2
  708. *
  709. * * * INCREMENT OVERFLOW COUNTER
  710. OVERFLOW BSS 0
  711. AOM OVER
  712. LOADCM COMBF
  713. ADN 3
  714. CWM OVER,ON
  715. UJN LCHK2
  716. * *
  717. OVER BSSZ 1
  718. DIS ,*OVERFLOW*
  719. * /--- BLOCK GETKEY 00 000 77/10/02 23.04
  720. TITLE GET KEY FROM ECS KEY BUFFER
  721. *
  722. * * GETKEY
  723. *
  724. * THE KEY BUFFER CORRESPONDING TO THE TERMINAL
  725. * MODE STATION (TMSTAT) IS CHECK. 'IF A NEW
  726. * KEY IS PRESENT IT IS MOVED TO THE LINK OUTPUT
  727. * BUFFER AND THE CPU INDEX IS INCREMENTED BY
  728. * ONE. THE SECOND WORD OF THE KEY BUFFER IS THEN
  729. * WRITTEN BACK TO ECS TO UPDATE THE CPU INDEX.
  730. *
  731. * FORMAT OF KEY BUFFER';
  732. * / KEY / KEY / KEY / KEY / PPU INDEX /
  733. * / PRESS AND TIMING KEYS / CPU INDEX /
  734. *
  735. GETKEY SUBR
  736. *
  737. * * * CALCULATE OFFSET TO LINK STATIONS KEY BUFFER
  738. LDD TMSTAT
  739. SHN 1 TWO WORDS PER STATION
  740. STD ECSOFF
  741. *
  742. * * * READ THE KEY BUFFER FROM ECS
  743. LDN 2
  744. STD ECS NUMBER OF CM WORDS TO READ
  745. CALL READECS,PKEYECS
  746. *
  747. * * * ARE THERE ANY NEW KEYS
  748. LDM LKBUF+4 PPU INDEX (INPUT PTR)
  749. SBM LKBUF+9 CPU INDEX (OUTPUT PTR)
  750. ZJN GETKEYX IF NO NEW KEYS
  751. *
  752. * * * SERVICE COMMUNICATION EQUIPMENT
  753. CALL LCHK
  754. *
  755. * * * INCREMENT CPU INDEX AND LOCATE NEXT KEY
  756. AOM LKBUF+9
  757. LPN 3 MASK INDEX FOR MOD 4
  758. STD D0
  759. LDM LKBUF,D0 GET KEY
  760. STM KYBUFF SAVE KEY
  761. *
  762. * * * MOVE SECOND WORD OF KEY BUFFER TO FIRST
  763. * WORD OF PPU BUFFER SO IT CAN BE WRITTEN BACK.
  764. *
  765. LDN 4
  766. STD D0
  767. GK1 BSS 0
  768. LDM LKBUF+5,D0
  769. STM LKBUF,D0
  770. SOD D0
  771. PJP GK1 JUMP IF NOT ALL MOVED
  772. *
  773. * * * WRITE BACK TO ECS
  774. AOD ECSOFF POINT TO CPU WORD
  775. LDN 1
  776. STD ECS WRITE ONE WORD
  777. CALL WRITECS,PKEYECS
  778. *
  779. * * * MOVE NEW KEY TO OUTPUT BUFFER
  780. LDD KEY LOAD CHARACTER POSITION
  781. SHN -1 DIVIDE BY TWO, WORD POSITION
  782. STD TT SAVE
  783. LDM KYBUFF GET NEW KEY
  784. STM ISTART,TT MOVE TO OUTPUT BUFFER.
  785. *
  786. * * * MOVE POINTER TO NEXT AVAILABLE SPOT.
  787. LDD KEY GET POINTER
  788. ADN CHPK TWO CHARACTERS/KEY
  789. LPC TMASK KEEP MOD 128
  790. STD KEY
  791. LJM GETKEYX
  792. * /--- BLOCK SENDFRM 00 000 77/10/03 14.24
  793. TITLE SEND FRAME TO PLATO
  794. *
  795. * * SENDFRM
  796. *
  797. * IF A FRAME HAS BEEN RECEIVED FROM THE REMOTE
  798. * SYSTEM THIS ROUTINE WILL APPEND THE TERMINAL
  799. * MODE STATION NUMBER (TMSTAT) AND GIVE IT
  800. * TO THE FRAMER FOR OUTPUT TO THE APPROPRIATE
  801. * STATION. THE BUFFER (LINKIO) IS A CIRCULAR
  802. * BUFFER INTO WHICH THE PPU WRITES THE FRAMES
  803. * AND FROM WHICH THE FRAMER REMOVES THEM. LKIN
  804. * CONTROLS INPUT TO THE BUFFER WHILE LKOUT
  805. * CONTROLS REMOVAL OF INFORMATION FROM THE BUFFER.
  806. *
  807. * INPUT PARAMETERS';
  808. * (FRBUFF) = FRAME OR 0 IF NONE READY
  809. *
  810. SENDFRM SUBR
  811. *
  812. * * * IS THERE A FRAME READY TO GIVE TO FRAMER
  813. LDM FRBUFF
  814. ZJN SENDFRMX
  815. *
  816. * * * READ IN/OUT POINTERS FROM ECS
  817. LDN 0
  818. STD ECSOFF
  819. LDN 2
  820. STD ECS
  821. CALL READECS,LKIN
  822. *
  823. * * * CHECK FOR BUFFER FULL
  824. LDM LKBUF+4 IN POINTER
  825. ADN 1 BUMP TO NEXT WORD
  826. SBM LKBUF+9 OUT POINTER
  827. LPC LKMASK BUFFER LENGTH MASK
  828. ZJN SENDFRMX IF BUFFER FULL
  829. *
  830. * * * SERVICE COMMUNICATION EQUIPMENT
  831. CALL LCHK
  832. *
  833. * * * MOVE FRAME TO LKBUF FOR TRANSFER TO ECS
  834. LDM FRBUFF
  835. STM LKBUF
  836. LDM FRBUFF+1
  837. STM LKBUF+1
  838. *
  839. * * * ADD STATION NUMBER
  840. LDD TMSTAT
  841. STM LKBUF+2
  842. *
  843. * * * DETERMINE OFFSET IN LINKIO BUFFER
  844. LDM PFRAME+4
  845. LPC LKMASK BUFFER LENGTH MASK
  846. STD ECSOFF
  847. *
  848. * * * WRITE NEW FRAME TO ECS
  849. LDN 1
  850. STD ECS NUMBER OF WORDS TO WRITE
  851. CALL WRITECS,LINKIO
  852. *
  853. * * * SERVICE COMMUNICATION EQUIPMENT
  854. CALL LCHK
  855. *
  856. * * * INCREMENT LINKIO PPU POINTER
  857. CALL AFIVE,PFRAME
  858. *
  859. * * * UPDATE ECS COPY OF POINTER
  860. LDN 0
  861. STD ECSOFF
  862. CALL WRITECS,LKIN
  863. *
  864. * * * SET NO FRAME INDICATOR IN FRBUFF
  865. LDN 0
  866. STM FRBUFF
  867. LJM SENDFRMX
  868. * /--- BLOCK FRMOVE 00 000 77/10/03 14.22
  869. TITLE MOVE FRAME
  870. *
  871. * * FRMOVE
  872. *
  873. * THIS ROUTINE IS CALLED IF -FRBUFF- IS EMPTY
  874. * (FRBUFF=0). ITS FUNCTION IS TO MOVE THE
  875. * NEXT FRAME FROM THE INPUT BUFFER TO -FRBUFF-.
  876. * THIS CAN ONLY BE DONE WHEN THERE IS IN FACT
  877. * A COMPLETE FRAME ASSEMBLED IN THE INPUT
  878. * BUFFER.
  879. *
  880. FRMOVE SUBR
  881. *
  882. * * * IS THERE A COMPLETE FRAME IN THE -DBUFF-.
  883. LDD FRAME OUTPUT POINTER
  884. SHN -2 DIVIDE BY FOUR CHARS/FRAME
  885. STD TT
  886. LDD ULP NUMBER OF CHARACTERS INPUT
  887. SHN -2 DIVIDE BY FOUR
  888. SBD TT SUBTRACT OUTPUT POINTER
  889. ZJN FRMOVEX IF NO FRAME
  890. *
  891. * * * MOVE NEXT FRAME TO -FRBUFF-
  892. LDD TT CALCULATE WORD POSITION
  893. SHN 1
  894. STD TT
  895. *
  896. * * * CHECK FIRST WORD FOR NEGATIVE VALUE(START BIT)
  897. LDM OSTART,TT 1ST WORD OF FRAME
  898. ADC 4000B ADD IN START BIT
  899. STM FRBUFF
  900. *
  901. * * * GET AND CHECK SECOND WORD OF FRAME, IS IT POSITIVE
  902. LDM OSTART+1,TT SECOND WORD OF FRAME
  903. STM FRBUFF+1
  904. *
  905. * * * ADJUST OUTPUT POINTER TO NEXT FRAME POSITION
  906. XFR1 BSS 0
  907. LDD FRAME GET CURRENT VALUE
  908. ADN CHPF FOUR CHARACTERS/FRAME
  909. LPC TMASK MODULO 512
  910. STD FRAME SAVE NEW VALUE
  911. UJN FRMOVEX
  912. * /--- BLOCK RTLINK 00 000 78/01/05 09.04
  913. TITLE REMOTE TERMINAL MODE DRIVER
  914. *
  915. * * RTLINK
  916. *
  917. * THIS ROUTINE COMMUNICATES WITH PLATO AT THE SYSTEM
  918. * REMOTE TO THE TERMINAL. ITS JOB IS TO GET
  919. * FRAMES FROM PLATO AND SEND THEM OVER THE LINK TO
  920. * THE SYSTEM LOCAL TO THE TERMINAL, WHILE AT THE
  921. * SAME TIME ACCEPTING KEYS FROM THE LINK AND
  922. * PUTTING THEM INTO PLATOS KEY BUFFER.
  923. *
  924. RTLINK BSS 0
  925. *
  926. * * * MAKE SURE REMOTE IS STILL IN TOUCH
  927. CALL SEST,2
  928. *
  929. * * * SEND REQUEST REPLY
  930. CALL MESSOUT
  931. *
  932. * * * SET MASK FOR IN -TMIN- AND -TMOUT-
  933. LDN 1
  934. STM TIMK SET TO 1, KEY INPUT
  935. LDN 3
  936. STM TOMK SET TO 3, FRAME OUTPUT
  937. *
  938. * * * DO INITIALIZATIONS
  939. CALL TMSTART
  940. *
  941. * * * WRITE NONZERO TO FRAMER STATUS WORD
  942. LDN 77B
  943. STM LKBUF+4
  944. LDN 1
  945. STD ECS NUMBER OF WORDS
  946. LDM FRAMID OFFSET TO CORRECT WORD
  947. STD ECSOFF
  948. CALL WRITECS,PIOSTS
  949. *
  950. * * * CHECK IF TIME TO SEND KEY OR GET FRAME
  951. * WILL BE DONE APPROXIMATELY EVERY 16 MS.
  952. RT0 BSS 0
  953. CALL CLOCK,15
  954. NJN RT1
  955. *
  956. * * * TALK TO PLATO THROUGH ECS
  957. CALL SENDKEY SEND KEY TO PLATO
  958. CALL RCHK SERVICE COMMUNICATION EQUIP
  959. CALL GETFRAM GET FRAME FROM PLATO
  960. CALL KYMOVE CHECK FOR ANOTHER KEY READY
  961. RT1 BSS 0
  962. CALL RCHK SERVICE COMMUNITION EQUIP
  963. *
  964. * * * IS IT TIME TO CHECK FRAMAT STATUS
  965. SOD FRCHK
  966. NJP RT0
  967. *
  968. * * * CHECK FOR FRAMAT RE-INITIALIZING.
  969. CALL FRMCHK
  970. UJP RT0
  971. * /--- BLOCK RCHK 00 000 84/11/15 11.33
  972. TITLE TERMINAL MODE IO
  973. *
  974. * * RCHK
  975. *
  976. * 'CHECK COMMUNICATION EQUIPMENT TO SEE IF INPUT
  977. * WAITING OR READY TO SEND OUTPUT.
  978. *
  979. RCHK SUBR
  980. *
  981. * * * CHECK FOR CHARACTER READY AND CHARACTER REQUEST
  982. CALL WCR,MCRD+MCRQ
  983. ZJN RCHKX IF NEITHER STATUS APPEARED
  984. SHN 6
  985. PJP RCHK1 JUMP IF CHARACTER NOT READY
  986. *
  987. * * * CHARACTER READY STATUS - PROCESS INPUT
  988. CALL TMIN
  989. MJN RCHKX IF ONLY SYNC CHARACTER
  990. *
  991. * * * MOVE KEY TO -KEYBUFF- IF NECESSARY OR POSSIBLE
  992. LDM KYBUFF
  993. SHN 6
  994. PJN RCHKX IF KEY ALREADY THERE
  995. CALL KYMOVE
  996. UJN RCHKX
  997. *
  998. * * * CHECK CHARACTER READY TIME OUT
  999. RCHK1 BSS 0
  1000. AOD TIME BUMP TIME OUT COUNTER
  1001. ADC -ALSEVEN CHECK VALUE OF COUNTER
  1002. ZJP LOSTC JUMP IF TIMED OUT
  1003. *
  1004. * * * DO WE HAVE OUTPUT TO SEND
  1005. LDD FRAME
  1006. SBD ULU
  1007. ZJN RCHKX IF NOTHING TO OUTPUT
  1008. *
  1009. * * * SEND FRAME TO REMOTE SYSTEM
  1010. CALL TMOUT
  1011. LJM RCHKX
  1012. * /--- BLOCK SENDKEY 00 000 77/10/03 15.43
  1013. TITLE SEND KEY TO PLATO
  1014. *
  1015. * * SENDKEY
  1016. *
  1017. * WHEN A KEY HAS BEEN RECEIVED FROM THE REMOTE
  1018. * SYSTEM THIS ROUTINE READS THE KEY BUFFER
  1019. * CORRESPONDING TO THE TERMINAL MODE STATION
  1020. * (TMSTAT) AND MOVES THE KEY INTO THE CORRECT
  1021. * BYTE. THE PPU INDEX IS THEN INCREMENTED AND
  1022. * THE FIRST WORD OF THE KEY BUFFER IS WRITTEN
  1023. * BACK TO ECS. THE KEYS-IN BIT CORRESPONDING
  1024. * TO THIS STATION IS THEN SET IN THE ECS
  1025. * KEYS-IN BUFFER (PECSIN).
  1026. *
  1027. * FORMAT OF KEY BUFFER';
  1028. * / KEY / KEY / KEY / KEY / PPU INDEX /
  1029. * / PRESS AND TIMING KEYS / CPU INDEX /
  1030. *
  1031. * INPUT PARAMETERS';
  1032. * (KYBUFF) = KEY TO SEND OR 7777B IF NO KEY READY
  1033. *
  1034. SENDKEY SUBR
  1035. *
  1036. * * * CHECK FOR KEY TO SEND
  1037. LDM KYBUFF
  1038. SHN 6
  1039. MJN SENDKEYX IF NO KEY READY TO SEND
  1040. *
  1041. * * * CALCULATE OFFSET TO KEY BUFFER
  1042. LDD TMSTAT TERMINALS STATION NUMBER
  1043. SHN 1 2 WORDS PER BUFFER
  1044. STD ECSOFF OFFSET TO KEY BUFFER
  1045. *
  1046. * * * READ THE KEY BUFFER
  1047. LDN 2 NUMBER OF CM WORDS
  1048. STD ECS
  1049. CALL READECS,PKEYECS
  1050. *
  1051. * * * IS THERE ROOM FOR THIS KEY
  1052. LDM LKBUF+4 PPU INDEX IN KEY BUFFER
  1053. SBM LKBUF+9 CPU INDEX IN KEY BUFFER
  1054. ZJP SK1 JUMP IF NO KEYS IN BUFFER
  1055. LPN 3 MASK INDEX FOR MOD 4
  1056. ZJP SK5 IGNORE KEYS NO ROOM
  1057. *
  1058. * * * SERVICE COMMUNICATION EQUIPMENT
  1059. CALL RCHK
  1060. *
  1061. * * * BUMP PPU INDEX TO DETERMINE WHERE NEXT KEY GOES
  1062. SK1 BSS 0
  1063. AOM LKBUF+4 INCREMENT PPU INDEX
  1064. LPN 3 MASK TO FIND BYTE INDEX
  1065. STD D0 SAVE INDEX
  1066. LDM KYBUFF GET NEW KEY
  1067. STM LKBUF,D0 PLUG IN NEW KEY
  1068. *
  1069. * * * WRITE KEY BUFFER BACK TO ECS
  1070. LDN 1 NUMBER OF CM WORDS
  1071. STD ECS
  1072. CALL WRITECS,PKEYECS
  1073. *
  1074. * * * SERVICE COMMUNICATION EQUIPMENT
  1075. CALL RCHK
  1076. * /--- BLOCK SENDKEY 00 000 77/10/03 15.44
  1077. *
  1078. * * * COMPUTE INDEX FOR THIS STATION IN KEYS-IN BIT TAB.
  1079. LDD TMSTAT
  1080. SHN 18-5 DIVIDE BY 32
  1081. STD ECSOFF SAVE WORD OFFSET
  1082. SHN 5
  1083. LPN 37B MASK FOR STATION NUMBER
  1084. ADN 4 ADD BIAS TO STARTING BIT
  1085. STD T1
  1086. *
  1087. * * * COMPUTE BYTE AND BIT POSITION IN THAT BYTE
  1088. LDN 3
  1089. STD SENDI BYTES 1-3 HAVE KEYS-IN BITS
  1090. SK2 BSS 0
  1091. LDD T1
  1092. SBN 12
  1093. MJP SK3 JUMP IF IN THIS BYTE
  1094. STD T1
  1095. SOD SENDI DECREMENT BYTE POINTER
  1096. UJP SK2
  1097. *
  1098. * * * SET UP SHIFT INSTRUCTION TO POSITION BIT
  1099. SK3 BSS 0
  1100. LDM SKSHF
  1101. LPC -77B MASK OFF OLD SHIFT COUNT
  1102. ADD T1 ADD IN NEW SHIFT COUNT
  1103. STM SKSHF
  1104. *
  1105. * * * POSITION BIT MASK AND SET UP MASKING INSTRUCTIONS
  1106. LDN 1
  1107. SKSHF BSS 0
  1108. SHN 0 POSITION BIT WITHIN BYTE
  1109. STM SKAND LOGICAL PRODUCT INSTRUCTION
  1110. STM SKXOR LOGICAL DIFFERENCE INSTRUCTION
  1111. *
  1112. * * * READ KEYS-IN WORD ( 1 WORD)
  1113. CALL READECS,PECSIN
  1114. *
  1115. * * * SERVICE COMMUNICATION EQUIPMENT
  1116. CALL RCHK
  1117. *
  1118. * * * CHECK FOR BIT ALREADY SET
  1119. SK4 BSS 0
  1120. LDM LKBUF,SENDI
  1121. LPC 0 MASK BIT
  1122. SKAND EQU *-1
  1123. NJP SK5 EXIT IF ALREADY SET
  1124. *
  1125. * * * SET BIT
  1126. LDM LKBUF,SENDI
  1127. LMC 0
  1128. SKXOR EQU *-1
  1129. STM LKBUF,SENDI
  1130. *
  1131. * * * MARK LOWEST BYTE FOR REREAD
  1132. LDM FRAMID
  1133. STM LKBUF+4
  1134. *
  1135. * * * WRITE BACK TO ECS
  1136. CALL WRITECS,PECSIN
  1137. *
  1138. * * * SERVICE COMMUNICATION EQUIPMENT
  1139. CALL RCHK
  1140. *
  1141. * * * READ BACK AND CHECK FOR CPU CONFLICT
  1142. CALL READECS,PECSIN
  1143. LDM LKBUF+4
  1144. SBM FRAMID
  1145. NJP SK4 JUMP IF CONFLICT OCCURRED
  1146. *
  1147. * * * INITIALIZE KYBUFF
  1148. SK5 BSS 0
  1149. LDC 7777B
  1150. STM KYBUFF
  1151. LJM SENDKEYX
  1152. * /--- BLOCK GETFRAM 00 000 77/10/03 15.45
  1153. TITLE GET FRAMES FROM ECS
  1154. *
  1155. * * GETFRAM
  1156. *
  1157. * WHEN A STATION IS USING TERMINAL MODE THE
  1158. * FRAMER DIRECTS ALL OF ITS OUTPUT TO A SPECIAL
  1159. * SET OF FRAMES. EACH FRAME IN THIS BUFFER (LFRBUF)
  1160. * IS 4 WORDS LONG AND HAS A CORRESPONDING
  1161. * ENTRY IN ASSOCIATED TABLE (LFRLTHS) WHICH GIVES
  1162. * THE NUMBER OF TERMINAL FRAMES IN THE FRAME
  1163. * WAITING TO BE OUTPUT. THE LINK DRIVER MARKS
  1164. * THE FRAME THAT IT WILL LOOK AT NEXT BY
  1165. * INCREMENTING LFRPNT. THE BOTTOM SEVEN BITS
  1166. * OF THIS POINTER ARE THE FRAME INDEX. THIS
  1167. * ROUTINE MOVES THE TERMINAL FRAMES FROM
  1168. * THE FRAME BUFFER INTO THE LINK DRIVER OUTPUT
  1169. * BUFFER FOR LATER TRANSMISSION.
  1170. *
  1171. *
  1172. GETFRAM SUBR
  1173. *
  1174. * * * SAVE CURRENT FRAME POINTER
  1175. LDM IFRAME+4
  1176. STM IFRAMEX
  1177. *
  1178. * * * BUMP PPU FRAME POINTER, ALSO MOVES TO LKBUF
  1179. CALL AFIVE,IFRAME
  1180. *
  1181. * * * WRITE IT TO ECS
  1182. LDN 0
  1183. STD ECSOFF
  1184. LDN 1
  1185. STD ECS NUMBER OF WORDS TO WRITE
  1186. CALL WRITECS,LFRPNT
  1187. *
  1188. * * * SERVICE COMMUNICATION EQUIPMENT
  1189. CALL RCHK
  1190. * /--- BLOCK GETFRAM 00 000 77/10/03 15.45
  1191. *
  1192. * * * ISOLATE FRAME INDEX
  1193. LDM IFRAMEX
  1194. LPC 177B 128 FRAMES
  1195. STD ECSOFF
  1196. *
  1197. * * * READ FRAME LENGTH
  1198. CALL READECS,LFRLTHS
  1199. LDM LKBUF+4
  1200. ZJN GETFRAMX IF FRAME IS EMPTY
  1201. STD ECS SAVE FRAME COUNT
  1202. *
  1203. * * * SERVICE COMMUNICATION EQUIPMENT
  1204. CALL RCHK
  1205. *
  1206. * * * CALCULATE OFFSET OF FRAME IN FRAME BUFFER
  1207. LDD ECSOFF FRAME NUMBER
  1208. SHN 2 4 WORDS PER FRAME
  1209. STD ECSOFF
  1210. *
  1211. * * * READ FRAME FROM ECS
  1212. CALL READECS,LFRBUF
  1213. *
  1214. * * * CALCULATE POSITION OF LAST FRAME IN LKBUF
  1215. * (NEW ECS) = ((OLD ECS)-1)*5
  1216. LDD ECS NUMBER OF FRAMES
  1217. SBN 1 ADJUST SO 1 EQUALS ZERO OFFSET
  1218. STD ECS SAVE NO. OF FRAMES - 1
  1219. SHN 2 MULTIPLE BY 4
  1220. RAD ECS
  1221. *
  1222. * * * MOVE NEW FRAME TO OUTPUT BUFFER
  1223. LDD FRAME LOAD CHARACTER POSITION
  1224. SHN -1 DIVIDE BY TWO, WORD POSITION
  1225. STD TT SAVE
  1226. LDM LKBUF,ECS GET 1ST BYTE OF FRAME
  1227. STM ISTART,TT MOVE TO OUTPUT BUFFER.
  1228. LDM LKBUF+1,ECS GET 2ND BYTE OF FRAME
  1229. STM ISTART+1,TT MOVE IT TO THE OUTPUT BUFFER
  1230. *
  1231. * * * MOVE POINTER TO NEXT AVAILABLE SPOT.
  1232. LDD FRAME GET POINTER
  1233. ADN CHPF FOUR CHARACTERS/FRAME
  1234. LPC TMASK KEEP MOD 128
  1235. STD FRAME
  1236. LJM GETFRAMX
  1237. *
  1238. * /--- BLOCK KYMOVE 00 000 77/10/03 14.22
  1239. TITLE MOVE KEY
  1240. *
  1241. * * KYMOVE
  1242. *
  1243. * THIS ROUTINE IS CALLED IF -KYBUFF- IS EMPTY
  1244. * (KYBUFF=4XXX). ITS FUNCTION IS TO MOVE THE
  1245. * NEXT KEY FROM THE INPUT BUFFER TO -KYBUFF-.
  1246. * THIS CAN ONLY BE DONE WHEN THERE IS IN FACT
  1247. * A COMPLETE KEY ASSEMBLED IN THE INPUT
  1248. * BUFFER.
  1249. *
  1250. KYMOVE SUBR
  1251. *
  1252. * * * IS THERE A COMPLETE KEY IN THE -DBUFF-.
  1253. LDD KEY OUTPUT POINTER
  1254. SHN -1 DIVIDE BY TWO CHARS/FRAME
  1255. STD TT
  1256. LDD ULP NUMBER OF CHARACTERS INPUT
  1257. SHN -1 DIVIDE BY TWO
  1258. SBD TT SUBTRACT OUTPUT POINTER
  1259. ZJN KYMOVEX IF NO KEY
  1260. *
  1261. * * * MOVE NEXT KEY TO -KYBUFF-
  1262. LDM OSTART,TT GET NEW KEY
  1263. STM KYBUFF
  1264. *
  1265. * * * ADJUST OUTPUT POINTER TO NEXT FRAME POSITION
  1266. LDD KEY GET CURRENT VALUE
  1267. ADN CHPK TWO CHARACTERS/FRAME
  1268. LPC TMASK MOD 512
  1269. STD KEY SAVE NEW VALUE
  1270. UJN KYMOVEX
  1271. * /--- BLOCK TMSTART 00 000 78/01/04 21.48
  1272. EJECT
  1273. *
  1274. * * TMSTART
  1275. *
  1276. TMSTART SUBR
  1277. *
  1278. * * * SET MODE TO TERMINAL MODE AND STATUS COUNT
  1279. LDN 1
  1280. STD MODE
  1281. STD NC
  1282. *
  1283. * * * INITIALIZE PACKING AND UNPACKING VARIABLES
  1284. LDN 0
  1285. STD WP
  1286. STD WU
  1287. STD ULU
  1288. STD ULP
  1289. STD KEY
  1290. STD FRAME
  1291. STD TIME
  1292. STD CLK
  1293. STM CLKU
  1294. STM CLKL
  1295. LDC ALSEVEN
  1296. STD NW
  1297. *
  1298. * * * SET TERMINAL MODE STATION.
  1299. LDM XTMSTAT
  1300. STD TMSTAT
  1301. *
  1302. * * * SET FRAM ID NUMBER
  1303. LDM XFRAMID
  1304. STM FRAMID
  1305. *
  1306. * * * SAVE NO. OF TERMINAL WORDS IN FRAME
  1307. LDM XLFRLTH
  1308. STM LFRLTH
  1309. *
  1310. * * * SET -FORINIP- ECS ADDRESS
  1311. LDM ECL LOWER ECS RA
  1312. ADC XFORINIP ADD RELATIVE ADDRESS
  1313. STM FORINIP+1
  1314. SHN -12
  1315. ADM ECU ADD IN UPPER ECS RA
  1316. STM FORINIP
  1317. *
  1318. * * * SET UP ECS ADDRESS TABLE
  1319. LDN 0
  1320. STD T1 POINTER TO ADDRESS TABLE
  1321. STD T2 POINTER TO INPUT BUFFER
  1322. TMS1 BSS 0
  1323. LDM XPKEYEC+1,T2 LOWER 12 BITS OF ECS ADDRESS
  1324. ADM ECL LOWER 12 BITS OF ECS RA
  1325. STM ECSAD+1,T1
  1326. SHN -12
  1327. ADM ECU UPPER 9 BITS OF ECS RA
  1328. ADM XPKEYEC,T2 UPPER 9 BITS OF ECS ADDRESS
  1329. STM ECSAD,T1
  1330. LDN 5
  1331. RAD T2 BUMP POINTER TO INPUT BUFFER
  1332. LDN 2
  1333. RAD T1 BUMP POINTER TO ADDRESS TABLE
  1334. SBN ECSLTH SUBTRACT LENGTH OF TABLE
  1335. MJN TMS1 JUMP IF MORE TO DO
  1336. *
  1337. * * * CLEAR IN/OUT POINTERS FOR LINK TO FRAMER BUFFER
  1338. CALL LCLEAR,10 CLEAR FIRST 10 BYTES OF LKBUF
  1339. LDN 2
  1340. STD ECS WRITE 2 CM WORDS
  1341. LDN 0
  1342. STD ECSOFF NO OFFSET
  1343. CALL WRITECS,LKIN CLEAR POINTERS
  1344. *
  1345. * * * INITIALIZE LOCAL FRAME POINTER
  1346. LDN 1
  1347. STD ECS TRANSFER 1 WORD
  1348. CALL READECS,LFRPNT
  1349. *
  1350. * * * MOVE FRAME POINTER TO LOCAL BUFFER
  1351. LDN 4
  1352. STD T1
  1353. TMS3 BSS 0
  1354. LDM LKBUF,T1
  1355. STM IFRAME,T1
  1356. SOD T1
  1357. PJN TMS3 JUMP IF MORE TO MOVE
  1358. LJM TMSTARTX
  1359. * /--- BLOCK TMIN 00 000 77/08/17 14.05
  1360. TITLE TERMINAL MODE INPUT-OUTPUT
  1361. *
  1362. * * TMIN
  1363. *
  1364. * THIS ROUTINE PROCESSES INPUT FROM THE 311 AND
  1365. * PACKS IT INTO -XBUFF-. IF THIS SYSTEM IS
  1366. * THE REMOTE SYSTEM INPUT WILL BE KEYS, WHILE
  1367. * A LOCAL SYSTEM WILL INPUT OUTPUT FRAMES.
  1368. * EXIT PARAMETERS
  1369. * (A) WITH BE NEGATIVE IF CHARACTER WAS SYNC CODE.
  1370. * (A) WITH BE POSITIVE IF ANY OTHER CHARACTER.
  1371. *
  1372. TMIN SUBR
  1373. LDN 0
  1374. STD TIME CLEAR TIMEOUT COUNTER
  1375. *
  1376. * * * PROCESS INPUT
  1377. CALL GETCHR
  1378. MJN TMINX IF SYNC CODE
  1379. *
  1380. * * * CHECK OUT OF SEQUENCE
  1381. LDD ULP
  1382. LPC 1 THIS MASK IS SET TO 1 OR 3 BY
  1383. TIMK EQU *-1 -TLSET- OR -RTLSET-.
  1384. ADN 3 SET BIT 2 IF 1, 2 OR 3
  1385. SHN 3 POSITION START BIT MASK
  1386. LMD CHAR MASK CHARACTER
  1387. SHN 12 WAS BIT CORRECT
  1388. PJN TMINX
  1389. *
  1390. * * * CHECK WHERE IN BYTE THIS CHARACTER SHOULD GO
  1391. TM1 BSS 0
  1392. AOD ULP
  1393. LPN 1
  1394. ZJN TM2 JUMP IF LOWER CHARACTER
  1395. AOD WP ADVANCE WORD POINTER.
  1396. *
  1397. * * * PUT NEW CHAR. INTO UPPER CHAR. POSITION
  1398. LDD CHAR
  1399. LPN 37B
  1400. SHN 5
  1401. STM OSTART-1,WP STORE IN BUFFER
  1402. UJN TM3
  1403. *
  1404. * * * STORE NEW CHAR. IN LOWER CHAR. POSITION
  1405. TM2 BSS 0
  1406. LDD CHAR
  1407. LPN 37B
  1408. RAM OSTART-1,WP STORE INTO BUFFER
  1409. *
  1410. * * * HAVE WE REACHED THE END OF THE BUFFER
  1411. TM3 BSS 0
  1412. LDD ULP
  1413. LPC TMASK
  1414. NJN TM4 IF STILL ROOM
  1415. STD WP OTHERWISE START AT BEGINNING
  1416. STD ULP
  1417. TM4 LJM TMINX
  1418. * /--- BLOCK TMOUT 00 000 76/06/11 15.52
  1419. EJECT
  1420. *
  1421. * * TMOUT
  1422. *
  1423. * THIS ROUTINE HANDLES 311 OUTPUT DURING TERMINAL
  1424. * MODE OPERATION. THE OUTPUT WILL BE KEYS IF AT
  1425. * THE LOCAL SYSTEM, WHILE FRAMES WILL BE OUTPUT
  1426. * IF AT THE REMOTE SYSTEM. THE DATA IS UNPACKED
  1427. * FROM -DBUFF- AND SENT 6 BITS AT A TIME.
  1428. *
  1429. TMOUT SUBR
  1430. *
  1431. * * * IS NEXT CHAR. TO BE TAKEN FROM UPPER OR LOWER
  1432. AOD ULU
  1433. LPN 1
  1434. ZJN TO1 JUMP IF LOWER
  1435. *
  1436. * * * BUMP TO NEXT WORD IN BUFFER.
  1437. AOD WU
  1438. *
  1439. * * * ISOLATE UPPER 5 BITS.
  1440. LDM ISTART-1,WU
  1441. SHN 13
  1442. UJN TO2
  1443. *
  1444. * * * GET LOWER FIVE BITS IN WORD
  1445. TO1 BSS 0
  1446. LDM ISTART-1,WU
  1447. *
  1448. * * * ISOLATE FIVE BIT PACKAGE
  1449. TO2 BSS 0
  1450. LPN 37B
  1451. ADC DCON
  1452. STD OC
  1453. *
  1454. * * * ADD START BIT IF STARTING CHAR. OF FRAME OR KEY
  1455. LDD ULU
  1456. SBN 1
  1457. LPC 1 'THIS MASK SET TO 1 OR 3 BY
  1458. TOMK EQU *-1 -TLSET- OR -RTLSET-.
  1459. NJN TO3
  1460. *
  1461. * * * ADD START BIT
  1462. LDN 40B
  1463. RAD OC
  1464. *
  1465. * * * SEND THIS CHARACTER
  1466. TO3 BSS 0
  1467. LDM PARTBLE,OC GET PARITY BIT
  1468. CALL OCHR
  1469. *
  1470. * * * IF AT END OF BUFFER SET POINTER TO BEGINNING
  1471. LDD ULU
  1472. LPC TMASK MODULO 1024
  1473. NJN TO4 IF NOT AT END
  1474. STD WU RESET POINTER TO FIRST WORD.
  1475. STD ULU
  1476. TO4 LJM TMOUTX
  1477. * /--- BLOCK READECS 00 000 77/08/29 15.26
  1478. TITLE READ ECS
  1479. *
  1480. * * READECS
  1481. *
  1482. * READ ECS USING CPU MONITOR CALL, WHICH TRANSFERS
  1483. * DATA TO CM (TRNBF) WHERE THE PPU CAN THEN READ IT.
  1484. *
  1485. * INPUT PARAMETERS';
  1486. * (A) - POINTER TO ECS ADDRESS
  1487. * (ECS) - NUMBER OF CM WORDS (1-60D)
  1488. * (ECSOFF) - OFFSET TO ADD TO BASE ECS ADDRESS
  1489. *
  1490. * OUTPUT PARAMETERS';
  1491. * (LKBUF) - DATA READ FROM ECS
  1492. * (A) = ZERO - TRANSFER OKAY
  1493. * = NONZERO - ECS ERROR
  1494. *
  1495. *
  1496. READECS SUBR
  1497. *
  1498. * * * SAVE ADDRESS OF ECS ADDRESS
  1499. STD TT
  1500. *
  1501. LDK ZERL (A) = CM ADDR OF ZERO WORD
  1502. CRD CM CLEAR LIST ENTRY
  1503. LDM 1,TT LOWER 12 BITS OF ADDRESS
  1504. ADD ECSOFF ADD OFFSET
  1505. STD CM+4
  1506. SHN -12 SAVE ADD OVERFLOW
  1507. ADM 0,TT UPPER 9 BITS OF ADDRESS
  1508. STD CM+3
  1509. .NOSV2 IFLT OSLEV,562D IF NOS V1
  1510. LDD MA
  1511. CWD CM (MB) = 36/TRASH,24/EM ADDRESS
  1512. *
  1513. * * * PUT SUBFUNCTION AND R/W CODES INTO REQUEST
  1514. LDN 0
  1515. STD CM+4 (CM+4) = R/W CODE (READ)
  1516. LDC /CPS/RWEM*1000B
  1517. STD CM+3 (CM+3) = SUBFUNCTION = *RWEM*
  1518. *
  1519. * * * PUT CM ADDRESS AND NO. OF WORDS INTO REQUEST
  1520. LOADCM TRNBF GET CM ADDRESS
  1521. STD CM+2 STORE LOWER 12 BITS
  1522. SHN -12 POSITION TOP 6 BITS
  1523. STD CM+1
  1524. LDD ECS NO. OF WORDS MINUS ONE
  1525. SBN 1 ADJUST COUNT FOR THIS REQUEST
  1526. SHN 6
  1527. RAD CM+1 ADD TO REQUEST
  1528. .NOSV2 ELSE IF NOS V2
  1529. LDD ECS (A) = NUM OF CPU WORDS TO READ
  1530. SHN 6
  1531. STD CM+1 (CM+1) = CPU WORDS TO READ
  1532. LOADCM TRNBF (A) = CM ADDRESS OF LIST
  1533. CWD CM UPDATE LIST (1 ENTRY)
  1534.  
  1535. LDK ZERL (A) = CM ADDR OF ZERO WORD
  1536. CRD CM CLEAR REQUEST WORD
  1537. LDN 1 (A) = ONE LIST ENTRY TO PROCESS
  1538. SHN 6
  1539. STD CM+1 (CM+1) = NUMBER OF LIST ENTRIES
  1540. LOADCM TRNBF (A) = CM ADDRESS OF LIST
  1541. STD CM+2 (CM+2) = LOWER PART OF LIST ADR
  1542. SHN -12D POSITION UPPER PART OF LIST ADR
  1543. LPN 77B (A) = UPPER PART W/OUT SIGN EXT
  1544. RAD CM+1 (CM+1) NOW INCLUDES UPPER PART
  1545.  
  1546. * SET THE SUBFUNCTION (*PELS*), READ EM, AND
  1547. * ABSOLUTE SYSTEM EM ADDRESS.
  1548.  
  1549. LDK /CPS/PELS*1000B (A) = SUBFUNCTION = *PELS*
  1550. STD CM+3
  1551. .NOSV2 ENDIF
  1552. *
  1553. * * * READ ECS TO CM
  1554. MONITOR ECSM READ ECS TO CM
  1555. LDD CM+1
  1556. * /--- BLOCK READECS 00 000 84/11/15 11.34
  1557. NJP READECSX IF EM ERROR
  1558. *
  1559. * * * READ CM TO PPU
  1560. LOADCM TRNBF CM LOCATION OF DATA
  1561. .NOSV2 IFGE OSLEV,562D IF NOS V2
  1562. ADN 1 SKIP THE LIST
  1563. .NOSV2 ENDIF
  1564. CRM LKBUF,ECS
  1565. LDN 0
  1566. LJM READECSX
  1567. * /--- BLOCK WRITECS 00 000 77/08/29 15.27
  1568. TITLE WRITE ECS
  1569. *
  1570. * * WRITECS
  1571. *
  1572. * WRITE ECS USING CPU MONITOR CALL. THE DATA
  1573. * IS TRANSFERRED TO A CM BUFFER (TRNBF) BY THE
  1574. * PPU, THEN TO ECS USING THE MONITOR CALL.
  1575. *
  1576. * INPUT PARAMETERS';
  1577. * (A) - POINTER TO ECS ADDRESS
  1578. * (ECS) - NUMBER OF CM WORDS (1-64)
  1579. * (ECSOFF) - OFFSET TO ADD TO BASE ECS ADDRESS
  1580. * (LKBUF) - DATA TO BE WRITTEN
  1581. *
  1582. * OUTPUT PARAMETERS';
  1583. * (A) = ZERO - TRANSFER OKAY
  1584. * = NONZERO - ECS ERROR
  1585. *
  1586. * MONITOR REQUEST FORMAT
  1587. * / REQUEST CODE / NNCC / CCCC / REEE / EEEE/
  1588. * N - NUMBER OF CM WORDS MINUS ONE.
  1589. * C - CM BUFFER ADDRESS
  1590. * R - READ/WRITE CODE (READ = 2, WRITE = 3)
  1591. * E - ECS ADDRESS
  1592. *
  1593. *
  1594. WRITECS SUBR
  1595. *
  1596. * * * SAVE ADDRESS OF ECS ADDRESS
  1597. STD TT
  1598. * * * PUT ECS ADDRESS INTO REQUEST
  1599. LDK ZERL (A) = CM ADDR OF ZERO WORD
  1600. CRD CM CLEAR LIST ENTRY
  1601. LDM 1,TT LOWER 12 BITS OF ADDRESS
  1602. ADD ECSOFF ADD OFFSET
  1603. STD CM+4
  1604. SHN -12 SAVE ADD OVERFLOW
  1605. ADM 0,TT UPPER 9 BITS OF ADDRESS
  1606. STD CM+3
  1607. .NOSV2 IFLT OSLEV,562D IF NOS V1
  1608. LDD MA
  1609. CWD CM (MB) = 36/TRASH,24/EM ADDRESS
  1610. *
  1611. * * * PUT SUBFUNCTION AND R/W CODES INTO REQUEST
  1612. LDN 1
  1613. STD CM+4 (CM+4) = R/W CODE (WRITE)
  1614. LDC /CPS/RWEM*1000B
  1615. STD CM+3 (CM+3) = SUBFUNCTION = *RWEM*
  1616. *
  1617. * * * PUT CM ADDRESS AND NO. OF WORDS INTO REQUEST
  1618. LOADCM TRNBF GET CM ADDRESS
  1619. STD CM+2 STORE LOWER 12 BITS
  1620. SHN -12 POSITION TOP 6 BITS
  1621. STD CM+1
  1622. LDD ECS NO. OF WORDS
  1623. SBN 1 ADJUST COUNT FOR THIS REQUEST
  1624. SHN 6
  1625. RAD CM+1 ADD TO REQUEST
  1626. .NOSV2 ELSE IF NOS V2
  1627. LDD ECS (A) = NUM OF CPU WORDS TO READ
  1628. SHN 6
  1629. STD CM+1 (CM+1) = CPU WORDS TO READ
  1630. LOADCM TRNBF (A) = CM ADDRESS OF LIST
  1631. CWD CM UPDATE LIST (1 ENTRY)
  1632.  
  1633. LDK ZERL (A) = CM ADDR OF ZERO WORD
  1634. CRD CM CLEAR REQUEST WORD
  1635. LDN 1 (A) = ONE LIST ENTRY TO PROCESS
  1636. SHN 6
  1637. STD CM+1 (CM+1) = NUMBER OF LIST ENTRIES
  1638. LOADCM TRNBF (A) = CM ADDRESS OF LIST
  1639. STD CM+2 (CM+2) = LOWER PART OF LIST ADR
  1640. SHN -12D POSITION UPPER PART OF LIST ADR
  1641. LPN 77B (A) = UPPER PART W/OUT SIGN EXT
  1642. RAD CM+1 (CM+1) NOW INCLUDES UPPER PART
  1643.  
  1644. * /--- BLOCK WRITECS 00 000 77/08/29 15.27
  1645. * SET THE SUBFUNCTION (*PELS*), WRITE EM, AND
  1646. * ABSOLUTE SYSTEM EM ADDRESS.
  1647.  
  1648. LDK /CPS/PELS*1000B+1S8 (A) = *PELS* + WRITE EM
  1649. STD CM+3 (CM+3) = SUBFUNCTION
  1650. .NOSV2 ENDIF
  1651. *
  1652. * * * WRITE PPU TO CM BUFFER
  1653. LOADCM TRNBF CM LOCATION OF DATA
  1654. .NOSV2 IFGE OSLEV,562D IF NOS V2
  1655. ADN 1 SKIP THE LIST
  1656. .NOSV2 ENDIF
  1657. CWM LKBUF,ECS
  1658. *
  1659. * * * WRITE FROM CM TO ECS
  1660. MONITOR ECSM READ ECS TO CM
  1661. LDD CM+1
  1662. LJM WRITECSX
  1663. * /--- BLOCK CLOCK 00 000 77/08/26 16.41
  1664. TITLE CLOCK
  1665. *
  1666. * * CLOCK
  1667. *
  1668. * UPDATES RUNNING CLOCK IN CLKU AND CLKL
  1669. * THIS ROUTINE MUST BE DONE AT LEAST ONCE EVERY
  1670. * 4 MILLISECONDS.
  1671. *
  1672. * INPUT PARAMETERS';
  1673. * (A) = NUMBER OF MILLISECONDS AT WHICH TO TIME OUT
  1674. *
  1675. * OUTPUT PARAMETERS';
  1676. * (A) - NONZERO HAVE NOT REACH TIME OUT TIME
  1677. * ZERO TIME OUT TIME HAS BEEN REACHED
  1678. *
  1679. CLOCK SUBR
  1680. STD TT SAVE INPUT PARAMETE
  1681. *
  1682. * * * READ MICROSECOND CLOCK
  1683. IAN 14B
  1684. *
  1685. * * * SAVE NEW INFO AND COMPARE TO LAST READING
  1686. STD D0
  1687. SBD CLK LAST READING
  1688. PJN CLOCK1 JUMP IF NO WRAP AROUND
  1689. *
  1690. * * * CLOCK HAS WRAPPED AROUND RECALCULATE DIFFERENCE
  1691. ADC 10000B
  1692. *
  1693. * * * UPDATE RUNNING TIME
  1694. CLOCK1 BSS 0
  1695. SHN 2 ADJUST TO GET MS IN UPPER CELL
  1696. RAM CLKL LOWER 12 BITS OF CLOCK
  1697. SHN -12
  1698. RAM CLKU UPPER 12 BITS
  1699. *
  1700. * * * REPLACE OLD CLOCK READING WITH NEW ONE
  1701. LDD D0
  1702. STD CLK
  1703. *
  1704. * * * IS IT TIME TO TIME OUT
  1705. LDM CLKU
  1706. SBD TT
  1707. MJN CLOCKX
  1708. *
  1709. * * * TIME OUT -- CLEAR THE CLOCK
  1710. LDN 0
  1711. STM CLKU
  1712. STM CLKL
  1713. UJN CLOCKX
  1714. * /--- BLOCK READCM 00 000 77/08/17 09.26
  1715. TITLE READ AND CLEAR PPU COMMUNICATIONS SWITCH
  1716. * READSW
  1717. *
  1718. * THIS ROUTINE READS THE SWITCH FROM THE
  1719. * CM COMUNICATIONS BUFFER AND SAVES THE LAST BYTE
  1720. * IN -A-.
  1721. *
  1722. READSW1 LDD CM+4
  1723.  
  1724. READSW SUBR
  1725. LOADCM COMBF PRESET TO 1ST WORD OF CM
  1726. * COMMUNICATION BUFFER.
  1727. CRD CM READ OUTPUT DATA REQUEST SWITCH
  1728. LDD CM+4
  1729. ADC -MAXCM IS READ TOO LARGE
  1730. MJN READSW1 IF READ LENGTH OK
  1731. CALL SERROR,SCML
  1732. SPACE 4
  1733. * READ
  1734. *
  1735. * THIS ROUTINE READS THE REQUEST PARAMETERS
  1736. * FROM THE PARAMETER SECTION OF THE CM
  1737. * COMMUNICATION BUFFER TO -IBF- AND THE DATA
  1738. * PORTION TO -IHDR-.
  1739. *
  1740. READ SUBR
  1741. READ1 LOADCM COMBF PRESET TO 1ST WORD OF CM
  1742. * COMMUNICATION BUFFER.
  1743. ADN PPOS ADJUST TO PARAMETER SECTION.
  1744. CRM IBF,LT READ INTO PPU
  1745. *
  1746. * * * MOVE NEW PARAMETER SECTION TO OUTPUT BUFFER.
  1747. *
  1748. LDN IHDR-IBF-1 BYTES TO MOVE.
  1749. STD D0
  1750. READ2 BSS 0
  1751. LDM IBF,D0
  1752. STM OBF,D0
  1753. SOD D0
  1754. PJP READ2 JUMP IF NOT FINISHED.
  1755. UJN READX
  1756. * /--- BLOCK WRITE 00 000 77/08/17 15.04
  1757. TITLE WRITE TO CM BUFFER.
  1758. * WRITE
  1759. *
  1760. * THIS ROUTINE WRITES DATA RECEIVED OVER
  1761. * LINK, PLUS ANY ERROR CODES OR STATUS TO A
  1762. * CM BUFFER.
  1763. * THE TOP BIT OF THE SWITCH IS SET TO 1 AND THE
  1764. * NEXT-TO-LAST BYTE IS SET TO THE NUMBER OF CM
  1765. * WORDS IN THIS RESPONSE.
  1766. *
  1767. * INPUT PARAMETER
  1768. * (DL) = NUMBER OF CM WORDS OF DATA
  1769. *
  1770. *
  1771. WRITE SUBR
  1772. WTE1 BSS 0
  1773. LDN PLTH LENGTH OF PARAMETER SECTION.
  1774. ADD DL PLUS NUMBER OF DATA WORDS.
  1775. STD D0
  1776. WRITE1 LOADCM COMBF PRESET TO 1ST WORD OF CM
  1777. * COMMUNICATION BUFFER.
  1778. ADN PPOS ADJUST TO PARAMETER SECTION.
  1779. CWM OBF,D0 WRITE TO CM.
  1780. LDN ZERL CLEAR BUFFER
  1781. CRD CM
  1782. LDC 4000B SIGN BIT SET
  1783. STD CM
  1784. LDD D0
  1785. STD CM+3 SET NO. OF RESPONSE WORDS.
  1786. WRITE2 LOADCM COMBF PRESET TO 1ST WORD ADDRESS OF
  1787. * PARAMETER BUFFER IN CM.
  1788. CWD CM WRITE SWITCH
  1789. LDN 0
  1790. STD DL CLEAR DATA WORD COUNT
  1791. *
  1792. * * * PRESS KEY ON LESSON TO INDICATE REQUEST IS DONE.
  1793. LDC LAB1K LAB1 TO BE PRESSED
  1794. STM RQKEY
  1795. CALL PREQ,PKEY
  1796. UJN WRITEX
  1797. * /--- BLOCK I/O CHAR 00 000 78/01/22 17.15
  1798. TITLE CHARACTER I/O
  1799. *
  1800. * * ICHR
  1801. *
  1802. * THIS ROUTINE INPUTS ONE BYTE OF INFORMATION
  1803. * FROM THE EVEN CHANNEL OF THE 311.
  1804. *
  1805. ICHR SUBR
  1806. RJM CCR
  1807. NJN ICHR1 IF EQUIP/CHANNEL RESERVED
  1808. CALL SERROR,SENA
  1809.  
  1810. ICHR1 BSS 0
  1811. PORT EVEN
  1812. FNC DCIC,C=CH SELECT 6681 INPUT
  1813. ACN C=CH,40B ACTIVATE THE CHANNEL
  1814. WAIT FULL,C=CH,ICHR10
  1815. IAN C=CH,40B INPUT BYTE OF DATA
  1816. DCN C=CH,40B DE-ACTIVATE THE CHANNEL
  1817. UJN ICHRX
  1818. *
  1819. ICHR10 CALL CTIMEO PROCESS CHANNEL TIME-OUT
  1820. UJN ICHRX
  1821. SPACE 4
  1822. *
  1823. * * OCHR
  1824. *
  1825. * THIS ROUTINE OUTPUTS ONE BYTE OF INFORMATION
  1826. * TO THE EVEN CHANNEL OF THE 311.
  1827. *
  1828. OCHR SUBR
  1829. STD T1 SAVE (A)
  1830. RJM CCR
  1831. NJN OCHR1 IF EQUIP/CHANNEL RESERVED
  1832. CALL SERROR,SENA
  1833.  
  1834. OCHR1 LDD T1 RESTORE (A)
  1835. PORT EVEN
  1836. FNC DCOC,C=CH SELECT 6681 OUTPUT
  1837. ACN C=CH,40B ACTIVATE THE CHANNEL
  1838. OAN C=CH,40B OUTPUT DATA
  1839. WAIT EMPTY,C=CH,OCHR10
  1840. DCN C=CH,40B DE-ACTIVATE THE CHANNEL
  1841. UJN OCHRX
  1842. *
  1843. OCHR10 CALL CTIMEO PROCESS CHANNEL TIME-OUT
  1844. UJN OCHRX
  1845. * /--- BLOCK I/O CHAR 00 000 78/01/22 18.41
  1846. EJECT
  1847. *
  1848. * * ICHR2
  1849. *
  1850. * THIS ROUTINE INPUTS ONE BYTE OF INFORMATION
  1851. * FROM THE ODD CHANNEL OF THE 311.
  1852. *
  1853. ICHR2 SUBR
  1854. RJM CCR
  1855. NJN ICHR3 IF EQUIP/CHANNEL RESERVED
  1856. CALL SERROR,SENA
  1857.  
  1858. ICHR3 BSS 0
  1859. PORT ODD
  1860. FNC DCIC,C=CH SELECT 6681 INPUT
  1861. ACN C=CH,40B ACTIVATE THE CHANNEL
  1862. WAIT FULL,C=CH,ICHR20
  1863. IAN C=CH,40B INPUT BYTE OF DATA
  1864. DCN C=CH,40B DE-ACTIVATE THE CHANNEL
  1865. STD PS SAVE STATUS
  1866. UJN ICHR21
  1867. *
  1868. ICHR20 CALL CTIMEO PROCESS CHANNEL TIME-OUT
  1869. ICHR21 UJN ICHR2X
  1870. SPACE 4
  1871. *
  1872. * * OCHR2
  1873. *
  1874. * THIS ROUTINE OUTPUTS ONE BYTE OF INFORMATION
  1875. * TO THE ODD CHANNEL OF THE 311.
  1876. *
  1877. OCHR2 SUBR
  1878. STD T1 SAVE (A)
  1879. RJM CCR
  1880. NJN OCHR3 IF EQUIP/CHANNEL RESERVED
  1881. CALL SERROR,SENA
  1882.  
  1883. OCHR3 LDD T1 RESTORE (A)
  1884. PORT ODD
  1885. FNC DCOC,C=CH SELECT 6681 OUTPUT
  1886. ACN C=CH,40B ACTIVATE THE CHANNEL
  1887. OAN C=CH,40B OUTPUT DATA
  1888. WAIT EMPTY,C=CH,OCHR20
  1889. DCN C=CH,40B DE-ACTIVATE THE CHANNEL
  1890. UJN OCHR21
  1891. *
  1892. OCHR20 CALL CTIMEO PROCESS CHANNEL TIME-OUT
  1893. OCHR21 UJN OCHR2X
  1894. SPACE 4
  1895. *
  1896. * * CTIMEO
  1897. *
  1898. * THIS ROUTINE ISSUES A DAYFILE MESSAGE FOR A
  1899. * CHANNEL TIME-OUT AND DROPS THE PPU IF THE PPU IS
  1900. * NOT ALREADY IN THE PROCESS OF DROPPING.
  1901. *
  1902. CTIMEO SUBR
  1903. CALL DFM,CTOMSG OUTPUT TIME-OUT MESSAGE
  1904. LDM DPPF CHECK IF ALREADY DROPPING PPU
  1905. NJN CTIMEOX
  1906. UJP DPP
  1907. *
  1908. CTOMSG DIS ,*(CLD) CHANNEL TIME-OUT*
  1909. *
  1910. SPACE 3
  1911. *
  1912. * * CCR
  1913. *
  1914. * THIS ROUTINE CHECKS IF THE 3266 EQUIPMENT AND
  1915. * CHANNEL HAVE BEEN RESERVED BEFORE ATTEMPTING TO
  1916. * DO ANYTHING WITH IT. ON EXIT, (A) = 0 IF EITHER
  1917. * THE EQUIPMENT OR CHANNEL IS NOT RESERVED, NON-
  1918. * ZERO OTHERWISE.
  1919. *
  1920. CCR SUBR
  1921. LDC ALSEVEN
  1922. LMM CLEQ
  1923. ZJN CCRX IF EQUIPMENT NOT RESERVED
  1924. LDC ALSEVEN
  1925. LMM CLCH
  1926. ZJN CCRX IF CHANNEL NOT RESERVED
  1927. LDN 1
  1928. UJN CCRX
  1929. * /--- BLOCK WCR 00 000 76/05/13 14.23
  1930. TITLE WAIT CHARACTER READY OR REQUEST
  1931. *
  1932. * * WCR
  1933. *
  1934. * THIS ROUTINE WAITS FOR THE SPECIFIED STATUS
  1935. * TO APPEAR OR UNTIL IT HAS CHECK THE STATUS
  1936. * THE SPECIFIED NUMBER OF TIMES.
  1937. *
  1938. * INPUT PARAMETERS
  1939. * (A) = MASK FOR REQUIRED STATUS
  1940. * (NC) = NUMBER OF STATUS CHECKS TO BE PERFORMED.
  1941. *
  1942. * OUTPUT PARAMETERS
  1943. * (A) = 0 STATUS DID NOT APPEAR.
  1944. * 1 INDICATED STATUS APPEARED
  1945. * (CHAR) = INPUT BYTE
  1946. *
  1947. WCR SUBR
  1948. *
  1949. * * * SAVE SPECIFIED MASK
  1950. STM WRM
  1951. *
  1952. * * * GET NUMBER OF TIMES TO CHECK
  1953. LDD NC
  1954. STD D0
  1955. *
  1956. * * * CHECK IF TIME TO CHECK FOR STORAGE RELOCATION
  1957. WR1 BSS 0
  1958. SOD TI
  1959. NJN WR2 JUMP IF NOT TIME TO CHECK
  1960. RJM PAUSE CHECK FOR STORAGE RELOCATION
  1961. RJM DROPCHK CHECK FOR DROP SIGNAL
  1962. *
  1963. * * * INPUT STATUS
  1964. WR2 BSS 0
  1965. RJM ICHR
  1966. STD CHAR SAVE INPUT
  1967. *
  1968. * * * CHECK FOR SPECIFIED STATUS
  1969. LPC *
  1970. WRM EQU *-1
  1971. NJN WCRX IF STATUS APPEARED
  1972. *
  1973. * * * STATUS CHECK DONE, IF SO CHECK ODD CHANNEL STATUS
  1974. SOD D0
  1975. NJN WR1 JUMP IF NOT
  1976. *
  1977. * * * IF TERMINAL MODE, DO TIME OUT CHECK
  1978. LDD MODE
  1979. ZJN WCRX IF DATA MODE
  1980. AOD TIME NUMBER OF CHECKS MADE FOR INPUT
  1981. ADC -ALSEVEN MAXIMUM CHECKS TO MAKE
  1982. ZJP LOSTC JUMP IF CONTACT LOST
  1983. LDN 0
  1984. UJN WCRX
  1985. * /--- BLOCK WCPE-PUTCH 00 000 76/05/17 11.08
  1986. TITLE ODD CHANNEL STATUS/PUT CHARACTER
  1987. *
  1988. * * WCPE
  1989. *
  1990. * THIS ROUTINE INPUTS THE ODD CHANNEL STATUS
  1991. * AND CHECKS FOR CHARACTER PHASE ESTABLISHED.
  1992. *
  1993. * OUTPUT PARAMETERS
  1994. * IF (A) = ZERO CHARACTER PHASE NOT ESTABLISHED
  1995. * = POSITIVE - ESTABLISHED SYNCHRONIZATION
  1996. *
  1997. WCPE SUBR
  1998. *
  1999. * * * INPUT STATUS
  2000. CALL ICHR2
  2001. *
  2002. * * * CHECK CARRIER BIT
  2003. LPC MCST
  2004. NJN WP1 JUMP IF CARRIER NOT ON
  2005. *
  2006. * * * CHECK FOR STATUS BIT
  2007. LDD PS
  2008. LPC MCPH
  2009. LMC MCPH
  2010. UJN WCPEX
  2011. *
  2012. * * * ERROR--CARRIER NOT ON.
  2013. WP1 BSS 0
  2014. CALL HERROR,HCNO
  2015. SPACE 1
  2016. *
  2017. * * PUTCHR
  2018. *
  2019. * WAIT FOR CHARACTER REQUEST STATUS TO APPEAR THEN
  2020. * OUTPUT THE INDICATED CHARATER.
  2021. *
  2022. * INPUT PARAMETER
  2023. * (A) = CHARACTER TO BE OUTPUT.
  2024. *
  2025. PUTCHR SUBR
  2026. *
  2027. * * * SAVE CHARACTER TO BE OUTPUT
  2028. STD OC
  2029. *
  2030. * * * WAIT FOR CHARACTER REQUEST STATUS
  2031. LDC MCRQ
  2032. RJM WCR
  2033. *
  2034. * * * OUTPUT CHARACTER
  2035. LDM PARTBLE,OC
  2036. RJM OCHR
  2037. UJN PUTCHRX
  2038. * /--- BLOCK GETCHR 00 000 78/05/11 22.15
  2039. TITLE GETCHR
  2040. *
  2041. * * GETCHR
  2042. *
  2043. * THIS ROUTINE IS CALLED AFTER INPUT HAS
  2044. * BEEN RECEIVED TO CHECK AND CLASSIFY IT.
  2045. *
  2046. * INPUT PARAMETERS
  2047. * (CHAR) = INPUT BYTE.
  2048. * OUTPUT PARAMETERS
  2049. * (A) = -1 SYNC CODE
  2050. * 0 DATA CHARATER RETURNED
  2051. * 1 CONTROL CODE RETURNED
  2052. *
  2053. GETCHR SUBR
  2054. *
  2055. * * * SAVE ONLY CHARACTER INFO IN BYTE.
  2056. LDD CHAR
  2057. LPC MCHR8 MASK OFF STATUS BITS
  2058. STD TT SAVE CHAR. PLUS PARITY BIT
  2059. LPC MCHR7 MASK OFF PARITY BIT
  2060. STD CHAR SAVE CHAR. MINUS PARITY BIT
  2061. *
  2062. * * * CHECK CHARACTER PARITY
  2063. LDM PARTBLE,CHAR CHAR. PLUS CORRECT PARITY
  2064. SBD TT WAS INPUT THE SAME
  2065. NJP GC2 JUMP IF NOT
  2066. *
  2067. * * * FOUND GOOD CHAR. - CLEAR BAD CHARACTER COUNT
  2068. LDN 0
  2069. STD BADC
  2070. *
  2071. * * * CHECK FOR SYNC CHARACTER
  2072. LDD CHAR
  2073. SBN CSYN
  2074. NJN GC1 JUMP IF NOT SYNC CODE.
  2075. LCN 1
  2076. UJN GETCHRX
  2077. *
  2078. * * * SET RETURN TO INDICATE DATA OR CONTROL CHAR.
  2079. GC1 BSS 0
  2080. LDD CHAR
  2081. SHN -6 ONLY INDICATOR BIT REMAINS
  2082. LMN 1 COMPLEMENT IT.
  2083. UJN GETCHRX
  2084. *
  2085. * * * CHARACTER PARITY ERROR
  2086. GC2 BSS 0
  2087. AOM PECNT COUNT OF TOTAL BAD CHAR.
  2088. STD NAKFLAG INDICATE MESSAGE HAS AN ERROR
  2089. AOD BADC CONSECUTIVE BAD CHAR. COUNT
  2090. SBN PEND CHECK FOR TOO MANY BAD CHAR.
  2091. MJP GETCHRX IF NOT TOO MANY
  2092. *
  2093. * * * IF WAITING FOR LINKCTL COMMAND, SEND ERROR LATER
  2094. LDM WAITF
  2095. NJP WAITL JUMP IF WAITING ON COMMAND
  2096. *
  2097. * * * ERROR--TOO MANY BAD CHARACTERS
  2098. CALL HERROR,HBCH
  2099. * /--- BLOCK PACK 00 000 76/05/17 11.08
  2100. TITLE PACK DATA
  2101. *
  2102. * * PACK
  2103. *
  2104. * THIS ROUTINE TAKES LAST CHARACTER INPUT AND
  2105. * PACKS IT INTO THE NEXT PPU WORD IN THE INPUT
  2106. * BUFFER. TWO CHARACTERS ARE PUT INTO EACH WORD
  2107. * THUS IT HAS TO BE DETEMINED WHETHER THIS
  2108. * CHARACTER IS TO BE PUT IN THE UPPER(BITS 6-11)
  2109. * LOWER(BITS 0-5) POSITION IN THE CURRENT WORD.
  2110. *
  2111. PACK SUBR
  2112. *
  2113. * * * UPDATE MESSAGE PARITY CHECK
  2114. *
  2115. LDD CHAR INPUT CHARACTER
  2116. LMD CKI MESSAGE PARITY
  2117. STD CKI
  2118. *
  2119. * * * CHECK WHERE IN BYTE THIS CHARACTER SHOULD GO
  2120. *
  2121. AOD ULP
  2122. LPN 1
  2123. ZJN PK1 JUMP IF LOWER CHARACTER
  2124. *
  2125. * * * ADVANCE PPU WORD POINTER TO NEXT WORD
  2126. *
  2127. AOD WP
  2128. *
  2129. * * * CHECK FOR BUFFER OVERFLOW
  2130. *
  2131. ADC -MAXIN MAX. NO. OF BYTES TO ASSEMBLE
  2132. MJN PK0 JUMP IF NO OVERFLOW
  2133. *
  2134. * * * ERROR--MESSAGE TOO LONG
  2135. CALL HERROR,HMLT
  2136. *
  2137. * * * PUT NEW CHARACTER INTO UPPER CHARACTER POSITION
  2138. * IN THIS PPU WORD.
  2139. *
  2140. PK0 BSS 0
  2141. LDD CHAR INPUT CHARACTER
  2142. SHN 6 POSITION CHARACTER
  2143. STM OSTART-1,WP STORE IN BUFFER
  2144. UJN PACKX GET NEXT WORD
  2145. *
  2146. * * * STORE NEW CHARACTER IN LOWER CHARACTER POSITION
  2147. * OF PPU WORD.
  2148. *
  2149. PK1 BSS 0
  2150. LDD CHAR INPUT CHARACTER
  2151. LPN 77B GET RID OF DATA BIT
  2152. RAM OSTART-1,WP STORE INTO DATA BUFFER
  2153. UJN PACKX GET NEXT CHARACTER
  2154. * /--- BLOCK UNPACK 00 000 77/08/17 14.01
  2155. TITLE UNPACK
  2156. *
  2157. * * UNPACK
  2158. *
  2159. * THIS ROUTINE EXTRACTS ONE CHARACTER AT A TIME
  2160. * FROM THE OUTPUT BUFFER(XBUFF) AND SAVES IT
  2161. * IN -OC-. 'THE CHARACTERS ARE STORED TWO TO A
  2162. * PPU WORD SO IT MUST DETERMINE WHETHER THE NEXT
  2163. * CHARACTER IS IN THE UPPER(BITS 6-11) OR LOWER
  2164. * (BITS 0-5) POSITION OF THE WORD.
  2165. *
  2166. * OUTPUT PARAMETER
  2167. * (A) = NONZERO IF CHARACTER IN -OC-
  2168. * = ZERO IF NO MORE CHARACTERS IN BUFFER.
  2169. *
  2170. UNPACK SUBR
  2171. *
  2172. * * * IS NEXT CHARACTER TO BE TAKEN FROM UPPER OR
  2173. * LOWER PORTION OF PPU WORD.
  2174. *
  2175. AOD ULU
  2176. LPN 1
  2177. ZJN UPK1 JUMP IF LOWER
  2178. *
  2179. * * * CHECK TO SEE IF ALL DATA HAS BEEN OUTPUT
  2180. *
  2181. LDD WU CURRENT POSITION IN BUFFER
  2182. SBD NW SUBTRACT LAST DATA POSITION
  2183. ZJN UNPACKX IF ALL DONE
  2184. AOD WU BUMP TO NEXT WORD
  2185. *
  2186. * * * ISOLATED NEXT CHARACTER FROM UPPER CHARACTER
  2187. * POSITION OF PPU WORD.
  2188. *
  2189. LDM ISTART-1,WU
  2190. SHN 12 POSITION CHARACTER IN LOWER
  2191. * 6 BITS OF -A-
  2192. UJN UPK2 GO MASK CHARACTER
  2193. *
  2194. * * * NEXT CHARACTER IN LOWER 6 BITS OF PPU WORD
  2195. *
  2196. UPK1 BSS 0
  2197. LDM ISTART-1,WU
  2198. *
  2199. * * * ISOLATE CHARACTER, ADD DATA BIT, AND SAVE
  2200. *
  2201. UPK2 BSS 0
  2202. LPN 77B
  2203. ADC DCON ADD DATA BIT
  2204. STD OC SAVE OUTPUT CHARACTER
  2205. UJN UNPACKX
  2206. * /--- BLOCK DATAIN 00 000 76/06/16 15.24
  2207. TITLE DATAIN
  2208. *
  2209. *
  2210. * * DATAIN
  2211. *
  2212. * THIS ROUTINE INPUTS DATA CHARACTERS SENT BY
  2213. * THE REMOTE SITE AND PACKS THEM TWO CHARACTERS
  2214. * PER BYTE INTO THE DATA BUFFER. THE DATA INPUT
  2215. * IS TERMINATED BY AN -EOD-(END OF DATA), -EOB-
  2216. * (END OF BLOCK), OR -EOF-(END OF FILE) CONTROL
  2217. * CHARACTER, WHICH IS INTURN FOLLOWED BY THE
  2218. * MESSAGE PARITY CODE.
  2219. *
  2220. DATAIN SUBR
  2221. *
  2222. * * * INITIALIZE POINTERS
  2223. LDN 0
  2224. STD ULP
  2225. STD WP
  2226. STD CKI
  2227. STD NAKFLAG
  2228. *
  2229. * * * CLEAR SYNC CODE COUNTER
  2230. DI1 BSS 0
  2231. LDN 0
  2232. STD SC
  2233. *
  2234. * * * WAIT FOR FIRST CHARATER
  2235. DI2 BSS 0
  2236. CALL WCR,MCRD
  2237. ZJP LOSTC PROBABLY LOST CONTACT
  2238. *
  2239. * * * PROCESS INPUT CHARACTER
  2240. RJM GETCHR
  2241. MJN DI3 JUMP IF SYNC CODE
  2242. NJN DI4 JUMP IF CONTROL CODE
  2243. *
  2244. * * * PUT DATA AWAY
  2245. CALL PACK
  2246. UJN DI1
  2247. *
  2248. * * * SYNC CODE INPUT, BUMP COUNTER, IF TOO MANY ARE
  2249. * RECEIVED BEFOR NEXT DATA CHARACTER HAVE MESSAGE
  2250. * RESENT.
  2251. DI3 BSS 0
  2252. AOD SC BUMP SYNC CODE COUNTER
  2253. ADC -SYEND1 CHECK FOR TOO MANY SYNC CHAR.
  2254. MJN DI2 GET NEXT CHAR. IF NOT
  2255. UJP DI6 SET NAKFLAG AND EXIT
  2256. * /--- BLOCK DATAIN 00 000 84/11/15 11.34
  2257. *
  2258. * * * CONTROL CODE RECEIVED, CHECK FOR -EOD-, -EOB-,
  2259. * OR -EOF-.
  2260. DI4 BSS 0
  2261. LDN CEOD
  2262. SBD CHAR
  2263. ZJN DI5 JUMP IF -EOD-
  2264. *
  2265. LDN CEOB
  2266. SBD CHAR
  2267. ZJN DI5 JUMP IF -EOB-
  2268. *
  2269. LDN CEOF
  2270. SBD CHAR
  2271. ZJN DI5 JUMP IF -EOF-
  2272. *
  2273. * * * BAD CHARACTER SET NAKFLAG AND GET NEXT CHARACTER
  2274. LDN 1
  2275. STD NAKFLAG
  2276. AOM BDCNT BUMP ERROR COUNT
  2277. UJP DI2
  2278. *
  2279. * * * PUT CONTROL CODE IN -LINKCTL- RESPONSE.
  2280. DI5 BSS 0
  2281. LDD CHAR
  2282. STM OHDR+REOM
  2283. *
  2284. * * * GET NUMBER OF PPU WORDS INPUT
  2285. LDD WP
  2286. STM RWDS+OHDR
  2287. *
  2288. * * * CALCULATE NUMBER OF CM WORDS IN MESSAGE
  2289. ADN 4 EXTRA WORDS IN HEADER.
  2290. CALL CMCAL
  2291. *
  2292. * * * INPUT MESSAGE PARITY CODE
  2293. CALL WCR,MCRD WAIT FOR INPUT
  2294. ZJP LOSTC JUMP IF LOST CONTACT
  2295. *
  2296. * * * PROCESS INPUT
  2297. CALL GETCHR
  2298. LDD CHAR
  2299. *
  2300. * * * COMPARE GENERATED PARITY TO ONE RECEIVED
  2301. SBD CKI
  2302. ZJN DI7
  2303. *
  2304. * * * SET NAKFLAG AND EXIT
  2305. DI6 BSS 0
  2306. LDN 1
  2307. STD NAKFLAG
  2308. AOM LPCNT BUMP ERROR COUNT
  2309. DI7 LJM DATAINX
  2310. * /--- BLOCK DATAOUT 00 000 76/06/16 14.54
  2311. TITLE DATAOUT
  2312. *
  2313. * * DATAOUT
  2314. *
  2315. * THIS ROUTINE TRANSMITS DATA TO THE REMOTE
  2316. * SITE. THE DATA IS GIVEN TO THE DRIVER BY
  2317. * -LINKCTL-. THE DATA IS THEN UNPACKED A
  2318. * CHARACTER AT A TIME AND TRANSMITTED. -LINKCTL-
  2319. * ALSO SUPPLIES THE CONTROL CODE WHICH WILL
  2320. * FOLLOW THIS MESSAGE(EOD, EOB, OR EOF). THIS
  2321. * ROUTINE ALSO GENERATES A MESSAGE PARITY WHICH
  2322. * IS TRANSMITTED FOLLOWING THE END OF MESSAGE
  2323. * CONTROL CHARACTER.
  2324. *
  2325. DATAOUT SUBR
  2326. *
  2327. * * * OUTPUT START OF MESSAGE CHARACTER
  2328. LDM IHDR+RSOM
  2329. CALL PUTCHR
  2330. *
  2331. * * * INITIALIZE POINTERS
  2332. LDN 0
  2333. STD ULU
  2334. STD WU
  2335. STD CKO
  2336. *
  2337. * * * GET NUMBER OF PPU WORDS IN DATA FIELD
  2338. LDM RWDS+IHDR
  2339. ADN 1 INCLUDE MESSAGE NUMBER
  2340. STD NW
  2341. *
  2342. * * * GET NEXT CHARACTER
  2343. DO1 BSS 0
  2344. RJM UNPACK
  2345. ZJN DO6 JUMP IF ALL DONE
  2346. *
  2347. * * * OUTPUT NEXT CHARACTER
  2348. CALL PUTCHR
  2349. *
  2350. * * * UPDATE MESSAGE PARITY
  2351. LDD OC
  2352. LMD CKO
  2353. STD CKO
  2354. UJN DO1 GET NEXT CHARACTER
  2355. *
  2356. * * * ALL DATA OUTPUT, OUTPUT END OF MESSAGE CHARACTER
  2357. DO6 BSS 0
  2358. LDM IHDR+REOM GET CHARACTER FROM -LINKCTL-
  2359. RJM PUTCHR SEND IT.
  2360. *
  2361. * * * OUTPUT MESSAGE PARITY CODE.
  2362. LDD CKO
  2363. RJM PUTCHR
  2364. UJN DATAOUTX
  2365. * /--- BLOCK MESSOUT 00 000 78/05/11 22.13
  2366. TITLE SEND MESSAGE
  2367. *
  2368. * * MESSOUT
  2369. *
  2370. * SEND MESSAGE TO REMOTE SITE AND WAIT FOR
  2371. * ACKNOWLEDGE(ACK OR NAK). IF A -NAK- IS
  2372. * RECEIVED OR AN ERROR RESEND THE MESSAGE.
  2373. *
  2374. MESSOUT SUBR
  2375. LDN 0
  2376. STD RESEND CLEAR RESEND COUNT
  2377. *
  2378. * * * SEND MESSAGE
  2379. MO1 BSS 0
  2380. CALL DATAOUT
  2381. *
  2382. * * * SET SYNC CODE COUNTER TO ZERO
  2383. LDN 0
  2384. STD SC
  2385. *
  2386. * * * WAIT FOR ACK OR NAK.
  2387. MO2 BSS 0
  2388. CALL WCR,MCRD
  2389. ZJP LOSTC JUMP IF CONTACT LOST
  2390. *
  2391. * * * PROCESS INPUT
  2392. CALL GETCHR
  2393. ZJN MO5 RESEND MESSAGE BAD CHR.
  2394. PJN MO4 JUMP IF CONTROL CHAR.
  2395. *
  2396. * * * INCREMENT SYNC CODE COUNTER
  2397. AOD SC
  2398. ADC -SYEND2
  2399. MJP MO2 WAIT FOR NEXT CHAR.
  2400. *
  2401. * * * TOO MANY SYNC CODES
  2402. AOM SCCNT BUMP ERROR COUNTS
  2403. UJP MO5
  2404. *
  2405. * * * CONTROL CHARACTER FOUND IS IT A ACK.
  2406. MO4 BSS 0
  2407. LDD CHAR
  2408. SBN CACK
  2409. ZJN MESSOUTX
  2410. AOM BCCNT BUMP ERROR COUNT
  2411. *
  2412. * * * ALLOW 5 RESENDS, THEN GIVE UP
  2413. MO5 BSS 0
  2414. AOD RESEND BUMP COUNTER
  2415. SBN RSCNT TOO MANY RESENDS ALREADY
  2416. MJP MO1 NO, RESEND THE MESSAGE
  2417. CALL HERROR,HRSD ISSUE ERROR
  2418. * /--- BLOCK MESSIN 00 000 84/11/15 11.35
  2419. TITLE RECEIVE A MESSAGE
  2420. *
  2421. * * MESSIN
  2422. *
  2423. * INPUT MESSAGE FROM REMOTE SITE, THEN SEND
  2424. * AN ACK OR NAK DEPENDING ON CONDITION OF MESSAGE
  2425. * RECEIVED.
  2426. *
  2427. * OUTPUT PARAMETERS
  2428. * (A) = ZERO IF MESSAGE NUMBER OKAY
  2429. * NONZERO OTHERWISE.
  2430. *
  2431. MESSIN SUBR
  2432. *
  2433. * * * WAIT FOR FIRST INPUT CHARACTER.
  2434. MI1 BSS 0
  2435. CALL WCR,MCRD
  2436. ZJP LOSTC JUMP IF CONTACT LOST
  2437. CALL GETCHR
  2438. MJN MI3 JUMP IF SYNC CHARACTER
  2439. ZJN MI3 JUMP IF NOT CONTROL CHAR.
  2440. *
  2441. * * * SAVE START OF MESSAGE CHARACTER.
  2442. LDD CHAR GET CHARACTER
  2443. STM OHDR+RSOM
  2444. *
  2445. * * * INPUT REST OF MESSAGE
  2446. CALL DATAIN
  2447. *
  2448. * * * WAS MESSAGE IN GOOD SHAPE
  2449. LDD NAKFLAG
  2450. ZJN MI2 JUMP IF YES
  2451. *
  2452. * * * OTHERWISE HAVE MESSAGE RESENT.
  2453. CALL PUTCHR,CNAK
  2454. UJP MI1
  2455. *
  2456. * * * INDICATE TO REMOTE SITE THAT MESSAGE IS OKAY
  2457. MI2 BSS 0
  2458. CALL PUTCHR,CACK SEND POSITIVE ACKNOWLEDGE
  2459. UJN MESSINX
  2460. *
  2461. * * * JUST RECEIVED SYNC CHAR.-ARE WE IN STARTUP
  2462. MI3 BSS 0
  2463. LDD FUNC
  2464. SBN FASU
  2465. NJP MI1 JUMP IF NOT
  2466. *
  2467. * * * IF STARTUP ONLY WAIT CERTAIN NUMBER OF CHAR. TIMES
  2468. AOD SC INCREMENT COUNTER
  2469. ADC -SYEND MAX. NUMBER ALLOWED.
  2470. MJP MI1 JUMP IF TIME NOT UP
  2471. *
  2472. * * * OTHERWISE SEND MESSAGE BACK TO LINKCTL
  2473. CALL SERROR,SRDR
  2474. * /--- BLOCK SELDC 00 000 78/01/22 20.30
  2475. TITLE SELECT 6681 DATA CONVERTER
  2476. *
  2477. * * SELDC
  2478. *
  2479. * THIS ROUTINE TAKES THE FOLLOWING STEPS IN SETTING
  2480. * UP THE 6681 AND 3266 FOR USE.
  2481. * 1.DEACTIVATE THE CHANNEL
  2482. * 2.SELECT CONVERTER
  2483. * 3.CHECK 3266 PORTS
  2484. * 4.SELECT RESYNC AND SEND FUNCTION TO 311.
  2485. *
  2486. * OUTPUT PARAMETERS
  2487. * IF (A) IS NEGATIVE, ERROR OCCURED.
  2488. * POSITVE, EVERYTHING IS OKAY.
  2489. *
  2490. SELDC SUBR
  2491. RJM CCR
  2492. NJN SELDC1 IF EQUIP/CHANNEL RESERVED
  2493. CALL SERROR,SENA
  2494.  
  2495. SELDC1 BSS 0
  2496. *
  2497. * * * DEACTIVATE THE CHANNEL IF NECESSARY
  2498. IJM SELDC2,C=CH JUMP IF CHANNEL INACTIVE
  2499. DCN C=CH,40B DE-ACTIVATE THE CHANNEL
  2500. RJM TIMOUT
  2501. NJN SELDC2 JUMP IF CHANNEL DEACTIVATED.
  2502. *
  2503. * * * ERROR--CHANNEL DID NOT DROP
  2504. CALL LREL RELEASE EQUIPMENT RESERVATIONS
  2505. CALL HERROR,HDCN
  2506. *
  2507. * * * SELECT CONVERTER
  2508. SELDC2 BSS 0
  2509. FNC DCSC,C=CH FUNCTION SELECT CONVERTER
  2510. RJM TIMOUT WAIT FOR CHANNEL TO DEACTIVATE.
  2511. NJN SELDC4 JUMP IF CHANNEL DEACTIVATED
  2512. *
  2513. * * * ERROR--SELECT CONVERTER FUNCTION NOT ACCEPTED
  2514. CALL LREL RELEASE EQUIPMENT RESERVATIONS
  2515. CALL HERROR,HFSC
  2516. *
  2517. * * * SET UP 311 SO IT IS READY TO SEND AND RECEIVE.
  2518. SELDC4 BSS 0
  2519. PORT ODD CONNECT TO ODD CHANNEL
  2520. RJM ST6681 CHECK FOR FUNCTION REJECT
  2521. MJN SELDC5 IF ERROR
  2522. *
  2523. * * * CONNECT TO EVEN CHANNEL
  2524. PORT EVEN CONNECT OT EVEN CHANNEL.
  2525. RJM ST6681 CHECK FOR 6681 REJECT
  2526. SELDC5 LJM SELDCX IGNORE ERRORS
  2527. EJECT
  2528. *
  2529. * * TIMOUT
  2530. *
  2531. * ROUTINE TO MAKE SURE CHANNEL DEACTIVATES
  2532. * WITHIN PROPER TIME LIMIT.
  2533. *
  2534. TIMOUT SUBR
  2535. LDC TOUT TIME OUT COUNTER
  2536. TMO1 BSS 0
  2537. IJM TIMOUTX,C=CH IF ALL QUIET
  2538. SBN 1
  2539. NJN TMO1 JUMP IF COUNTER NOT EXPIRED
  2540. UJN TIMOUTX
  2541. * /--- BLOCK 6681 00 000 78/01/22 20.30
  2542. SPACE 6
  2543. *
  2544. * * ST6681
  2545. *
  2546. * CHECK 6681 STATUS FOR FUNCTION REJECT.
  2547. *
  2548. * OUTPUT PARAMETERS
  2549. * IF (A) IS NEGATIVE FUNCTION WAS REJECTED.
  2550. * POSITIVE EVERTHING IS OKAY.
  2551. *
  2552. ST6681 SUBR
  2553. FNC DCCS,C=CH STATUS FUNCTION
  2554. ACN C=CH,40B ACTIVATE THE CHANNEL
  2555. IAN C=CH,40B INPUT STATUS
  2556. DCN C=CH,40B
  2557. STD PS SAVE STATUS
  2558. LPN 7 MASK REJECT BITS
  2559. ZJN ST6681X
  2560. *
  2561. * * * ERROR--6681 REJECT CONNECT FUNCTION
  2562. *
  2563. CALL LREL RELEASE EQUIPMENT RESERVATIONS
  2564. CALL HERROR,HREJ
  2565. * /--- BLOCK SEST 00 000 77/08/17 15.01
  2566. TITLE SYNCHRONIZATION ESTABLISH
  2567. *
  2568. * * * SEST
  2569. *
  2570. * ESTABLISH SYNCHRONIZATION WITH REMOTE SITE.
  2571. * ON ENTRY (A) = NUMBER OF TIMES TO TRY
  2572. *
  2573. SEST SUBR
  2574. *
  2575. * * * SET LOOP COUNTER
  2576. STD TT
  2577. *
  2578. * * * CLEAR SYNC CODE INDICATOR
  2579. LDN 0
  2580. STM SFLAG
  2581. *
  2582. * * * SELECT RESYNCH. FUNCTION
  2583. SE0 BSS 0
  2584. CALL OCHR2,BRSY+BSND
  2585. *
  2586. * * * SET NUMBER SYNCH CODES TO SEND
  2587. LDN 4
  2588. STD SC
  2589. *
  2590. * * * WAIT FOR CHARACTER REQUEST STATUS
  2591. SE1 BSS 0
  2592. RJM PAUSE
  2593. CALL WCR,MCRQ WAIT FOR CHAR. REQUEST
  2594. ZJN SE3 JUMP IF NEVER FOUND CHAR. REQ.
  2595. *
  2596. * * * OUTPUT SYNC CODE
  2597. CALL OCHR,CSYN OUTPUT SYNC CODE.
  2598. *
  2599. * * * CHECK FOR SYNCHRONIZATION ESTABLISHED
  2600. CALL WCPE
  2601. STM SFLAG SET SYNC. ACHIEVED FLAG
  2602. NJN SESTX IF ESTABLISHED
  2603. *
  2604. * * * HAVE ALL SYNCH CODES BEEN OUTPUT
  2605. SOD SC
  2606. NJP SE1 JUMP IF NOT
  2607. *
  2608. * * * DECREMENT COUNTER AND QUIT IF ZERO
  2609. SOD TT
  2610. NJN SE0
  2611. *
  2612. * * * ERROR - SYNCHRONIZATION NEVER ESTABLISHED
  2613. CALL HERROR,HECP
  2614. *
  2615. * * * ERROR--INITIAL CHARACTER REQUEST DID NOT APPEAR
  2616. SE3 BSS 0
  2617. LDD CHAR SAVE STATUS FOR RESPONSE
  2618. STD PS
  2619. CALL HERROR,HCRQ
  2620. * /--- BLOCK CMCAL 00 000 77/08/29 15.27
  2621. TITLE DIVIDE BY 5
  2622. *
  2623. * * CMCAL
  2624. *
  2625. * DIVIDE NUMBER IN -A- BY FIVE AND PUT RESULT IN
  2626. * -DL-. THE METHOD USED IS TO MULTIPLY THE
  2627. * NUMBER BY 205, THEN DIVIDE BY 1024. THIS WORKS
  2628. * FOR NUMBERS UPTO 1200.
  2629. *
  2630. CMCAL SUBR
  2631. *
  2632. * * * MULTIPLY BY 205. (N=NUMBER, *=MULTIPLY)
  2633. *
  2634. STD T1 SAVE N
  2635. SHN 1 N*2
  2636. ADD T1 (N*2)+N = (N*3)
  2637. STD T2 SAVE (N*3)
  2638. SHN 4 (N*3)*16
  2639. ADD T2 (N*3)*16 + (N*3) = (N*51)
  2640. SHN 2 (N*51)*4 = (N*204)
  2641. ADD T1 (N*204)+N = (N*205)
  2642. *
  2643. * * * DIVIDE BY 1024
  2644. *
  2645. SHN -10 (N*205)/1024
  2646. STD DL THE RESULT
  2647. UJN CMCALX
  2648. TITLE INCREMENT 5 BYTE COUNTER
  2649. *
  2650. * * AFIVE
  2651. *
  2652. * INCREMENT BY ONE A 5 BYTE COUNTER DESIGNATED
  2653. * BY THE ADDRESS IN A. ALSO MOVE THE COUNTER
  2654. * TO LKBUF SO THAT IT CAN BE WRITTEN TO ECS.
  2655. *
  2656. * INPUT PARAMETERS';
  2657. * (A) = ADDRESS OF BYTE ZERO OF COUNTER
  2658. *
  2659. *
  2660. AFIVE SUBR
  2661. STD TT SAVE ADDRESS
  2662. LDN 4
  2663. STD T1 INITIALIZE THE LOOP COUNTER
  2664. *
  2665. * * * INCREMENT COUNTER STARTING WITH BYTE 4
  2666. AF1 BSS 0
  2667. AOM 4,TT INCREMENT THIS BYTE BY ONE
  2668. STM LKBUF,T1 SAVE NEW VALUE FOR ECS TRANSFER
  2669. SHN -12 CHECK FOR OVERFLOW
  2670. ZJP AF2 JUMP IF NO OVERFLOW
  2671. SOD TT SET TO NEXT BYTE
  2672. SOD T1 DECREMENT BYTE COUNTER
  2673. UJN AF1
  2674. *
  2675. * * * MOVE REST OF COUNTER TO LKBUF
  2676. AF2 BSS 0
  2677. SOD TT
  2678. SOD T1
  2679. MJN AFIVEX IF ALL DONE
  2680. LDM 4,TT
  2681. STM LKBUF,T1
  2682. UJN AF2
  2683. * /--- BLOCK PARGEN 00 000 77/02/15 14.05
  2684. TITLE PARITY GENERATION
  2685. *
  2686. * * PARGEN
  2687. *
  2688. * 'THIS ROUTINE GENERATES A TABLE CONTAINING
  2689. * ALL POSSIBLE 7 BIT COMBINATIONS THAT CAN
  2690. * BE SENT AS DATA OR CONTROL CHARACTERS OVER
  2691. * THE LINK PLUS THE APPROPRIATE PARITY BIT(ODD).
  2692. * 'THUS WHEN SENDING A CHARACTER, THE CHARACTER
  2693. * CAN BE USED AS AN INDEX INTO THIS TABLE TO GET
  2694. * THE CHARACTER PLUS PARITY TO TRANSMIT.
  2695. *
  2696. PARGEN SUBR
  2697. LDC 127 128 POSSIBLE 7 BIT CHARATERS.
  2698. STD T1
  2699. *
  2700. * * * MAIN LOOP DONE ONCE FOR EACH 7 BIT CHARATER.
  2701. *
  2702. PG1 BSS 0
  2703. LDN 0 INITIALIZE BIT COUNTER
  2704. STD T2
  2705. LDD T1 SAVE WORKING COPY OF CURRENT
  2706. STD T3 CHARACTER.
  2707. LDN 6 SEVEN BITS/CHARACTER
  2708. STD T4
  2709. *
  2710. * * * INTER LOOP - COUNTS NUMBER OF BITS IN CHARACTER
  2711. *
  2712. PG2 BSS 0
  2713. LDD T3 GET SHIFTED 7 BIT CHARACTER
  2714. SHN 1 POSITION NEXT BIT
  2715. STD T3 SAVE FOR NEXT LOOP
  2716. SHN 10 MOVE BIT TO TOP
  2717. PJN PG3 JUMP IF BIT NOT SET
  2718. AOD T2 BIT SET INCREMENT BIT COUNTER
  2719. PG3 BSS 0
  2720. SOD T4 DECREMENT NUMBER OF BITS TESTED
  2721. PJN PG2 JUMP IF MORE BITS
  2722. *
  2723. * * * GENERATE CHARACTER WITH PARITY BIT
  2724. *
  2725. LDD T2 LOAD BIT COUNT
  2726. LPN 1 ISOLATE PARITY BIT
  2727. LMN 1 TOGGLE BIT
  2728. SHN 7 POSITION PARITY BIT
  2729. ADD T1 ADD IN 7 BIT CHARACTER
  2730. STM PARTBLE,T1 STORE IN TABLE
  2731. *
  2732. * * * END OF MAIN LOOP - JUMP IF MORE TO DO.
  2733. *
  2734. SOD T1 DECREMENT CHARACTER COUNTER.
  2735. PJP PG1 JUMP IF NOT DONE
  2736. UJN PARGENX
  2737. * /--- BLOCK PAUSE 00 000 84/11/15 11.35
  2738. TITLE PAUSE--CHECK FOR STORAGE MOVE OR ERROR CONDITIONS
  2739. * PAUSE
  2740. *
  2741. * THIS ROUTINE CHECKS TO SEE IF THE STORAGE
  2742. * MOVE OR ERROR FLAGS AT THE CONTROL POINT ARE
  2743. * SET. IF NECESSARY, IT PAUSES AND THEN RESETS
  2744. * THE REFERENCE ADDRESSES. IF THE CONTROL POINT
  2745. * ERROR FLAG IS SET OR THERE IS NO CPU ACTIVITY
  2746. * AT THE CONTROL POINT, THE PPU IS DROPPED.
  2747. *
  2748. PAUSE SUBR
  2749. *
  2750. * * * RESET PAUSE COUNTER
  2751. LDC TOUT2
  2752. STD TI
  2753. *
  2754. * * * READ CONTROL POINT STATUS
  2755. LDD CP
  2756. ADN STSW
  2757. CRD CM
  2758. LDD CM+C.CPEF ERROR FLAG
  2759. NJP DPP2 EXIT IF CONTROL POINT ERROR.
  2760. LDD CM+C.CPSTAT
  2761. SHN -11B
  2762. ZJP DPP2 IF NO CPU ACTIVITY
  2763. *
  2764. * * * CHECK FOR PAUSE CONDITION
  2765. LDN CMCL
  2766. CRD CM
  2767. LDD CM
  2768. SBD CP
  2769. NJN PAUSEX IF NO PAUSE REQUIRED
  2770. PAUSE ST
  2771. *
  2772. * * * READ CONTROL POINT STATUS WORD
  2773. LDD CP
  2774. ADN STSW
  2775. CRD CM
  2776. LDD CM+C.CPEF
  2777. NJP DPP2 EXIT IF CONTROL POINT ERROR
  2778. *
  2779. * * * NEW PPU STATUS WORD ADDRESS
  2780. LDM PU
  2781. SHN 6
  2782. ADD RA
  2783. SHN 6
  2784. ADM PL
  2785. PLANT CM,PPST
  2786. *
  2787. * * * NEW COMMUNICATION BUFFER ADDRESS.
  2788. LOADCM PPST
  2789. ADN 2
  2790. PLANT CM,COMBF
  2791. *
  2792. * * * ECS TRANSFER BUFFER ADDRESS
  2793. LOADCM PPST
  2794. ADN 22
  2795. PLANT CM,TRNBF
  2796. LJM PAUSEX
  2797. SPACE 2
  2798. *
  2799. * * FRMCHK
  2800. *
  2801. * CHECK FOR FRAMAT RE-INITIALIZING. 'THIS HAPPENS
  2802. * WHEN FRAMAT IS DROPPED AND RELOADED FOLLOWING
  2803. * AN ECS ERROR.
  2804. *
  2805. FRMCHK SUBR
  2806. *
  2807. * * * RESET TIME OUT COUNTER
  2808. LDN 50
  2809. STD FRCHK
  2810. *
  2811. * * * READ FRAMAT STATUS WORD
  2812. FRMCHK1 BSS 0
  2813. LDN 0
  2814. STD ECSOFF
  2815. LDN 1
  2816. STD ECS
  2817. CALL READECS,FORINIP
  2818. *
  2819. * * * CHECK TO SEE IF FRAMAT RE-INITIALIZING
  2820. LDM LKBUF
  2821. SHN 6
  2822. PJN FRMCHKX
  2823. *
  2824. * * * WAIT UNTIL FRAMAT DONE INITIALIZING
  2825. CALL PAUSE
  2826. DELAY 5000
  2827. UJP FRMCHK1
  2828. * /--- BLOCK ERROR 00 000 84/11/15 11.35
  2829. TITLE SOFTWARE AND HARDWARE ERROR ROUTINES
  2830. *
  2831. * * SERROR
  2832. *
  2833. * THIS ROUTINE PROCESSES SOFTWARE ERRORS AS FOLLOWS';
  2834. * 1. PUT ERROR CODE INTO RESPONSE BUFFER.
  2835. * 2. WRITE RESPONSE TO CM
  2836. *
  2837. * * INPUT PARAMETERS
  2838. * -A- MUST CONTAIN THE APPROPRIATE ERROR CODE.
  2839. *
  2840. SERROR SUBR
  2841. STM OBF+RERR
  2842. RJM WRITE
  2843. UJP MAIN GO BACK TO MAIN LOOP
  2844. SPACE 4
  2845. *
  2846. * * HERROR
  2847. *
  2848. * THIS ROUTINE PROCESSES HARDWARE ERRORS AS FOLLOWS';
  2849. * 1.PUT ERROR CODE INTO RESPONSE BUFFER.
  2850. * 2.PUT HARDWARE STATUS INTO RESPONSE BUFFER.
  2851. * 3.WRITE RESPONSE BACK TO CM.
  2852. *
  2853. * *INPUT PARAMETERS
  2854. * -A- MUST CONTAIN ERROR CODE.
  2855. * -PS- MUST CONTAIN APPROPRIATE STATUS
  2856. *
  2857. HERROR SUBR
  2858. STM OBF+RERR PUT ERROR CODE IN RESPONSE
  2859. LDD PS GET HARDWARE STATUS
  2860. STM OBF+RSTA PUT STATUS INTO RESPONSE
  2861. RJM WRITE WRITE RESPONSE TO CM.
  2862. LDD MODE CHECK FOR TERMINAL MODE
  2863. ZJP MAIN JUMP IF DATA MODE
  2864. LDC LABK KEY TO BE PRESSED
  2865. STM RQKEY
  2866. CALL PREQ,PKEY SEND A KEY TO WAKE UP LINKCTL
  2867. LJM MAIN
  2868. SPACE 2
  2869. *
  2870. * *LOSTC
  2871. * LOST CONTACT WITH REMOTE SITE EXIT
  2872. *
  2873. LOSTC BSS 0
  2874. CALL HERROR,HLCR
  2875. * /--- BLOCK DPP 00 000 78/05/11 22.05
  2876. TITLE EXIT ROUTINES
  2877. DPP BSS 0
  2878. CALL TMEND
  2879. CALL PREQ,PKILL SEND KILL REQUEST TO PLATO.
  2880. DPP2 BSS 0
  2881. LDN 1 MARK DROPPING PPU
  2882. STM DPPF
  2883. CALL STDPP IF EQUIPMENT UP SEND STOP CODE.
  2884. CALL LREL RELEASE COMMUNICATION LINK
  2885. MONITOR DPPM
  2886. LJM PPR EXIT TO IDLE LOOP.
  2887. SPACE 2
  2888. *
  2889. * *DROPCHK
  2890. *
  2891. * CHECK FOR PLATO LESSON DROP SIGNAL
  2892. *
  2893. DROPCHK SUBR
  2894. LOADCM PPST PPU STATUS WORD.
  2895. CRD CM
  2896. LDD CM+4
  2897. ZJP DPP JUMP IF BIT CLEARED
  2898. UJN DROPCHKX
  2899. TITLE SEND END LINK
  2900. *
  2901. * * STDPP
  2902. *
  2903. * 'THIS ROUTINE SELECTS -STOP SEND- ON 3266.
  2904. *
  2905. STDPP SUBR
  2906. *
  2907. * * * EXIT IF EQUIPMENT OR CHANNEL IS NOT RESERVED.
  2908. *
  2909. RJM CCR
  2910. ZJN STDPPX
  2911. *
  2912. * * * SEND 100 BAD CHARACTERS TO OTHER SYSTEM
  2913. LDC 100
  2914. STD RESEND SET CHARACTER COUNT
  2915. *
  2916. * * * WAIT FOR CHARACTER REQUEST
  2917. STD1 BSS 0
  2918. LDC 7777B
  2919. STD D0 NO. OF TIMES TO LOOK FOR STATUS
  2920. *
  2921. * * * CHECK FOR CHARACTER REQUEST STATUS
  2922. STD2 BSS 0
  2923. CALL ICHR INPUT STATUS
  2924. LPC MCRQ CHAR. REQUEST MASK
  2925. NJP STD3 JUMP IF STATUS APPEARED
  2926. *
  2927. * * * DECREMENT STATUS CHECK COUNTER
  2928. SOD D0
  2929. ZJP STD4 JUMP IF NO CHAR. REQUEST
  2930. UJP STD2 LOOP AND CHECK AGAIN
  2931. *
  2932. * * * SEND CHARACTER
  2933. STD3 BSS 0
  2934. LDN 3
  2935. CALL OCHR OUTPUT CHAR.
  2936. *
  2937. * * * HAVE 100 CHAR. BEEN OUTPUT
  2938. SOD RESEND DECREMENT COUNTER
  2939. PJP STD1 LOOP IF NOT
  2940. *
  2941. * * * SET UP CONTROLLER FOR NEXT TRY
  2942. STD4 BSS 0
  2943. CALL OCHR2,BSTP+BRSY
  2944. LJM STDPPX
  2945. * /--- BLOCK T DPP 00 000 77/09/06 00.40
  2946. TITLE TERMINAL MODE TERMINATION
  2947. *
  2948. * * TMEND
  2949. *
  2950. * THIS ROUTINE DOES THE EXTRA PROCESSING NEEDED
  2951. * WHEN LEAVING TERMINAL MODE PROCESSING ROUTINES.
  2952. *
  2953. TMEND SUBR
  2954. LDD MODE
  2955. ZJN TMENDX IF NOT IN TERMINAL MODE
  2956. *
  2957. * * * PRESS KEY ON CALLING STATION
  2958. *
  2959. LDC LABK PRESS A LAB KEY
  2960. STM RQKEY
  2961. CALL PREQ,PKEY
  2962. *
  2963. * * * CLEAR FRAMER STATUS WORD
  2964. CALL LCLEAR,5 CLEAR 5 BYTES OF LKBUF
  2965. LDN 1
  2966. STD ECS WRITE ONE WORD OF ECS
  2967. LDM FRAMID OFFSET TO CORRECT WORD
  2968. STD ECSOFF
  2969. CALL WRITECS,PIOSTS
  2970. UJN TMENDX
  2971.  
  2972.  
  2973. *
  2974. * * LCLEAR
  2975. *
  2976. * CLEAR INDICATED NUMBER OF BYTS IN -LKBUF-
  2977. *
  2978. * INPUT PARAMETER
  2979. * (A) = NUMBER OF BYTES TO CLEAR
  2980. *
  2981. LCLEAR SUBR
  2982. SBN 1
  2983. STD T1
  2984. LCL BSS 0
  2985. LDN 0
  2986. STM LKBUF,T1
  2987. SOD T1
  2988. PJN LCL JUMP IF MORE TO CLEAR
  2989. UJN LCLEARX
  2990. * /--- BLOCK PREQ 00 000 78/05/11 21.52
  2991. TITLE SEND PLATO REQUEST
  2992. *
  2993. * * PREQ
  2994. *
  2995. * SEND REQUEST TO PLATO
  2996. * (A) CONTAINS REQUEST CODE ON ENTRY.
  2997. * (RQKEY) CONTAINS KEY VALUE FOR REQUEST.
  2998. *
  2999. PREQ SUBR
  3000. STD TT SAVE REQUEST CODE
  3001. *
  3002. * * * CHECK FOR PENDING REQUEST
  3003. PREQ1 BSS 0
  3004. LOADCM PPST ADDRESS OF CM BUFFER
  3005. ADN 1 BUMP TO REQUEST SLOT
  3006. CRD T1 MAKE SURE NO REQUEST PENDING
  3007. LDD T1
  3008. NJN PREQ2 JUMP IF PENDING REQUEST
  3009. *
  3010. * * * SET UP NEW REQUEST
  3011. LDD TT GET REQUEST CODE
  3012. STD CM+4 PUT REQUEST CODE INTO BUFFER
  3013. LDM RQKEY GET KEY TO PUT INTO REQUEST
  3014. STD CM+3
  3015. LDD STATION PUT STATION NUMBER IN REQUEST
  3016. STD CM+2
  3017. LDN 0
  3018. STD CM+1
  3019. LDC 4000B SET REQUEST BIT
  3020. STD CM
  3021. *
  3022. * * * GIVE NEW REQUEST TO PLATO
  3023. LOADCM PPST NOTHING PENDING WRITE NEW REQ.
  3024. ADN 1
  3025. CWD CM
  3026. UJN PREQX
  3027. *
  3028. * * * WAIT FOR PENDING REQUEST TO BE PROCESSED
  3029. PREQ2 BSS 0
  3030. DELAY 4000
  3031. CALL PAUSE
  3032. UJP PREQ1
  3033. *
  3034. * /--- BLOCK LOOPCHK 00 000 84/11/15 11.35
  3035. TITLE PROCESS 3266 INPUT
  3036. *
  3037. * * LOOPCHK
  3038. *
  3039. * PROCESS 3266 INPUT WHILE WAITING ON LINKCTL
  3040. * TO SEND NEXT COMMAND.
  3041. *
  3042. LOOPCHK SUBR
  3043. *
  3044. * * * EXIT IF EQUIPMENT/CHANNEL NOT RESERVED
  3045. RJM CCR
  3046. ZJN LOOPCHKX
  3047. *
  3048. * * * SET SPECIAL WAIT-ON-LINKCTL FLAG
  3049. LDN 1
  3050. STM WAITF
  3051. *
  3052. * * * WAIT FOR INPUT CHARACTER
  3053. CALL WCR,MCRD
  3054. ZJP WAITL JUMP IF NO CHARACTER APPEARED
  3055. *
  3056. * * * PROCESS NEW CHARACTER
  3057. CALL GETCHR
  3058. *
  3059. * * * CLEAR SPECIAL FLAG
  3060. LDN 0
  3061. STM WAITF
  3062. UJN LOOPCHKX
  3063.  
  3064. TITLE WAIT ON LINKCTL
  3065. *
  3066. * * WAITL
  3067. *
  3068. * THIS ROUTINE IS CALLED IF THE LINK IS DROPPED
  3069. * WHILE CLD IS WAITING FOR A LINKCTL COMMAND.
  3070. * WHEN THE NEXT COMMAND ARRIVES LINKCTL IS
  3071. * INFORMED OF THE ERROR.
  3072. *
  3073. WAITL BSS 0
  3074. *
  3075. * * * CHECK FOR PAUSE CONDITION
  3076. CALL PAUSE
  3077. *
  3078. * * * CHECK FOR DROP SIGNAL FROM LINKCTL
  3079. CALL DROPCHK
  3080. *
  3081. * * * CHECK FOR LINKCTL COMMAND
  3082. CALL READSW
  3083. ZJN WAITL NO NEW COMMAND, LOOP
  3084. *
  3085. * * * NEW COMMAND ARRIVED, SEND ERROR TO LINKCTL
  3086. CALL HERROR,HBCH
  3087. * /--- BLOCK EQUATES 00 000 78/05/11 22.16
  3088. TITLE EQUATES
  3089. ************************************************************************
  3090. *
  3091. LAB1K EQU 213B LAB1 KEY CODE
  3092. *
  3093. LABK EQU 212B LAB KEY CODE
  3094. *
  3095. LKMASK EQU 177B LINKIO BUFFER LENGHT MASK
  3096. *
  3097. TMASK EQU 777B TERMINAL MODE MODULO MASK
  3098. *
  3099. CHPK EQU 2 CHARACTERS PER KEY
  3100. *
  3101. CHPF EQU 4 CHARACTERS PER FRAME
  3102. *
  3103. ALSEVEN EQU 7777B CONSTANT
  3104. *
  3105. TOUT EQU 777B TIME OUT LOOP COUNTER
  3106. *
  3107. TOUT2 EQU 100B
  3108. *
  3109. MCHR8 EQU 377B 8 BIT CHARACTER MASK
  3110. *
  3111. MCHR7 EQU 177B CHARACTER MASK FOR DATA INPUT
  3112. *
  3113. DCON EQU 100B BIT ADD TO INDICATE DATA
  3114. * CHARACTER.
  3115. RSCNT EQU 30 NUMBER OF TIMES TO RESEND
  3116. * A MESSAGE BEFORE GIVING UP.
  3117. PEND EQU 30 NUMBER OF CONSECUTIVE BAD
  3118. * CHAR. BEFORE GIVING UP.
  3119. SYEND EQU 2000 NUMBER OF SYNC. CHAR TO WAIT
  3120. * WHEN CHECKING FOR REMOTE REQ.
  3121. SYEND1 EQU 10 NUMBER CONSECUTIVE SYNC CHAR
  3122. * ALLOWED DURING A MESSAGE.
  3123. SYEND2 EQU 500 NUMBER OF SYNC. CHAR. TO WAIT
  3124. * WHEN LOOKING FOR ACK/NAK.
  3125. MAXCM EQU 60 MAXIMUM SIZE OF LINKCTL REQUEST
  3126. *
  3127. XFORINIP EQU 2 ECS ADDRESS OF FORMATTER-
  3128. * FRAMER STATUS WORD
  3129. ************************************************************************
  3130. * /--- BLOCK DEFINES 00 000 78/05/11 21.58
  3131. TITLE STORAGE DEFINITIONS
  3132. ************************************************************************
  3133. *
  3134. *
  3135. CLEQ DATA 7777B EST ORDINAL OF -CL- AFTER
  3136. * EQUIPMENT RESERVED OTHERWISE
  3137. * SET TO ALL SEVENS.
  3138. CLCH DATA 7777B SET TO ALL SEVENS UNTIL
  3139. * COMMUNICATION CHANNEL IS
  3140. * RESERVED, THEN SET TO CHANNEL.
  3141. SFLAG BSSZ 1 0 IF SYNC. NOT ACHIEVED,
  3142. * NONZERO OTHERWISE
  3143. WAITF BSSZ 1 1 = PROCESSING INPUT WHILE
  3144. * WAITING FOR LINKCTL COMMAND.
  3145. * 0 ALL OTHER TIMES.
  3146. RQKEY BSSZ 1 KEY IN PRESS REQUEST TO PLATO
  3147. *
  3148. PECNT BSSZ 1 NUMBER OF CHARACTER PARITY
  3149. * ERRORS.
  3150. BDCNT BSSZ 1 NUMBER OF BAD CHARACTERS.
  3151. *
  3152. LPCNT BSSZ 1 NUMBER OF BAD LONGITUDINAL
  3153. * PARITY CHARACTERS.
  3154. SCCNT BSSZ 1 NO. OF MESSAGES RESENT BECAUSE
  3155. * NO RESPONSE WAS RECEIVED.
  3156. BCCNT BSSZ 1 NO. OF MESSAGES RESENT BECAUSE
  3157. * RESPONSE WAS NOT AN -ACK-.
  3158. LKBUF BSSZ 40 ECS READ/WRITE BUFFER
  3159. *
  3160. IFRAMEX BSSZ 1 TEMPORARY SAVE AREA FOR FRAME
  3161. * INDEX.
  3162. IFRAME BSSZ 5 CLD FRAME POINTER MATCHES
  3163. * ECS RESIDENT LFRPNT.
  3164. PFRAME BSSZ 5 CLD LINKIO POINTER MATCHES
  3165. * ECS RESIDENT LKIN
  3166. FRBUFF BSSZ 2 TERMINAL MODE FRAME BUFFER.
  3167. *
  3168. KYBUFF DATA 7777B TERMINAL MODE KEY BUFFER.
  3169. *
  3170. LFRLTH BSSZ 1 NO. OF TERMINAL WORDS IN
  3171. * EACH FRAME.
  3172. FRAMID BSSZ 1 LINK FRAME ID
  3173. *
  3174. DPPF BSSZ 1 NON-ZERO IF DROP PPU IN PROCESS
  3175. *
  3176. CLKU BSSZ 2 RUNNING CLOCK
  3177. CLKL EQU CLKU+1
  3178. *
  3179. PU BSSZ 2 CM ADDRESS OF PARAMETER AREA
  3180. PL EQU PU+1
  3181. *
  3182. * /--- BLOCK DEFINES 00 000 78/01/04 21.30
  3183. ECU BSSZ 2 ECS RA
  3184. ECL EQU ECU+1
  3185. *
  3186. ECSAD BSS 0 ECS ADDRESS TABLE
  3187. PKEYECS BSSZ 2 KEY BUFFER
  3188. *
  3189. PECSIN BSSZ 2 KEYS-IN BIT TABLE
  3190. *
  3191. LINKIO BSSZ 2 TERMINAL WORD BUFFER FOR
  3192. * PASSING INFO TO THE FRAMER.
  3193. LKIN BSSZ 2 POINTER TO NEXT LOCATION IN
  3194. * TERMINAL WORD BUFFER.
  3195. LFRBUF BSSZ 2 FRAME BUFFERS
  3196. *
  3197. LFRPNT BSSZ 2 POINTER TO NEXT LOCATION IN
  3198. * FRAME BUFFERS.
  3199. LFRLTHS BSSZ 2 NO. OF TERMINAL WORDS IN EACH
  3200. * FRAME.
  3201. PIOSTS BSSZ 2 FRAMER STATUS WORD - INDICATES
  3202. * CLD IS READING FRAMES
  3203. ECSLTH EQU *-ECSAD LENGTH OF ECS ADDRESS TABLE
  3204. *
  3205. FORINIP BSSZ 2 FORMATTER-FRAMER STATUS WORD
  3206. * ECS ADDRESS
  3207. * /--- BLOCK IBF 00 000 77/10/03 14.21
  3208. TITLE COMMUNICATION BUFFERS
  3209. ************************************************************************
  3210. *
  3211. * THIS BUFFER IS USED TO HOLD REQUESTS AND DATA
  3212. * FROM LINKCTL. 'THE SWITCH WORD IS CONTIGUOUS
  3213. * WITH THE REST OF THE BUFFER IN THE CM BUFFER
  3214. * BUT IS READ SEPARATLY BY THE LINK DRIVER.
  3215. *
  3216. * BYTE DESCRIPTIONS';
  3217. * SWITCH WORD
  3218. * / 0 / 0 / 0 / 0 / NUMBER OF WORDS IN REQUEST(CM) /
  3219. * PARAMETER SECTION (IBF)
  3220. * / 0 / 0 / 0 / 0 / LINK FUNCTION CODE (RFUNC) /
  3221. * / RSTA1 / RSTA / UNUSED / UNUSED / RERR /
  3222. * MESSAGE INFO (IHDR)
  3223. * / REOM / RWDS / STNO / RSOM / RMNO (ISTART) /
  3224. * START OF ACTUAL DATA (XBUFF)
  3225. * / 200 BYTES OF DATA /
  3226. *
  3227. PLTH EQU 2 CM WORDS IN PARAMETER SECTION
  3228. *
  3229. DLTH EQU 300 PPU WORDS IN DATA BUFFERS
  3230. *
  3231. PPOS EQU 1 OFFSET TO PARAMETER SECTION
  3232. * (CM WORDS)
  3233. DPOS EQU 3 OFFSET TO MESSAGE INFO SECTION
  3234. * (CM WORDS)
  3235. IBF BSS PLTH*5 PARAMETER SECTION
  3236. *
  3237. IHDR BSS 5 MESSAGE INFO
  3238. *
  3239. ISTART EQU IHDR+4 FIRST BYTE TRANSMITTED
  3240. * (MESSAGE NUMBER)
  3241. XBUFF BSS DLTH START OF ACTUAL DATA
  3242. *
  3243. * /--- BLOCK IBF 00 000 77/09/07 23.18
  3244. *
  3245. * * * FOLLOWING ARE LOCATIONS OF VARIOUS PARAMETERS
  3246. * SUPPLIED FOR CERTIAN LINK DRIVER FUNCTIONS.
  3247. *
  3248. XPORTCH EQU XBUFF+4 WORD WHERE 311 CHANNEL IS
  3249. * RECEIVED FROM LINKCTL.
  3250. XECU EQU XBUFF+8 PLATO*S ECS RA UPPER 9 BITS
  3251. *
  3252. XECL EQU XBUFF+9 PLATO*S ECS RA LOWER 12 BITS
  3253. *
  3254. XTMSTAT EQU XBUFF+9 TERMINAL MODE STATION NO.
  3255. *
  3256. XPKEYEC EQU XBUFF+13 ECS ADDRESS OF KEY BUFFER
  3257. *
  3258. XPECSIN EQU XBUFF+18 ECS ADDR. OF KEYS-IN BIT TABLE
  3259. *
  3260. XLINKIO EQU XBUFF+23 ECS ADDR. OF TERMINAL WORD BUF.
  3261. *
  3262. XLKIN EQU XBUFF+28 ECS ADDRESS OF POINTER TO NEXT
  3263. * POSITION IN TERMINAL WORD BUF.
  3264. XLFRBUF EQU XBUFF+33 ECS ADDRESS OF FRAME BUFFERS
  3265. *
  3266. XLFRPNT EQU XBUFF+38 ECS ADDRESS OF FRAME BUFFER
  3267. * POINTER.
  3268. XFRLTHS EQU XBUFF+43 ECS ADDRESS OF FRAME LENGTH
  3269. * TABLE
  3270. XPIOSTS EQU XBUFF+48 FRAMER STATUS WORD
  3271. *
  3272. XLFRLTH EQU XBUFF+54 NO. OF TERMINAL WORDS PER
  3273. * FRAME.
  3274. XFRAMID EQU XBUFF+59 LINK FRAME ID
  3275. *
  3276. XPATTRN EQU XBUFF+9 TEST PATTERN FOR LOOP BACK
  3277. *
  3278. XLOOPS EQU XBUFF+14 0=RECEIVE 100 LOOPBACK CHARS
  3279. * 1=RECEIVE INFINITE NO. OF CHARS
  3280. *
  3281. * * * BYTE POSITIONS OF FIELDS IN PARAMETER SECTION
  3282. *
  3283. RFUNC EQU 4 FUNCTION CODE
  3284. *
  3285. RERR EQU 9 ERROR CODE
  3286. *
  3287. RSTA1 EQU 5 SECONDARY STATUS
  3288. *
  3289. RSTA EQU 6 EQUIPMENT STATUS
  3290. *
  3291. *
  3292. * * * BYTE POSITION OF FIELDS IN MESSAGE INFO SECTION
  3293. *
  3294. RSOM EQU 3 START OF MESSAGE CHARACTER
  3295. *
  3296. REOM EQU 0 END OF MESSAGE CHAR.
  3297. *
  3298. STNO EQU 2 LINKCTL STATION NO.
  3299. *
  3300. RMNO EQU 4 MESSAGE NUMBER
  3301. *
  3302. RWDS EQU 1 PPU WORD COUNT
  3303. *
  3304. ************************************************************************
  3305. * /--- BLOCK OBF 00 000 77/09/07 01.20
  3306. TITLE COMMUNICATION BUFFERS
  3307. ************************************************************************
  3308. *
  3309. * THIS BUFFER IS USED FOR SENDING DATA AND
  3310. * RESPONSE PARAMETERS TO LINKCTL. 'THE SWITCH
  3311. * WORD IS APPENDED TO THE FOLLOWING BUFFER AFTER
  3312. * IT IS WRITTEN TO CENTRAL MEMORY.
  3313. *
  3314. * BYTE DESCRIPTIONS';
  3315. * SWITCH WORD (BUILT AT A SEPARATE LOCATION)
  3316. * / 4000B / 0 / 0 / NO. OF WORDS RETURNED(CM) / 0 /
  3317. * PARAMETER SECTION (OBF)
  3318. * / 0 / 0 / 0 / 0 / UNUSED /
  3319. * / RSTA1 / RSTA / UNUSED / UNUSED / RERR /
  3320. * MESSAGE INFO SECTION (IHDR)
  3321. * / REOM / RWDS / STNO / RSOM / RMNO (OSTART) /
  3322. * START OF ACTUAL DATA (DBUFF)
  3323. * / 200 BYTES OF DATA /
  3324. *
  3325. MAXIN EQU DLTH+4 MAXIMUM NUMBER OF BYTES+2 IN
  3326. * A MESSAGE FROM REMOTE SITE.
  3327. OBF BSSZ PLTH*5 OUTPUT BUFFER FOR PARAMETER
  3328. *
  3329. OHDR BSS 5 MESSAGE INFO
  3330. *
  3331. OSTART EQU OHDR+4 LOCATION TO STORE 1ST BYTE OF
  3332. * MESSAGE (MESSAGE NUMBER).
  3333. DBUFF BSS DLTH LOCATION OF FIRST BYTE OF DATA.
  3334. *
  3335. *
  3336. * * * LOCATIONS OF VARIOUS PARAMETERS RETURNED TO
  3337. * LINKCTL.
  3338. *
  3339. DSTATS EQU DBUFF+4 LINK DRIVER STATISTICS
  3340. *
  3341. ************************************************************************
  3342. * /--- BLOCK ERROR CODE 00 000 78/01/05 09.04
  3343. TITLE ERROR CODES
  3344. ************************************************************************
  3345. *
  3346. * * ERROR CODES
  3347. * CODES 0,1, AND 2 SAVE FOR PPU CALL ERRORS WHICH
  3348. * ARE GENERATED BY TUTOR COMMAND LOADPPU.
  3349. *
  3350. SIFC EQU 3 ILLEGAL FUNCTION CODE
  3351. SENA EQU 4 EQUIPMENT NOT AVAILABLE
  3352. SCNA EQU 5 CHANNEL NOT AVAILABLE
  3353. SRDR EQU 6 REMOTE DID NOT RESPOND AFTER
  3354. * SENDING DURING STARTUP.
  3355. HDCN EQU 7 CHANNEL WOULD NOT DEACTIVATE.
  3356. HFSC EQU 8 COULD NOT SELECT 6681.
  3357. HECP EQU 9 COULD NOT ESTABLISH CHARACTER
  3358. * PHASE IN 311.
  3359. HCNO EQU 10 CARRIER NOT ON IN 311.
  3360. HDSF EQU 11 DATA SET FAILURE.
  3361. HCRQ EQU 12 INITIAL CHARACTER REQUEST
  3362. * NEVER APPEARED.
  3363. HREJ EQU 13 6681 REJECTED CONNECT FUNCTION
  3364. HSYN EQU 14 SYNCHRONIZATION LOST.
  3365. HLCR EQU 15 LOST CONTACT WITH REMOTE SITE
  3366. SCML EQU 16 LINKCTL REQUEST TOO LONG
  3367. HRSD EQU 17 MESS. CANNOT BE SENT CORRECTLY
  3368. HMLT EQU 18 MESSAGE TOO LONG.
  3369. HBCH EQU 19 TOO MANY CONSECUTIVE BAD CHAR.
  3370. ************************************************************************
  3371. * /--- BLOCK FUNC SOFT 00 000 76/10/14 13.31
  3372. TITLE COMMAND CODES AND CONTROL CHARACTERS
  3373. ************************************************************************
  3374. *
  3375. * COMMAND CODES FROM -LINKCTL-.
  3376. *
  3377. ************************************************************************
  3378. *
  3379. FASU EQU 0 CHECK FOR STARTUP
  3380. FRES EQU 1 RESERVE DRIVER.
  3381. FMES EQU 2 SEND AND RECEIVE A MESSAGE
  3382. FREL EQU 3
  3383. FSTA EQU 4 RETURN 311 STATUS
  3384. FSTI EQU 5 RETURN STATISTICS COUNTERS
  3385. FTST EQU 6 RUN LOOP BACK TEST
  3386. FLTL EQU 7 LOCAL TERMINAL MODE
  3387. FRTL EQU 10B REMOTE TERMINAL MODE
  3388. FSIL EQU 11B UNUSED
  3389. FNTL EQU 12B NEW LOOPBACK TEST.
  3390. *
  3391. ************************************************************************
  3392. SPACE 4
  3393. ************************************************************************
  3394. *
  3395. * CONTROL CHARACTERS
  3396. *
  3397. ************************************************************************
  3398. *
  3399. CEOD EQU 30B END OF DATA
  3400. CEOB EQU 31B END OF BLOCK
  3401. CEOF EQU 32B END OF FILE
  3402. CNAK EQU 33B NEGATIVE ACKNOWLEDGE
  3403. CACK EQU 34B POSITIVE ACKNOWLEDGE
  3404. CETM EQU 35B END OF TERMINAL MODE
  3405. CSYN EQU 62B SYNCH CODE
  3406. CMAX EQU 77B MAXIMUM CONTROL CHARACTER
  3407. *
  3408. ************************************************************************
  3409. SPACE 2
  3410. ************************************************************************
  3411. *
  3412. * PLATO REQUEST CODES
  3413. *
  3414. ************************************************************************
  3415. PKILL EQU 1 KILL THIS PPU ROUTINE
  3416. PKEY EQU 2 PRESS A KEY ON LINKCTL
  3417. ************************************************************************
  3418. * /--- BLOCK FUNC HARD 00 000 76/04/07 23.34
  3419. TITLE 6681 AND 311-B CODES
  3420. ************************************************************************
  3421. *
  3422. * 6681 DATA CHANNEL CONVERTER CODES
  3423. *
  3424. ************************************************************************
  3425. DCSC EQU 2000B SELECT CONVERTER
  3426. DCDC EQU 2100B DESELECT CONVERTER
  3427. DCIC EQU 1500B INPUT CODE
  3428. DCOC EQU 1600B OUTPUT CODE
  3429. DCMC EQU 1700B MASTER CLEAR
  3430. DCCS EQU 1200B CONVERTER STATUS
  3431. DCES EQU 1300B EQUIPMENT STATUS
  3432. ************************************************************************
  3433. SPACE 4
  3434. ************************************************************************
  3435. *
  3436. * 311-B FUNCTION CODES.
  3437. *
  3438. ************************************************************************
  3439. BSTP EQU 1 SELECT STOP
  3440. BSND EQU 2 SELECT SEND
  3441. BRSY EQU 4 RESYNC CODE.
  3442. BSAR EQU 6 COMBINED SEND AND RESYNC CODE.
  3443. ************************************************************************
  3444. SPACE 4
  3445. ************************************************************************
  3446. *
  3447. * 311 STATUS MASKS
  3448. *
  3449. ************************************************************************
  3450. *
  3451. MCPE EQU 1000B CHARACTER PARITY ERROR.
  3452. MCRQ EQU 2000B CHARACTER REQUEST
  3453. MCRD EQU 4000B CHARACTER READY
  3454. MCST EQU 2 CARRIER ON
  3455. MCPH EQU 1 CHARACTER PHASE
  3456. MCSR EQU 4000B ODD CHANNEL STATUS READY
  3457. *
  3458. * /--- BLOCK INITIAL 00 000 78/02/06 10.58
  3459. TITLE INITIALIZATIONS
  3460. *
  3461. INITIAL SUBR
  3462. *
  3463. * * * READ CONTROL POINT STATUS
  3464. LDD CP
  3465. ADN STSW READ CONTROL POINT STATUS
  3466. CRD CM
  3467. LDD CM+C.CPEF
  3468. NJP DPP2 DROP PPU IF ERROR
  3469. *
  3470. * * * GET CALL STATUS WORD
  3471. LDD IR+3 READ STATUS WORD
  3472. LPN 37B
  3473. STM PU SAVE RELATIVE ADDRESS
  3474. SHN 12
  3475. ADD IR+4
  3476. STM PL SAVE BOTTOM OF RELATIVE ADDR.
  3477. CALL ABS CONVERT TO ABSOLUTE
  3478. ZJP INITE JUMP IF OUT OF RANGE
  3479. *
  3480. * * * PLANT ABSOLUTE ADDRESS OF CALL STATUS WORD
  3481. PLANT CM,PPST
  3482. *
  3483. * * * READ PPU CALL STATUS WORD
  3484. LOADCM PPST
  3485. CRD CM
  3486. LDN 1 INDICATE PPU UP AND RUNNING
  3487. STD CM+4
  3488. LOADCM PPST
  3489. CWD CM REWRITE STATUS WORD.
  3490. *
  3491. * * * FORM ABSOLUTE ADDRESS OF COMMUNICATION BUFFER
  3492. LOADCM PPST
  3493. ADN 2
  3494. PLANT CM,COMBF
  3495. *
  3496. * * * PLANT ADDRESS USED FOR ECS TRANSFERS
  3497. LOADCM PPST
  3498. ADN 22
  3499. PLANT CM,TRNBF
  3500. *
  3501. * * * INITIALIZE WAIT FOR CHARACTER READY STATUS COUNTER
  3502. LDC ALSEVEN
  3503. STD NC
  3504. *
  3505. * * * INITIALIZE I/O CHARACTER COUNTS.
  3506. LDN 0
  3507. STD DL
  3508. STM SFLAG
  3509. STD ECSOFF
  3510. STD BADC
  3511. STD MODE
  3512. LDN 50
  3513. STD FRCHK TIME-OUT COUNTER FOR READING
  3514. * FRAMAT STATUS
  3515. LJM INITIALX
  3516. *
  3517. * * * ADDRESS OUT OF RANGE SENT AN ERROR CODE.
  3518. INITE BSS 0
  3519. CALL DFM,CMSG
  3520. LJM DPP DROP PPU.
  3521. *
  3522. CMSG DIS ,*(CLD)CM ADDRESS OUT OF RANGE*
  3523. *
  3524. PARTBLE BSS 128 START OF PARITY TABLE
  3525. *
  3526. *CALL PLAPABS
  3527. *CALL PLAPDNM
  3528. *CALL PLAPEQN
  3529. *CALL PLAPPLN
  3530. *
  3531. C=CH TABLE CHANNEL 3266 CHANNEL TABLE
  3532. *
  3533. E=CH TABLE CHANNEL 311 EVEN CHANNEL
  3534. *
  3535. O=CH TABLE CHANNEL 311 ODD CHANNEL
  3536. *
  3537. PPST TABLE CM PPU CALL STATUS TABLE
  3538. *
  3539. COMBF TABLE CM COMMUNICATION BUFFER TABLE
  3540. *
  3541. TRNBF TABLE CM ADDRESS USED FOR ECS TRANSFERS
  3542. *
  3543. ERRNG 7777B-* PP OVERFLOW
  3544. END
plato/source/plaopl/cld.txt · Last modified: 2023/08/05 18:54 by Site Administrator