User Tools

Site Tools


plato:source:plaopl:exec2

Table of Contents

EXEC2

Table Of Contents

  • [00005] TUTOR EXECUTION-INTERPRETER
  • [00013] ENTRY/EXTERNAL
  • [00055] -DRAW- COMMAND
  • [00233] WINDBUF - OUTPUT WINDOWED LINES
  • [00323] SINCOS
  • [00354] -RDRAW- / -GDRAW- COMMANDS
  • [00377] BLOCK
  • [00428] ZERO, ADD1, SUB1
  • [00456] CODEOUT, WINDOW
  • [00467] -BREAK-
  • [00482] -TABSET- COMMAND
  • [00492] -COPY-
  • [00517] -JKEY- COMMAND
  • [00532] BUMP
  • [00585] -EDIT-
  • [00606] -DATE-
  • [00621] -CLOCK- COMMAND
  • [00636] -DAY- COMMAND
  • [00682] -PLAY- -RECORD-
  • [00721] -ENABLE- -DISABLE-
  • [00765] DELAY
  • [00809] -ALTFONT-
  • [00836] -CODE- AND -CHECK-
  • [00908] CHECK EDITING CODE
  • [00985] -SYSCOR- CHECK FOR SPECIAL GROUP
  • [01038] -NAME- AND -GROUP- COMMANDS
  • [01068] MODESET AND BITSOUT
  • [01100] ASCII
  • [01123] SYSLESS
  • [01145] SYSTEM LESSON LIST SEARCHES
  • [01201] STOPCHK - CHECK FOR SPECIAL STOP1 PROCESSING
  • [01262] SYSLES - CHECK FOR NON-DELETABLE SYSTEM LESSONS
  • [01313] SYSLES1 - CHECK DELETION PROTECTION AND ECS CHARGE
  • [01375] SAVE0167 - SAVE A0, A1, A6, A7, X0, X1, X6, X7
  • [01421] REST0167 - RESTORE A0, A1, A6, A7, X0, X1, X6, X7
  • [01486] PROSRCH - SPECIAL SEARCH LESSON DESCRIPTOR TABLE
  • [01675] -ZFILL- COMMAND
  • [01689] -CPULIM- COMMAND
  • [01727] SHOWT
  • [02122] SHOW
  • [02192] SHOWZ
  • [02250] ZEROSAV - SAVE REGISTERS *X4* AND *A4*
  • [02270] ZERORST - RESTORE *X4* AND *A4* AFTER -ZERO-

Source Code

EXEC2.txt
  1. EXEC2
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK EXEC2 00 000 74/10/08 23.11
  4. IDENT EXEC2
  5. TITLE TUTOR EXECUTION-INTERPRETER
  6. *
  7. * GET COMMON SYMBOL TABLE
  8. *
  9. CST
  10. *
  11. *
  12. * /--- BLOCK ENTRY/EXT 00 000 78/12/18 21.20
  13. TITLE ENTRY/EXTERNAL
  14. *
  15. *
  16. EXT ECSPRTY ECS PARITY ERROR RECOVERY
  17. EXT BOUNDS,WORDS,PROCESS,PROCO,PROC,RCTOXY,GETN
  18. EXT PROCESX
  19. EXT VARCNT,GETCODX,ILOC
  20. EXT VARADD,EXECSAV
  21. EXT GET2,CUNIT
  22. EXT XSLICE
  23. EXT FSTOTOA FOR *OTOA * COMMAND (TUTSUB)
  24. EXT TFIN
  25. EXT WINDOW
  26. EXT CLRFIO CLEAR FILE ACTIVITY MARKER
  27. EXT ERROROF
  28. EXT ERXMXL
  29. EXT ERXSTU
  30. EXT ERXFVAL
  31. EXT ERXVAL
  32. EXT ERXHSEG
  33. EXT TOOMUCH
  34. EXT ERXOUTP
  35. EXT ERXSTOL
  36. EXT ERXBADL
  37. EXT DEVSYS
  38. *
  39. *
  40. ENTRY DRAWX,RDRAWX,GDRAWX
  41. ENTRY BLOCKX
  42. ENTRY CODOUTX
  43. ENTRY TABX
  44. ENTRY COPYX,JKEYX,DATEX,CLOCKX
  45. ENTRY PLAYX,MIKEX
  46. ENTRY ENABLEX,DISABLX
  47. ENTRY DELAYX,AFONTX
  48. ENTRY CHECKX,NAMEX,GROUPX,DAYX,ZEROX,ZEROXX
  49. ENTRY EDITX
  50. ENTRY BUMPX,CODEX
  51. ENTRY SYSLESX
  52. ENTRY RETRNX,ZFILLX,CPULIMX
  53. ENTRY RETRN
  54. * /--- BLOCK DRAW 00 000 80/05/17 17.25
  55. TITLE -DRAW- COMMAND
  56. *
  57. *
  58. * EXECUTION ROUTINE FOR -DRAW- COMMAND
  59. *
  60. *
  61. DRAWX SA1 MOUTLOC SEE IF MOUT BUFFER TOO FULL
  62. SX1 X1-MOUTLTH+133 TEMP FIX BY KELSO/S
  63. * 5/17/80
  64. NG X1,DRAWX2 IF ROOM
  65. SA5 A5+1 BACK UP COMMAND POINTER
  66. EQ XSLICE END THIS TIME SLICE
  67. *
  68. DRAWX2 SA1 TBWNDOW WINDOWING IS SLOW AND
  69. NZ X1,DRAWINDO CANT USE THIS ROUTINE.
  70. BX6 X5 ALL PACKED UP FLAG=BIT 58
  71. LX6 1
  72. NG X6,SFDRAW IF CONSTANT, NON WINDOWED DRAW
  73. AX6 1+60-XCODEL GET NO. OF VARS TO DECODE
  74. SX6 X6+1 ADD 1 TO INCLUDE COUNT ITSELF
  75. RJ GETCODX GETVAR CODES IN VARBUF
  76. SA2 VARCNT
  77. SX7 X2-1
  78. SA7 A2 CORRECT VARCNT
  79. *
  80. * MOUT HEADER SHOULD ALWAYS BE CORRECT, IN CASE THERE
  81. * IS AN EXEC ERROR IN EVALUATING A TAG, AND THE EXEC
  82. * ERROR ROUTINE DOESN'7T ZERO THE MOUT COUNT.
  83. *
  84. SA1 MOUTLOC
  85. SX7 10000B+SKPCODE LENGTH + HEADER CODE
  86. + PL X5,*+1 IF NOT CONTINUED
  87. SX7 10000B+CDWCODE CONTINUED DRAW HEADER
  88. + SA7 MOUT+X1 OUTPUT HEADER
  89. SX6 A7
  90. SA6 ILOC ILOC -> HEADER FOR UPDATING
  91. SX6 X1+1 INCREMENT MOUT POINTER
  92. SA6 A1
  93. SX6 0 1ST ARGUMENT
  94. SA6 ERXARGN SET EXECERR ARGUMENT NUMBER
  95. SX1 VARBUF+1 FIRST VARIABLE ADDRESS
  96. *
  97. * GET NEXT GETVAR CODE --- X1-> THE GETVAR CODE
  98. *
  99. DRAWX5 SA2 ERXARGN INC EXECERR ARG NUMBER
  100. SX6 X2+1
  101. SA6 A2
  102. SA2 X1 X2 = THIS GETVAR CODE
  103. SX6 X1+1 -> NEXT GETVAR CODE
  104. SA6 VARADD
  105. MX6 2 MASK AND SKIP FLAG
  106. BX5 -X6*X2 GETVAR CODE IN TOP OF X5
  107. BX2 X6*X2 TYPE OF CODE BITS IN X2
  108. LX2 2
  109. SB2 X2 00=COARSE, 01=FINE,
  110. JP *+1+B2 10=PACKED FINE, 11=SKIP
  111. + EQ CGDRAW COARSE GRID VERTEX
  112. + EQ FGDRAW FINE GRID VERTEX
  113. + MX0 XCODEL PACKED FINE GRID
  114. BX6 X0*X5 ONLY WANT X/Y
  115. + LX6 18+2 POSITION SKIP AND PACKED FINE
  116. EQ DRAWX6
  117. *
  118. * COARSE GRID VERTEX ---
  119. CGDRAW NGETVAR ROW-COLUMN ARGUMENT IN X1
  120. CALL RCTOXY
  121. MX0 -9
  122. BX6 -X0*X6
  123. LX6 9
  124. BX7 -X0*X7
  125. BX6 X6+X7
  126. EQ DRAWX6
  127. * /--- BLOCK DRAW 00 000 78/05/17 20.53
  128. *
  129. * FINE GRID VERTEX ---
  130. FGDRAW NGETVAR GET X VALUE
  131. BX6 X1
  132. SA6 ILOC+1 SAVE X VALUE
  133. SA1 VARCNT DECREMENT VARIABLE COUNT
  134. SX6 X1-1
  135. SA6 A1
  136. SA1 VARADD X1 = CURRENT *VARBUF* ADDRESS
  137. SA2 X1 X2 = -GETVAR- CODE FOR Y-COORD
  138. SX6 X1+1 X6 -> NEXT -GETVAR- CODE
  139. SA6 A1
  140. BX5 X2
  141. NGETVAR GET Y VALUE
  142. MX0 -9
  143. BX7 -X0*X1
  144. SA1 ILOC+1 RETREIVE X VALUE
  145. BX6 -X0*X1
  146. LX6 9
  147. BX6 X6+X7 PUT X AND Y TOGETHER
  148. * EQ DRAWX6
  149. *
  150. * X6= X/Y COORD, OR SKIP INDICATOR
  151. DRAWX6 SA1 MOUTLOC CURRENT OUTPUT POINTER
  152. SA6 MOUT+X1 STORE X/Y
  153. SX7 X1+1 UPDATE MOUTLOC POINTER
  154. SA7 A1
  155. SA1 ILOC X1 -> MOUT HEADER
  156. SA1 X1 X1 = MOUT HEADER
  157. SX7 10001B ADD TO BOTH COUNTS
  158. LX7 12
  159. IX7 X1+X7
  160. SA7 A1
  161. SA1 VARCNT UPDATE COUNT OF VARIABLES LEFT
  162. SX7 X1-1
  163. ZR X7,DRAWX9 IF ALL DONE
  164. SA7 A1
  165. SA1 VARADD X1->NEXT GETVAR CODE
  166. EQ DRAWX5 AND GET NEXT GETVAR CODE
  167. *
  168. * DONE WITH DRAW, X6=LAST X/Y POINT (MAY NOT BE SKIP)
  169. *
  170. DRAWX9 MX0 -9 UPDATE NX/NY
  171. BX7 -X0*X6
  172. LX6 -9
  173. BX6 -X0*X6
  174. SA6 NX
  175. SA7 NY
  176. EQ PROCESX
  177. *
  178. ************************************************************
  179. * /--- BLOCK SFDRAW 00 000 75/10/17 23.15
  180. EJECT
  181. *
  182. * * * SUPER FAST DRAW --- JUST OUTPUT AND SET NX,NY
  183. * PRE EXECUTION FOR DRAW GUARANTEES NO MOUT OVERFLOW
  184. *
  185. * OUTPUT MOUT HEADER AND COUNT OF CODES ---
  186. *
  187. SFDRAW BX1 X5
  188. LX1 XCODEL
  189. SX1 X1 X1 = COUNT
  190. SX0 SFDCODE HEADER CODE
  191. LX1 24
  192. BX0 X0+X1 COMBINE COUNT WITH HEADER CODE
  193. LX1 -24 SHIFT BACK TO POSITION
  194. SA4 MOUTLOC X4 = POINTER INTO MOUT BUFFER
  195. SX2 X4+1 ADVANCE MOUT POINTER
  196. BX6 X5
  197. LX6 2*XCODEL FIRST TAG IN LOW 20 BITS
  198. * CONTINUED DRAW FLAG=TOP BIT IN MIDDLE 20
  199. SX1 X1+2-1 PRETEND 3 POINTS IN FIRST WORD
  200. LX5 -XCMNDL
  201. MX7 2*XCODEL+XCMNDL
  202. BX5 -X7*X5 X5 = EXTRA STORAGE POINTER
  203. *
  204. * WORDS FOLLOWING HEADER CONTAIN PACKED UP DRAW POINTS
  205. *
  206. SFDRAW1 SA6 MOUT+X2 OUTPUT NEXT SET OF WORDS
  207. SX2 X2+1 AND ADVANCE MOUT POINTER
  208. SX1 X1-3
  209. NG X1,SFDRAW2
  210. SA3 B5+X5 NEXT EXTRA STORAGE WORD
  211. BX6 X3
  212. SX5 X5+1
  213. EQ SFDRAW1
  214. *
  215. SFDRAW2 BX7 X2 UPDATE MOUT POINTER
  216. SA7 A4
  217. IX2 X2-X4 COMBINE COUNT OF WORDS
  218. LX2 12
  219. BX7 X0+X2 WITH MOUT HEADER
  220. SA7 MOUT+X4 AND STORE OUTPUT HEADER
  221. SB1 X1+3 FIND WHERE IN WORD LAST TAG IS
  222. JP *+1+B1
  223. + LX6 -XCODEL WAS IN TOP, NOW IN MIDDLE
  224. + LX6 -XCODEL WAS IN MIDDLE,
  225. + MX0 -9 NOW IN BOTTOM
  226. BX7 -X0*X6 NEW NY
  227. LX6 -9
  228. BX6 -X0*X6 NEW NX
  229. SA7 NY
  230. SA6 NX
  231. EQ PROCESS
  232. * /--- BLOCK WINDBUF 00 000 86/12/08 08.36
  233. TITLE WINDBUF - OUTPUT WINDOWED LINES
  234. *
  235. * WINDBUF --- OUTPUT A WHOLE BUFFER OF WINDOWED LINES
  236. *
  237. * ON ENTRY---
  238. * TOP BIT OF X5 SET IF CONTINUED DRAW
  239. * X1 -> FIRST WORD OF BUFFER TO OUTPUT
  240. * X2 = NUMBER OF WORDS IN BUFFER
  241. * END POINTS OF LINES ARE IN PAIRS OF WORDS (X,Y)
  242. * -SKIP- IS INDICATED BY TOP TWO BITS 1, REST 0
  243. * ON EXIT ---
  244. * LINES ARE PLACED IN THE MOUT BUFFER, MOUTLOC UPDATED
  245. * NX, NY UPDATED TO END OF DRAWN LINES
  246. *
  247. * CALLED FROM LINCHR AND DRAWS
  248. *
  249. ENTRY WINDBUF
  250. *
  251. WINDBUF EQ *
  252. ZR X2,WINDBUF
  253. NG X2,WINDBUF
  254. BX6 X1 SAVE -> BUFFER
  255. BX7 X2 SAVE COUNT OF ENTRIES
  256. SA6 WINDA
  257. SA7 WINDB
  258. NG X5,FIGF1 IF -AT- NOT NEEDED
  259. *
  260. FIGF0 SA1 WINDA
  261. SX7 X1+2 INCREMENT POINTER
  262. SA7 A1
  263. SA1 X1
  264. BX6 X1
  265. SA6 NX SET BEGINNING X
  266. SA2 A1+1
  267. BX6 X2
  268. SA6 NY SET BEGINNING Y
  269. MX7 -9
  270. BX1 -X7*X1 MASK TO 9BITS
  271. BX2 -X7*X2
  272. MX4 2 CHECK FOR REDUNDANT -SKIP-
  273. BX4 X1-X4
  274. ZR X4,FIGF1.1 IF -SKIP-
  275. LX1 9
  276. BX1 X1+X2 PACK UP X AND Y
  277. OUTCODE WFCODE OUTPUT FINE WHERE
  278. SA2 WINDB
  279. SX7 X2-2
  280. SA7 A2
  281. ZR X7,WINDBUF
  282. *
  283. * /--- BLOCK WINDBUF 00 000 86/12/08 08.38
  284. FIGF1 SA1 WINDA GET POINTER
  285. SX7 X1+2 INCREMENT POINTER
  286. SA7 A1
  287. SA3 X1 GET NEXT VALUE
  288. MX4 2 CHECK FOR -SKIP- OPTION
  289. BX4 X3-X4
  290. NZ X4,FIGF1S
  291. FIGF1.1 BSS 0
  292. SA2 WINDB
  293. SX7 X2-2 GOING TO SKIP
  294. SA7 A2
  295. NZ X7,FIGF0
  296. EXECERR 115 CANNOT END WITH -SKIP- ('/'/)
  297. *
  298. FIGF1S SA4 A3+1
  299. SA1 TBWNDOW GET WINDOWING FLAG
  300. BX0 X1 X0 = WINDOW INFO
  301. SA1 NX BEGINNING X
  302. SA2 NY BEGINNING Y
  303. BX6 X3
  304. SA6 A1 UPDATE X
  305. BX6 X4
  306. SA6 A2 UPDATE Y
  307. RJ WINDOW
  308. NZ X0,FIGF3 JUMP IF WINDOWED LINE DRAWN
  309. *
  310. LX3 9
  311. BX1 X3+X4 PACK UP X AND Y
  312. OUTCODE LFCODE OUTPUT FINE LINE
  313. FIGF3 SA2 WINDB GET COUNT
  314. SX7 X2-2
  315. SA7 A2 DECREMENT COUNT
  316. NZ X7,FIGF1 LOOP
  317. EQ WINDBUF
  318. *
  319. WINDA BSS 1
  320. WINDB BSS 1
  321. *
  322. * /--- BLOCK SINCOS 00 000 75/11/21 18.58
  323. TITLE SINCOS
  324. *
  325. * FIND SIN AND COS OF AN ANGLE
  326. *
  327. * ON ENTRY --
  328. * X6 = ANGLE (IN RADIANS)
  329. *
  330. * ON EXIT --
  331. * X6 = SINE OF ANGLE
  332. * X7 = COSINE OF ANGLE
  333. *
  334. * CALLED FROM LINWRT AND DRAWS
  335. *
  336. ENTRY SINCOS
  337.  
  338. SINCOS EQ *
  339. SA6 SINCOSA SAVE ANGLE
  340. BX1 X6 TSIN EXPECTS ARG IN X1
  341. CALL TSINX
  342. BX7 X1 SINE COMPUTED
  343. SA1 SINCOSA RESTORE ANGLE
  344. SA7 A1 SAVE SINE
  345. CALL TCOSX
  346. BX7 X1 X7 = COSINE
  347. SA1 SINCOSA
  348. BX6 X1 X6 = SINE
  349. EQ SINCOS
  350. *
  351. SINCOSA BSS 1 TEMPORARY WORD
  352. *
  353. * /--- BLOCK RDRAW 00 000 85/01/31 13.30
  354. TITLE -RDRAW- / -GDRAW- COMMANDS
  355. *
  356. * * * -RDRAW- COMMAND
  357. *
  358. RDRAWX MX6 -1 FLAG -RDRAW-
  359. EQ DRAWIN1
  360. *
  361. * * * -GDRAW- COMMAND
  362. *
  363. GDRAWX SX6 1 FLAG -GDRAW-
  364. DRAWIN1 SA1 MOUTLOC SEE IF MOUT BUFFER TOO FULL
  365. SX1 X1-MOUTLTH+70 63 ARGS MAX
  366. NG X1,DRAWIN2 IF ROOM
  367. SA5 A5+1 BACK UP COMMAND POINTER
  368. EQ XSLICE END THIS TIME SLICE
  369. *
  370. * * * WINDOWED DRAW CANT USE THE FAST DRAW ROUTINE
  371. *
  372. DRAWINDO SX6 0 FLAG -DRAW-
  373. DRAWIN2 SA6 OVARG1 (ALREADY CHECKED FOR MOUT ROOM)
  374. EXEC DRAWS,NDRAWOV
  375. *
  376. * /--- BLOCK BLOCK 00 000 78/07/05 01.16
  377. TITLE BLOCK
  378. * -BLOCK- (CODE=102)
  379. *
  380. * TRANSFER BLOCK OF VARIABLES
  381. * TRYING TO TRANSFER MORE THAN
  382. * TEMPLTH VARIABLES CAUSES AN
  383. * EXECUTION ERROR.
  384. * GETS LENGTH FIRST TO AVOID PHONY ARRAY
  385. * BOUNDS ERRORS WHEN LENGTH IS 0.
  386. *
  387. *
  388. BLOCKX AX5 XCMNDL
  389. MX0 -XSPTRL
  390. BX5 -X0*X5
  391. SA1 B5+X5 GET XTRA WORD
  392. BX5 X1
  393. NGETVAR
  394. ZR X1,PROCESS --- DONE IF LENGTH = 0
  395. SB1 X1 LENGTH
  396. SB2 B1-TEMPLTH-1
  397. PL B2,BERXBIG WILL IT FIT
  398. SA5 A5
  399. BX6 X1
  400. SA6 ILOC SAVE LENGTH
  401. NGETVAR
  402. SX6 A1
  403. SA6 ILOC+1 SAVE FROM ADDRESS
  404. SA5 A5
  405. LX5 XCODEL
  406. NGETVAR
  407. SX2 A1 (X2) = TO ADDRESS
  408. SA1 ILOC (X1) = LENGTH
  409. SA0 X2
  410. RJ BOUNDS CHECK LEGALITY OF TO ADDRESSES
  411. SA3 ILOC+1 (X3) = FROM ADDRESS
  412. SA0 X3
  413. RJ BOUNDS CHECK LEGALITY OF ADDRESSES
  414. SA4 ATEMPEC ADDRESS OF ECS TEMPORARY BUFFER
  415. BX0 X4
  416. SB1 X1 LENGTH (A0=FROM ADDRESS)
  417. WE B1
  418. RJ ECSPRTY
  419. SA0 X2 TO CENTRAL ADDRESS
  420. RE B1
  421. RJ ECSPRTY
  422. EQ PROCESS --- DONE
  423. *
  424. BERXBIG SX2 TEMPLTH
  425. EXECERR 116
  426. * /--- BLOCK ZERO 00 000 78/12/21 18.27
  427. *
  428. TITLE ZERO, ADD1, SUB1
  429. * -ZERO-
  430. *
  431. * ZERO SPECIFIED VARIABLE
  432. *
  433. ZEROX MX6 0
  434. NPUTVAR STORE A ZERO IN SPECIFIED VAR
  435. EQ PROC
  436. *
  437. *
  438. * -ZERO- COMMAND
  439. * USES ZEROED ECS BUFFER TO CLEAR A BLOCK
  440. *
  441. ZEROXX NGETVAR
  442. SX6 A1 SAVE STARTING ADDRESS
  443. SA6 EXECSAV
  444. SA5 A5
  445. LX5 XCODEL POSITION NEXT -GETVAR- CODE
  446. NGETVAR
  447. ZR X1,PROC --- EXIT IF LENGTH=0
  448. SA2 EXECSAV
  449. SA0 X2 ADDRESS OF FIRST VAR TO ZERO
  450. RJ BOUNDS
  451. SB3 X1 LENGTH MUST BE CONST OR *B* REG
  452. SX1 A0 MOVE TO *X1* BECAUSE OF -ZERO-
  453. ZERO X1,B3 CLEAR OUT VARIABLES
  454. EQ PROC
  455. * /--- BLOCK CODEOUT 00 000 76/08/02 23.06
  456. TITLE CODEOUT, WINDOW
  457. * -CODEOUT- (CODE=112)
  458. *
  459. * THE TAG SPECIFIES THE 6 BIT CODE TO BE OUTPUT
  460. * AFTER AN UNCOVER CODE.
  461. *
  462. CODOUTX NGETVAR ROUNDS TO INTEGER IN X1
  463. OUTPUT CODCODE
  464. EQ PROC
  465. *
  466. * /--- BLOCK RETURN 00 000 80/02/15 22.12
  467. TITLE -BREAK-
  468. *
  469. * -BREAK- (CODE=268)
  470. *
  471. ENTRY RETRNZ
  472. RETRNZ SA5 A5+1 BACK-UP COMMAND POINTER
  473. *
  474. RETRNX BSS 0 ENTRY POINT FOR -BREAK-
  475. RETRN SA1 SCOMFLG
  476. PL X1,RTX2 JUMP IF NO STATISTICS
  477. CALL POSTCMS TAKE COMMAND STATISTICS
  478. *
  479. RTX2 CALL TFIN END THIS TIME SLICE
  480. CALL USV UPDATE SCREEN VARIABLES
  481. EQ PROCESS
  482. TITLE -TABSET- COMMAND
  483. *
  484. *
  485. * -TABSET- (CODE=269)
  486. *
  487. TABX NGETVAR GET THE TABSETS
  488. BX6 X1
  489. SA6 TBTAB STORE
  490. EQ PROC
  491. * /--- BLOCK COPY 00 000 77/10/20 20.23
  492. TITLE -COPY-
  493. * -COPY- (CODE=130)
  494. *
  495. * ENABLE COPY KEY.
  496. * COPY UP TO COUNT SET BY SECOND ARGUMENT
  497. * OR UNTIL A ZERO IS FOUND.
  498. *
  499. COPYX NGETVAR GET THE COPY STRING ADDRESS
  500. SX6 A1
  501. SX7 STUDVAR+VARLIM
  502. IX7 X6-X7
  503. PL X7,ERXSTU ERROR IF NOT IN STUDENT VARS
  504. SA6 ILOC SAVE ADDRESS
  505. SA5 A5 RESTORE
  506. LX5 XCODEL
  507. NGETVAR GET NUMBER OF CHARS
  508. ZR X1,PROC
  509. SA3 ILOC RETRIEVE ADDRESS
  510. SA0 X3 SET UP FOR -WORDS-
  511. CALL WORDS DO BOUNDS CHECK
  512. LX3 18 SHIFT ADDRESS
  513. BX6 X1+X3
  514. LX6 18
  515. SA6 TBCOPY THEN STORE AWAY IN TBCOPY
  516. EQ PROC
  517. TITLE -JKEY- COMMAND
  518. *
  519. *
  520. * -JKEY- (CODE=131)
  521. *
  522. * SET BITS TO SPECIFY WHICH KEYS MAY INITIATE JUDGING
  523. *
  524. JKEYX MX7 60-XCMNDL DISCARD COMMAND BITS
  525. BX7 X7*X5
  526. SA1 TJKEYS PICK UP PRESENT SETTING
  527. ZR X7,JKEYX1 CLEAR IF BLANK COMMAND
  528. BX7 X1+X7
  529. JKEYX1 SA7 TJKEYS SET TERMINAL BANK WORD
  530. EQ PROC
  531. * /--- BLOCK BUMP 00 000 75/10/01 17.29
  532. TITLE BUMP
  533. * -BUMP- (CODE=133)
  534. *
  535. * THE LOGIC OF THIS COMMAND IS--
  536. * X5 HOLDS CHARS OF TAG L-JUS, ZEROS RIGHT.
  537. * COMMAND SEARCHES FOR MATCHES OF TAG CHARS
  538. * THROUGH JUDGE BUFFER. TAG CHARS ARE SHIFTED
  539. * CIRCULARLY, AND NEVER REQUIRE A MEMORY FETCH.
  540. *
  541. BUMPX MX7 48
  542. BX5 X5*X7 8 CHARS MAX, 0 FOR END TEST
  543. SB1 1 UNIVERSAL INCREMENT CONSTANT
  544. SB2 B0 INDEX FOR LOADING
  545. SB3 B0 INDEX FOR STORING
  546. MX0 -6 MASK FOR CHAR
  547. BX4 X5 X4 = TAG CHARS FOR TESTING
  548. *
  549. BMP1 SA1 JUDGE+B2 NEXT CHAR FROM ANSWER
  550. ZR X1,BMP5 IF END OF ANSWER
  551. *
  552. BMP2 LX4 6 GET NEXT TAG CHAR
  553. BX6 -X0*X4
  554. ZR X6,BMP3 IF END OF TAG CHARS
  555. BX6 X6-X1 CHECK CHAR
  556. NZ X6,BMP2 IF NO MATCH, TRY NEXT CHAR
  557. SB2 B2+B1 INCREMENT LOAD INDEX
  558. BX4 X5 RESTORE ORIGINAL TAG
  559. EQ BMP1
  560. *
  561. BMP3 EQ B2,B3,BMP4 IF NOTHING FOUND YET
  562. SA2 JJCHAR+B2
  563. BX6 X1
  564. BX7 X2
  565. SA6 JUDGE+B3
  566. SA7 JJCHAR+B3
  567. BMP4 SB2 B2+B1 INCREMENT LOAD INDEX
  568. SB3 B3+B1 INCREMENT STORE INDEX
  569. BX4 X5 RESTORE ORIGINAL TAG
  570. EQ BMP1 GET NEXT CHAR OF ANSWER
  571. *
  572. * END OF ANSWER
  573. *
  574. BMP5 EQ B2,B3,PROCESS --- RETURN IF NO CHANGE
  575. MX6 -1
  576. MX7 0
  577. SA6 JJSTORE TO TELL -STORE- COMMAND TO RECOMPILE ANSWER
  578. SA7 JJFBUF MARK ANSWER MODIFIED
  579. MX6 0
  580. SX7 B3
  581. SA6 JUDGE+B3 SET 0 FOR END TEST
  582. SA7 TJCOUNT RESET ANSWER LENGTH
  583. EQ PROCESS --- RETURN
  584. * /--- BLOCK EDIT 00 000 77/07/20 17.05
  585. TITLE -EDIT-
  586. * EDIT COMMAND
  587. * THE AUTHOR ASSIGNS A BUFFER TO BE USED BY
  588. * STUDENT UPON PUSHING THE EDIT KEY.
  589. * NO ARG OPTION CLEARS THE FLAG TO NO ACTION.
  590. * ARG OPTION SETS ACTIVE AND POINTS TO BUFFER
  591. * IN TUTOR VARIABLES.
  592. *
  593. EDITX PL X5,EDITX1 SEPARATE CASES
  594. MX6 0
  595. SA6 TBEDIT CLEAR TO INACTIVE
  596. EQ PROC
  597. EDITX1 NGETVAR GET THE EDIT BUFFER ADDRESS
  598. SX6 A1
  599. SX7 STUDVAR+VARLIM LAST LEGAL ADDRESS + 1
  600. IX7 X6-X7
  601. PL X7,ERXSTU JUMP IF OUT OF STUDENT BANK
  602. LX6 36 SHIFT UP
  603. SA6 TBEDIT AND STORE FOR USE DURING EDIT OPTION
  604. EQ PROC
  605. * /--- BLOCK DATE 00 000 80/06/10 14.16
  606. TITLE -DATE-
  607. * -DATE- (CODE=136)
  608. *
  609. * STORES THE CURRENT DATE (AS READ FROM NOS
  610. * LOWCORE ) IN THE SPECIFIED VARIABLE.
  611. *
  612. DATEX NGETVAR A1 = VARIABLE STORAGE ADDRESS
  613. SX6 A1
  614. SA6 ILOC
  615. CALL S=TDATE,ITEMP READ TIME/DATE
  616. SA1 ITEMP+1
  617. SA2 ILOC
  618. BX6 X1
  619. SA6 X2 STORE DATE
  620. EQ PROCESS --- RETURN
  621. TITLE -CLOCK- COMMAND
  622. *
  623. *
  624. *
  625. * -CLOCK- (CODE=137)
  626. *
  627. CLOCKX NGETVAR A1 = VARIABLE STORAGE ADDRESS
  628. SX6 A1
  629. SA6 ILOC
  630. CALL S=TDATE,ITEMP READ TIME/DATE
  631. SA1 ITEMP
  632. SA2 ILOC
  633. BX6 X1
  634. SA6 X2 STORE TIME
  635. EQ PROCESS --- RETURN
  636. TITLE -DAY- COMMAND
  637. *
  638. *
  639. * -DAY-
  640. *
  641. *
  642. * DAY RETURNS THE NUMBER OF ELAPSED DAYS
  643. * FROM JAN. 1, 1973'; 2400 HOURS DEC 31,1972
  644. * MARKS THE BEGINNING OF DAY 0.
  645. *
  646. * THE NUMBER OF ELAPSED DAYS + FRACTIONAL DAYS
  647. * IS STORED IN THE ADDRESS PROVIDED BY THE CALL.
  648. *
  649. *
  650. *
  651. DAYX CALL JULIAN GET JULIAN DATE TO X6
  652. FPUTVAR STORE WHERE NEEDED, IN REQUIRED TYPE (I/F)
  653. EQ PROCESS
  654. *
  655. *
  656. *
  657. * -JULIAN-
  658. * RETURNS JULIAN DATE IN X6 (FLOATING)
  659. *
  660. * USES A - 2, 3, 4.
  661. * X - 2, 3, 4, 6.
  662. *
  663. *
  664. ENTRY JULIAN
  665. JULIAN EQ *
  666. SA2 MSCLCK0 *SYSCLOCK* VALUE AT LOAD TIME
  667. SA4 SYSCLOK GET MS CLOCK
  668. MX3 24D
  669. BX4 -X3*X4 MASK CLOCK TO 36 BIT INTEGER
  670. IX4 X4-X2
  671. PX4 X4 FLOAT
  672. NX4 X4 AND NORMALIZE
  673. SA2 MSPDAY
  674. SA3 DAY0 *DAY* AS CALCULATED AT LOADTIME
  675. FX4 X4/X2 MS TO DAYS
  676. FX6 X4+X3 UPDATE (DAY)
  677. EQ JULIAN
  678. *
  679. *
  680. MSPDAY DATA 86400000. MILLISECONDS PER DAY
  681. * /--- BLOCK PLAY 00 000 84/01/09 16.55
  682. TITLE -PLAY- -RECORD-
  683. * -PLAY- (CODE=140)
  684. *
  685. * PLAYS AUDIO MESSAGE STARTING AT TRACK/SECTOR
  686. * GIVEN BY 3D TAG FIELD
  687. *
  688. PLAYX SX6 3 DECODE 3 TAGFIELDS
  689. RJ GETN GET VALUES IN VARBUF(N-1)
  690. SX3 40000B PLAYBACK CODE
  691. PLAYX2 SA1 VARBUF GET STARTING TRACK AND
  692. SA2 VARBUF+1 SECTOR NUMBER INTO X1,X2
  693. MX0 55
  694. BX2 -X0*X2 MAKESURE ONLY 5BIT SECTOR
  695. MX0 53
  696. BX1 -X0*X1 AND 7BIT TRACK FIELD
  697. LX1 5 SHIFT TRACK PAST SECTOR
  698. BX1 X1+X2 COMBINE TRACK,SECTOR, AND
  699. BX1 X1+X3 CODE INTO X1
  700. OUTCODE AUDCODE SEND OUT AUDIO START WORD
  701. SA1 VARBUF+2 GET LENGTH TAG
  702. MX0 46 ALLOW BOTTOM 14 BITS IN SECOND WORD
  703. BX1 -X0*X1
  704. SX0 1 AND KILL BIT 8 FOR SOME NEW AUDIOS
  705. LX0 7
  706. BX1 -X0*X1
  707. OUTCODE AUDCODE SEND OUT AUDIO LENGTH WORD
  708. EQ PROCESS
  709. *
  710. *
  711. *
  712. * -RECORD- (CODE=141)
  713. *
  714. * RECORDS AUDIO MESSAGE AT STARTING TRACK/SECTOR
  715. *
  716. MIKEX SX6 3 DECODE 3 TAGFIELDS
  717. RJ GETN GET VALUES IN VARBUF(N-1)
  718. SX3 60000B RECORD CODE
  719. EQ PLAYX2 SEND AUDIO START+LENGTH WORD
  720. * /--- BLOCK ENABLE 00 000 77/11/11 00.16
  721. TITLE -ENABLE- -DISABLE-
  722. *
  723. *
  724. *
  725. * -ENABLE- AND -DISABLE- COMMANDS
  726. *
  727. ENABLEX MX6 3 CHOOSE ENABLE FUNCTION BITS
  728. BX1 X5*X6
  729. ZR X1,ENA100 JUMP IF NEITHER TOUCH/EXT
  730. PL X1,ENA050 -- IF NOT -ORIENTAL-
  731. SA2 STFLAGS
  732. LX2 60-ORIBIT MOVE ORIENTAL MODULE TO SIGN
  733. PL X2,PROC -- IGNORE IF SHOULDN'7T ENABLE
  734. ENA050 LX1 ENABLO-24 POSITION BITS IN *ENABLBS*
  735. OUTCODE SETCODE
  736. *
  737. ENA100 SA5 A5
  738. LX5 3 MOVE *EXTMAP* BIT TO SIGN
  739. PL X5,PROC EXIT IF *EXTMAP* NOT SELECTED
  740. MX6 1
  741. LX6 EXTMBIT POSITION *EXTMAP* BIT
  742. SA1 STFLAG1
  743. BX6 X1+X6 SET BIT IN /STATION/ WORD
  744. SA6 A1
  745. EQ PROC
  746. *
  747. *
  748. DISABLX MX6 3 CHOOSE DISABLE FUNCTION BITS
  749. BX1 X5*X6
  750. ZR X1,DISA100 JUMP IF NEITHER TOUCH/EXT
  751. LX1 ENABLO-24 POSITION BITS IN *ENABLBS*
  752. OUTCODE CLRCODE
  753. *
  754. DISA100 SA5 A5
  755. LX5 3 MOVE *EXTMAP* BIT TO SIGN
  756. PL X5,PROC EXIT IF *EXTMAP* NOT SELECTED
  757. MX6 1
  758. LX6 EXTMBIT POSITION *EXTMAP* BIT
  759. SA1 STFLAG1
  760. BX6 -X6*X1 CLEAR BIT IN /STATION/ WORD
  761. SA6 A1
  762. EQ PROC
  763. *
  764. * /--- BLOCK DELAY 00 000 78/04/25 20.18
  765. TITLE DELAY
  766. * -DELAY- (CODE=181)
  767. *
  768. * SENDS NUMBER OF NO-OP CODES REQUIRED TO MAKE UP
  769. * SPECIFIED DELAY TIME
  770. *
  771. *
  772. DELAYX FGETVAR DELAY IN SECONDS
  773. BX6 X1 SAVE THE ARG FOR EXECERR
  774. SA6 DLYSAVE
  775. SA2 =57.1429 TERMINAL WORDS / SECOND
  776. FX1 X1*X2 COMPUTE NUMBER NO-OPS REQUIRED
  777. SA2 =.5
  778. FX1 X1+X2 ROUND
  779. NX1 X1
  780. UX1 X1,B1
  781. LX1 X1,B1
  782. NG X1,DERXVAL --- ERROR EXIT IF COUNT IS NEGATIVE
  783. *** NOTE'; IF YOU CHANGE THE TIME LIMIT, YOU MUST CHANGE
  784. *** THE EXECUTION ERROR MESSAGE
  785. SX2 64 SLIGHTLY OVER 1 SECOND
  786. IX2 X1-X2
  787. PL X2,DLERXLNG --- LONG DELAYS ARE ILLEGAL
  788. SA2 DELAYED
  789. IX6 X1+X2 ACCUMULATE DELAY
  790. SA6 A2
  791. OUTCODE NOPCODE
  792. SA1 DELAYED
  793. SX2 X1-228 SEE IF FOUR SECONDS OR MORE
  794. NG X2,PROCO
  795. EQ RETRNX WAIT FOR OUTPUT TO FINISH
  796. *
  797. *
  798. ENTRY DELAYED
  799. DELAYED BSS 1 TOTAL DELAY THIS TIME-SLICE
  800. *
  801. DLYSAVE BSS 1 FOR EXECUTION ERRORS
  802. *
  803. DLERXLNG SA1 DLYSAVE
  804. EXECERR 94 DELAY TOO LONG
  805. *
  806. DERXVAL SA1 DLYSAVE
  807. EQ ERXFVAL DELAY TOO SHORT
  808. * /--- BLOCK ALTFONT 00 000 84/01/09 16.57
  809. TITLE -ALTFONT-
  810. *
  811. *
  812. *
  813. * -ALTFONT- (CODE=201)
  814. *
  815. * SETS *CSET* SO ALL FOLLOWING WRITING OCCURS
  816. * FROM ALTERNATE FONT (1) OR NORMAL FONT (0).
  817. *
  818. *
  819. ENTRY AFONTX
  820. *
  821. AFONTX NGETVAR
  822. SX0 1
  823. LX0 3+7+18 FORM ALTFONT BIT FOR SIZE WRITE
  824. SA2 TBWRITE
  825. NZ X1,AF100 JUMP IF -ALTFONT ON-
  826. BX6 -X0*X2 CLEAR ALTFONT BIT
  827. EQ AF200
  828. *
  829. AF100 BX6 X0+X2 SET ALTFONT BIT
  830. AF200 SA6 A2
  831. OUTCODE AMSCODE 0=NORMAL, 1=ALTERNATE
  832. EQ PROC
  833. *
  834. *
  835. * /--- BLOCK CODE 00 000 85/01/31 13.30
  836. TITLE -CODE- AND -CHECK-
  837. *
  838. * -CODE- COMMAND
  839. *
  840. CODEX NGETVAR
  841. BX6 X1
  842. SA6 TAUCODE SAVE FOR REST OF SESSION
  843. EQ PROC
  844. *
  845. * /--- BLOCK CHECK 00 000 81/06/15 23.03
  846. *
  847. * CHECK COMMAND
  848. *
  849. * CHECK (BLANK) RETURNS A VALUE OF -1 TO X
  850. * IN *ERROR* DEPENDING ON THE GROUP OF THE USER.
  851. * *ZRETURN* IS SET THE SAME AS *ERROR*.
  852. *
  853. * CHECK (ARG) RETURNS -1 IN *ERROR* IF THE USERS
  854. * CODEWORD, GROUP, OR ACCOUNT AGREES WITH THE
  855. * ARGUMENT; *ZRETURN* IS SET TO -1 ALSO.
  856. * IF THERE IS NO AGREEMENT, A LIST OF SPECIAL
  857. * STATIONS IS SEARCHED. IF THIS STATION IS FOUND
  858. * IN THE LIST, *ZRETURN* IS SET TO 0 AND *ERROR*
  859. * IS SET AS IN THE NO ARGUMENT CASE. IF THE STATION
  860. * IS NOT FOUND, *ZRETURN* IS 0 AND *ERROR* IS 100.
  861. *
  862. *
  863. CHECKX NG X5,CKNOARG BRANCH IF NO ARGUMENT
  864. NGETVAR
  865. *
  866. RJ CHECODE CODE IS IN X1
  867. ZR X6,CHECK3 IF NO MATCH
  868. *
  869. SX6 -1
  870. SA6 TERROR
  871. SA6 TRETURN
  872. EQ PROC
  873. *
  874. *
  875. * IF NO MATCH, SEE IF AT A SPECIAL STATION.
  876. * ZSSLST IS START OF SPECIAL STATIONS BIT TABLE IN ECS
  877. * ONE SITE PER WORD, MSB = STATION ZERO.
  878. *
  879. CHECK3 MX6 0
  880. SA6 TRETURN SET ZRETURN 0
  881. *
  882. SA1 STATION
  883. SX2 X1-LSTUD
  884. ZR X2,CKSCHK CONSOLE IS ALWAYS SPECIAL
  885. MX2 -5
  886. BX2 -X2*X1 GET STATION IN X2
  887. AX1 5 AND SITE IN X1
  888. SA3 AZSSLST START OF BIT TABLE IN ECS
  889. IX0 X3+X1
  890. RX3 X0 (-RXX- 1 WD READ, MAY CHG *A3*)
  891. SX6 100 ASSUME NOT SPECIAL
  892. SB2 X2 STATION NUMBER
  893. LX3 X3,B2
  894. PL X3,CKSCHK2 NOPE, RETURN *ERROR* = 100
  895. CKSCHK CALL SYSCOR ELSE CHECK FOR SYSTEM GROUP
  896. CKSCHK2 SA6 TERROR ZRETURN ALREADY SET TO 0
  897. EQ PROC
  898. *
  899. * BLANK-TAG -CHECK-
  900. * -- LOOK FOR SYSTEM GROUP
  901. *
  902. CKNOARG CALL SYSCOR CHECK FOR SPECIAL GROUP
  903. SA6 TERROR
  904. SA6 TRETURN
  905. EQ PROC
  906. *
  907. * /--- BLOCK CHECODE 00 000 79/04/07 00.40
  908. TITLE CHECK EDITING CODE
  909. *
  910. ** ROUTINE CHECODE
  911. *
  912. * CHECKS CODE IN X1 AGAINST AUTHORS EDITING CODE,
  913. * HIS GROUP, AND ACCOUNT.
  914. *
  915. * ON EXIT --
  916. * X6 = -1 IF MATCH
  917. * 0 IF NO MATCH
  918. *
  919. * 'USES X0,X1,X2,X3,X6;A0,A2,A3
  920. *
  921. ENTRY CHECODE
  922. *
  923. CHECODE EQ *
  924. ZR X1,CKX1 BRANCH IF BLANK CODE
  925. SA2 TAUCODE PICK UP AUTHORS EDITING CODE
  926. MX6 6
  927. BX6 X6*X2
  928. ZR X6,CKX2 DON'7T ALLOW LEADING ZERO CODES
  929. BX3 X1-X2
  930. NZ X3,CKX2
  931. NG X3,CKX2 CATCH COMPLEMENT CASE
  932. *
  933. CKX1 SX6 -1 MATCH
  934. EQ CHECODE
  935. *
  936. CKX2 RJ CHEKGRP CHECK FOR GROUP CODEWORD
  937. EQ CHECODE
  938. *
  939. *
  940. *
  941. * CHEKGRP
  942. *
  943. * 'THIS ROUTINE CHECKS THE CODEWORD SPECIFIED
  944. * TO SEE IF IT IS AN ACCEPTABLE GROUP CODEWORD--
  945. * GROUP OR ACCOUNT OF USER (THE ACCOUNT NAME IS
  946. * RIGHT SHIFTED 18 BITS, THE GROUP NAME 12 BITS).
  947. *
  948. * 'ON ENTRY --
  949. * X1 = CODEWORD
  950. *
  951. * 'ON EXIT --
  952. * X6 = -1 IF MATCH
  953. * 0 IF NO MATCH
  954. *
  955. * 'USES X0,X1,X2,X3,X6;A0,A2,A3 (X4 ASSUMED NOT USED)
  956. *
  957. *
  958. ENTRY CHEKGRP
  959. *
  960. CHEKGRP EQ *
  961. SX6 0 PRESET TO NO MATCH
  962. MX0 6
  963. BX2 X0*X1 CHECK TOP CHAR OF CODE
  964. NZ X2,CHEKGRP --- MUST BE 0 IF GROUP CODEWORD
  965. LX1 12 SEE IF GROUP
  966. BX2 X0*X1 MASK TOP CHAR
  967. ZR X2,CHKACC IF ZERO, MAYBE ACCOUNT NAME
  968. SA3 STATION GET GROUP OF USER
  969. SA2 AGROUP
  970. IX0 X3+X2
  971. RX3 X0 (-RXX- 1 WD READ, MAY CHG *A3*)
  972. MX0 -12
  973. BX2 X0*X3 MASK TO GET JUST GROUP NAME
  974. BX2 X2-X1 COMPARE WITH (SHIFTED) CODEWORD
  975. NZ X2,CHEKGRP --- EXIT IF NO MATCH
  976. CHKOK SX6 -1 MARK OK
  977. EQ CHEKGRP --- EXIT
  978. *
  979. CHKACC SA3 TACCNAM PICK UP ACCOUNT NAME OF USER
  980. LX1 6 TOTAL SHIFT NOW = 18
  981. BX2 X3-X1
  982. ZR X2,CHKOK
  983. EQ CHEKGRP --- EXIT IF NO MATCH
  984. * /--- BLOCK SYSCOR 00 000 78/11/14 08.10
  985. TITLE -SYSCOR- CHECK FOR SPECIAL GROUP
  986. *
  987. *
  988. *
  989. ENTRY SYSCOR
  990. SYSCOR EQ *
  991. SA1 STATION
  992. SA2 AGROUP
  993. IX0 X1+X2
  994. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  995. SB1 1
  996. MX2 -12
  997. BX6 X1*X2
  998. ZR X6,CKCON IF NO GROUP, CHECK FOR CONSOLE
  999. SA6 CHKFIND PLANT USER GROUP AS LAST ENTRY
  1000. SA2 CKTYPE-1
  1001. CKLL SA2 A2+B1
  1002. BX3 X6-X2
  1003. NZ X3,CKLL
  1004. SB1 A2
  1005. SB2 CKTYPE+1
  1006. SX6 B1-B2
  1007. EQ SYSCOR
  1008. *
  1009. CKCON SA1 STATION CHECK FOR CONSOLE
  1010. SX2 X1-LSTUD
  1011. NZ X2,CKNOTC NOT THE CONSOLE
  1012.  
  1013. *
  1014. * * * SET CONSOLE PRIVILEDGES
  1015. SX6 -1 GROUP S FOR DEVELOPMENT SYSTEMS
  1016. SA2 DEVSYS GET *DEVSYS*
  1017. NZ X2,SYSCOR IF DEV SYSTEM, RETURN
  1018. SX6 1 GROUP O FOR NON-DEV SYSTEMS
  1019. EQ SYSCOR RETURN
  1020.  
  1021. *
  1022. CKNOTC SX6 CKLAST-CKTYPE-1 HIGHER THAN ANY SYS GROUP
  1023. EQ SYSCOR
  1024. *
  1025. *
  1026. CKTYPE DATA 1LS
  1027. DATA 1LP
  1028. DATA 1LO
  1029. DATA 1LM
  1030. DATA 6LCOSERV
  1031. DATA 1RX $$ WAS ETSC
  1032. DATA 3LPSO PRODUCT SERVICE ORGANIZATION
  1033. CHKFIND CON 0 REQUIRED TO END SEARCH LOOP
  1034. *
  1035. CKLAST EQU CKTYPE+7 (CKTYPE + NUMBER ENTRIES)
  1036. *
  1037. * /--- BLOCK NAME AND C 00 000 79/10/04 03.52
  1038. TITLE -NAME- AND -GROUP- COMMANDS
  1039. * THE NAME IS 18 CHARS + 12 BITS OF DISK BLOCK
  1040. NAMEX NGETVAR A1=STARTING STORAGE ADDRESS
  1041. SA2 TNAME
  1042. BX6 X2
  1043. SA6 A1
  1044. SA3 TNAME1
  1045. MX7 48
  1046. BX7 X7*X3 MASK TO 8 CHARACTERS
  1047. SA0 A1
  1048. SX1 2
  1049. RJ BOUNDS SEE THE 2ND WORD IN BOUNDS
  1050. SA7 A1+1
  1051. EQ PROC
  1052. *
  1053. * THE GROUP IS 8 CHARS NAME PLUS 12 BITS OF FLAGS
  1054. *
  1055. GROUPX NGETVAR
  1056. SA2 AGROUP ECS ADDRESS OF GROUP BUFFER
  1057. SA3 STATION ADD BIAS OF THIS STATION
  1058. IX0 X2+X3
  1059. SA0 A1
  1060. + RE 1 READ GROUP ENTRY INTO USERS WORD
  1061. RJ ECSPRTY
  1062. SA1 A1
  1063. MX7 48
  1064. BX7 X7*X1 MASK TO 8 CHARACTERS
  1065. SA7 A1
  1066. EQ PROC
  1067. * /--- BLOCK MODESET 00 000 78/10/27 09.31
  1068. TITLE MODESET AND BITSOUT
  1069. * -MODESET- (CODE=241)
  1070. *
  1071. * OUTPUTS SPECIFIED MODE (0-7). INTENDED TO
  1072. * PERMIT INVESTIGATION OF NEW MODES VIA PDP-11
  1073. * SIMULATED TERMINAL.
  1074. *
  1075. *
  1076. ENTRY MODESEX
  1077. *
  1078. MODESEX NGETVAR
  1079. OUTCODE MODCODE
  1080. CALL ASMBIT SET ASSEMBLY PROGRAM BIT
  1081. EQ PROC
  1082. *
  1083. *
  1084. *
  1085. * -BITSOUT- (CODE=249)
  1086. *
  1087. * OUTPUTS AN 18 BIT DATA WORD. USEFUL ONLY
  1088. * IN TESTING NEW MODES (4-7), DATA IS NOT SENT
  1089. * IF IN A STANDARD MODE (0-3).
  1090. *
  1091. *
  1092. ENTRY BITSOUX
  1093. *
  1094. BITSOUX NGETVAR
  1095. OUTCODE BITCODE
  1096. EQ PROC
  1097. *
  1098. *****
  1099. *
  1100. TITLE ASCII
  1101. *
  1102. * -ASCII-
  1103. *
  1104. * OUTPUTS AN ASCII CHARACTER. USEFUL ONLY
  1105. * ON ASCII TERMINALS.
  1106. *
  1107. ENTRY ASCIIX
  1108.  
  1109. ASCIIX BSS 0
  1110. SA1 STFLAG1 GET TERM TYPE WORD
  1111. MX0 -TTBTN SET MASK FOR TERM TYPE FIELD
  1112. LX1 TTBTN-TTBTS POSITION TERM TYPE FIELD
  1113. BX0 -X0*X1 GET TERM TYPE
  1114. SX0 X0-ASCTYPE SEE IF ASCII TERM (ZTTTYPE=12)
  1115. NZ X0,PROC NOT ASCII TERM, DO NOT EXECUTE
  1116. *
  1117. ASEND BSS 0
  1118. NGETVAR GET BYTE TO BE SENT
  1119. OUTCODE ASCCODE
  1120. EQ PROC
  1121. *
  1122. * /--- BLOCK -SYSLESS 00 000 80/07/02 10.13
  1123. TITLE SYSLESS
  1124. *
  1125. * -SYSLESS- (CODE=288)
  1126. * ONE ARGUMENT = LESSON TO BE CHECKED
  1127. *
  1128. * RETURNS ERROR = -1 IF A SYSTEM LESSON
  1129. * 0 IF NOT
  1130. *
  1131. SYSLESX SX6 2
  1132. CALL GETCODX UNPACK GETVAR CODES TO VARBUF
  1133. CALL ACCFILE,VARBUF,VARBUF,0
  1134. CALL PROSRCH,VARBUF
  1135. LX2 ZSLDSHF GET SYSTEM LESSON BIT
  1136. MX6 0
  1137. PL X2,SYSLEXT 0 = NON-SYSTEM LESSON
  1138. SX6 -1 -1 = SYSTEM LESSON
  1139. SYSLEXT SA6 TERROR
  1140. SA6 TRETURN
  1141. EQ PROC
  1142. *
  1143. *
  1144. * /--- BLOCK SYSTEST 00 000 85/01/31 13.30
  1145. TITLE SYSTEM LESSON LIST SEARCHES
  1146. *
  1147. * SYSTEST
  1148. *
  1149. * RETURNS X6 = -1 FOR SYSTEM LESSON
  1150. * 0 FOR NON-SYSTEM
  1151. * ALSO RETURNS X2 = LESSON DESCRIPTOR BITS
  1152. *
  1153. *
  1154. ENTRY SYSTEST
  1155. *
  1156. SYSTEST EQ *
  1157. CALL PROSRCH,TBLESAC
  1158. LX2 ZSLDSHF GET SYSTEM LESSON BIT
  1159. NG X2,SYST1 IF YES
  1160. LX2 -ZSLDSHF RESTORE BITS
  1161. MX6 0
  1162. EQ SYSTEST
  1163. *
  1164. SYST1 SX6 -1 -1 = SYSTEM LESSON
  1165. LX2 -ZSLDSHF RESTORE BITS
  1166. EQ SYSTEST
  1167. *
  1168. *
  1169. * /--- BLOCK AIDSLES 00 000 81/01/23 13.51
  1170. *
  1171. * CHECK TO SEE IF CURRENT LESSON IS AN AIDS LESSON.
  1172. *
  1173. * THE FILE NAME OF ALL AIDS LESSONS BEGINS WITH
  1174. * THE LETTER -A- FOLLOWED BY A DIGIT (0-9).
  1175. *
  1176. * EXIT (X1) NEGATIVE IF AIDS LESSON
  1177. * POSITIVE IF NOT
  1178. *
  1179. * USES A - 1
  1180. * X - 1, 2
  1181.  
  1182. ENTRY AIDSLES
  1183.  
  1184. AIDSLES EQ *
  1185. SA1 TBLESAC (X1) = ACCOUNT OF CURRENT LESSON
  1186. LX1 42 SHIFT TO OLD-STYLE FLAG
  1187. PL X1,AIDSLES IF NOT OLD-STYLE
  1188. SA1 TBLESSN (X1) = CURRENT LESSON NAME
  1189. SX2 7777B
  1190. LX1 12 POSITION 1ST 2 CHARS AT BOTTOM
  1191. BX2 X2*X1 (X2) = FIRST 2 CHARACTERS
  1192. SX1 X2-2RA+ SEE IF GREATER THAN -A9-
  1193. PL X1,AIDSLES IF SO, NOT AN AIDS LESSON
  1194. SX1 X2-2RA0 SEE IF -A0- OR GREATER
  1195. BX1 -X1
  1196. EQ AIDSLES
  1197. *
  1198. *
  1199. * /--- BLOCK STOPCHK 00 000 81/12/05 05.02
  1200. EJECT
  1201. ** STOPCHK - CHECK FOR SPECIAL STOP1 PROCESSING
  1202. *
  1203. * THIS ROUTINE CHECKS TO SEE IF THE LESSON
  1204. * SPECIFIED BY *TBLESSN* IS ONE OF THE SPECIAL
  1205. * SYSTEM LESSONS THAT DOES ITS OWN STOP1 KEY
  1206. * PROCESSING.
  1207. *
  1208. * IF PST1BIT IN STFLAG1 IS SET INDICATING A PRIORITY
  1209. * STOP1, THEN STOP1 PROTECTION FOR THE LESSON IS
  1210. * OVERRIDDEN (EXCEPT FOR LESSON SYSLIB).
  1211. *
  1212. * THE ST1BIT IN STFLAGS IS CLEARED IF THIS LESSON
  1213. * IS A SPECIAL STOP1 LESSON.
  1214. *
  1215. * EXIT (X2) = 0 IF SPECIAL, NON-ZERO OTHERWISE.
  1216. *
  1217. * USES A - 2.
  1218. * B - NONE.
  1219. * X - 2.
  1220. *
  1221. * OTHER REGISTERS ARE USED BUT RESTORED.
  1222. *
  1223. * CALLS PROSRCH, SAVE0167, REST0167.
  1224. *
  1225. * MACROS NONE.
  1226.  
  1227.  
  1228. ENTRY STOPCHK
  1229.  
  1230. STOPCHK EQ *
  1231.  
  1232. RJ SAVE0167 SAVE REGISTERS
  1233. SA0 B1 SAVE ORIGINAL (B1)
  1234. SB1 TBLESAC
  1235. RJ PROSRCH
  1236. SB1 A0 RESTORE (B1)
  1237. ZR X2,NOSTOP IF LESSON NOT FOUND
  1238. LX2 ZPLDSHF
  1239. PL X2,NOSTOP
  1240.  
  1241. SA2 STFLAG1
  1242. LX2 60-PST1BIT CHECK FOR PRIORITY STOP1
  1243. PL X2,STOPC2 JUMP IF NO SPECIAL PRIORITY
  1244. CALL LIBTEST,TBLESAC
  1245. PL X6,NOSTOP -- IF NOT IN SYSLIB LESSON
  1246.  
  1247. STOPC2 SA1 STFLAGS CLEAR ST1BIT SINCE THIS IS A
  1248. MX6 1 STOP1 INHIBITED LESSON
  1249. LX6 ST1BIT
  1250. BX6 -X6*X1
  1251. SA6 A1
  1252.  
  1253. RJ REST0167 RESTORE REGISTERS
  1254. MX2 0 STOP1 OK
  1255. EQ STOPCHK
  1256.  
  1257. NOSTOP RJ REST0167 RESTORE REGISTERS
  1258. MX2 59
  1259. EQ STOPCHK
  1260. * /--- BLOCK SYSLES 00 000 81/12/05 05.03
  1261. EJECT
  1262. ** SYSLES - CHECK FOR NON-DELETABLE SYSTEM LESSONS
  1263. *
  1264. * THIS ROUTINE SEARCHES THE PROTECTED LESSON TABLE
  1265. * FOR A LESSON AND CHECKS TO SEE IF IT IS A SYSTEM
  1266. * LESSON WITH DELETION PROTECTION.
  1267. *
  1268. * ENTRY (B1) = ADDR OF 2-WORD LESSON NAME TO CHECK.
  1269. *
  1270. * EXIT (X3) = 0 IF LESSON IS NOT A SYSTEM LESSON,
  1271. * OR IS A SYSTEM LESSON WITH NO
  1272. * DELETION PROTECTION.
  1273. * = 1 IF LESSON IS NEVER TO BE DELETED
  1274. * (HAS *D1* ATTRIBUTE).
  1275. * = 2 IF LESSON CANNOT BE DELETED WHILE
  1276. * IN USE (HAS *D2* ATTRIBUTE).
  1277. * = 3 IF LESSON HAS *D3* ATTRIBUTE, AND
  1278. * *SYSDL* = *ON*.
  1279. *
  1280. * USES A - 2, 3.
  1281. * B - NONE.
  1282. * X - 2, 3.
  1283. *
  1284. * OTHER REGISTERS ARE USED BUT RESTORED.
  1285. *
  1286. * CALLS PROSRCH, REST0167, SAVE0167.
  1287. *
  1288. * MACROS NONE.
  1289.  
  1290.  
  1291. ENTRY SYSLES
  1292.  
  1293. SYSLES EQ *
  1294.  
  1295. RJ SAVE0167 SAVE REGISTERS
  1296. RJ PROSRCH SEARCH SYSTEM LESSON LIST
  1297. ZR X2,NOSYSL IF LESSON NOT FOUND
  1298. SX3 X2 (X3) = TYPE CODE
  1299. SX7 SYSDL (X7) = 0 IF OFF
  1300. ZR X7,SYS20 IF *SYSDL* = *OFF*
  1301. LX2 ZD3SHF (X2) = 1/*D3* BIT, 59/OTHER
  1302. PL X2,SYS20 IF NO *D3* ATTRIBUTE
  1303. SX3 3 INDICATE *D3* ACTIVE
  1304. *
  1305. SYS20 RJ REST0167 RESTORE REGISTERS
  1306. EQ SYSLES RETURN
  1307. *
  1308. NOSYSL RJ REST0167
  1309. SX3 0 (X3) = 0 = DELETABLE
  1310. EQ SYSLES
  1311. * /--- BLOCK SYSLES1 00 000 78/11/12 21.30
  1312. EJECT
  1313. ** SYSLES1 - CHECK DELETION PROTECTION AND ECS CHARGE
  1314. *
  1315. * THIS ROUTINES SEARCHES THE SYSTEM LESSON LIST AND
  1316. * RETURNS INFO ABOUT THE ECS CHARGE FOR A SYSTEM
  1317. * LESSON AND WHETHER OR NOT IT CAN BE DELETED.
  1318. *
  1319. * ENTRY (B1) = ADDRESS OF 2-WORD LESSON NAME.
  1320. *
  1321. * EXIT (X2) = 0 IF LESSON IS NOT A SYSTEM LESSON,
  1322. * OR IS A SYSTEM LESSON WITH NO
  1323. * DELETION PROTECTION.
  1324. * = 1 IF LESSON IS NEVER TO BE DELETED
  1325. * (HAS *D1* ATTRIBUTE).
  1326. * = 2 IF LESSON CANNOT BE DELETED WHILE
  1327. * IN USE (HAS *D2* ATTRIBUTE).
  1328. * = 3 IF LESSON HAS *D3* ATTRIBUTE, AND
  1329. * *SYSDL* = *ON*.
  1330. * (X3) = ECS CHARGE.
  1331. *
  1332. * USES A - 2, 3.
  1333. * B - NONE.
  1334. * X - 2, 3.
  1335. *
  1336. * OTHER REGISTERS ARE USED BUT RESTORED.
  1337. *
  1338. * CALLS PROSRCH, REST0167, SAVE0167.
  1339. *
  1340. * MACROS NONE.
  1341.  
  1342.  
  1343. ENTRY SYSLES1
  1344.  
  1345. SYSLES1 EQ *
  1346.  
  1347. RJ SAVE0167 SAVE REGISTERS
  1348. RJ PROSRCH SEARCH SYSTEM LESSON LIST
  1349. ZR X2,NOSYSL1 IF LESSON NOT FOUND
  1350. BX3 X2 SAVE OVER CALL TO *REST0167*
  1351. SX7 SYSDL (X7) = 0 IF OFF
  1352. ZR X7,SYSL20 IF *SYSDL* = *OFF*
  1353. LX2 ZD3SHF (X2) = 1/*D3* BIT, 59/OTHER
  1354. PL X2,SYSL20 IF NO *D3* ATTRIBUTE
  1355. MX0 -18 CLEAR DELETE PROTECT FIELD
  1356. BX7 X0*X3 (X7) = 42/FLAGS, ETC., 18/0
  1357. SX3 3
  1358. BX3 X3+X7 (X3) = 42/FLAGS, ETC., 18/3
  1359. *
  1360. SYSL20 RJ REST0167 RESTORE REGISTERS
  1361. SX2 X3 (X2) = PROTECTION TYPE
  1362. AX3 18
  1363. SX3 X3 (X3) = ECS CHARGE
  1364. EQ SYSLES1
  1365.  
  1366. NOSYSL1 RJ REST0167 RESTORE REGISTERS
  1367. MX2 0 (X0) = NO PROTECTION
  1368. MX3 -1 (X3) = NORMAL ECS CHARGE
  1369. EQ SYSLES1
  1370.  
  1371. * /--- BLOCK /SAVEREG/ 00 000 81/12/05 05.04
  1372. EJECT
  1373. QUAL SAVEREG
  1374. *
  1375. ** SAVE0167 - SAVE A0, A1, A6, A7, X0, X1, X6, X7
  1376. *
  1377. * THIS ROUTINE SAVES SEVERAL REGISTERS THAT WERE
  1378. * FORMERLY UNUSED IN ROUTINES WHICH DID A SEQUENTIAL
  1379. * SEARCH OF THE PROTECTED LESSON TABLE WHEN IT WAS
  1380. * CM-RESIDENT.
  1381. *
  1382. * ENTRY NONE.
  1383. *
  1384. * EXIT A0, A1, A6, A7, X0, X1, X6, X7 ARE SAVED.
  1385. *
  1386. * USES A - 2, 6, 7.
  1387. * B - NONE.
  1388. * X - 2, 6, 7.
  1389. *
  1390. * CALLS NONE.
  1391. *
  1392. * MACROS NONE.
  1393.  
  1394.  
  1395. SAVE0167 EQ *+400000B
  1396.  
  1397. SA2 A6 PRESERVE (A6) AND ((A6))
  1398. SA6 SAVE.X6 SAVE (X6)
  1399. SX6 A2
  1400. SA6 SAVE.A6 SAVE (A6)
  1401. BX6 X2
  1402. SA6 SAVE.A6X SAVE ((A6))
  1403. SA2 A7 PRESERVE (A7) AND ((A7))
  1404. SA7 SAVE.X7 SAVE (X7)
  1405. SX7 A2
  1406. SA7 SAVE.A7 SAVE (A7)
  1407. BX7 X2
  1408. SA7 SAVE.A7X SAVE ((A7))
  1409. SX6 A0
  1410. BX7 X0
  1411. SA6 SAVE.A0 SAVE (A0)
  1412. SA7 SAVE.X0 SAVE (X0)
  1413. SX6 A1
  1414. BX7 X1
  1415. SA6 SAVE.A1 SAVE (A1)
  1416. SA7 SAVE.X1 SAVE (X1)
  1417.  
  1418. EQ SAVE0167
  1419. * /--- BLOCK /SAVEREG/ 00 000 81/12/05 05.04
  1420. REST0167 SPACE 5,20
  1421. ** REST0167 - RESTORE A0, A1, A6, A7, X0, X1, X6, X7
  1422. *
  1423. * THIS ROUTINE RESTORES SEVERAL REGISTERS THAT WERE
  1424. * FORMERLY UNUSED IN ROUTINES WHICH DID A SEQUENTIAL
  1425. * SEARCH OF THE PROTECTED LESSON TABLE WHEN IT WAS
  1426. * CM-RESIDENT.
  1427. *
  1428. * ENTRY NONE.
  1429. *
  1430. * EXIT A0, A1, A6, A7, X0, X1, X6, X7 RESTORED.
  1431. *
  1432. * USES A - 0, 1, 2, 6, 7.
  1433. * B - NONE.
  1434. * X - 0, 1, 2, 6, 7.
  1435. *
  1436. * CALLS NONE.
  1437. *
  1438. * MACROS NONE.
  1439.  
  1440.  
  1441. REST0167 EQ *+400000B
  1442.  
  1443. SA2 SAVE.X0
  1444. BX0 X2 RESTORE (X0)
  1445. SA2 SAVE.A0
  1446. SA0 X2+ RESTORE (A0)
  1447. SA2 SAVE.A1
  1448. SA1 X2 RESTORE (A1)
  1449. SA2 SAVE.X1
  1450. BX1 X2 RESTORE (X1)
  1451. SA2 SAVE.A6X
  1452. BX6 X2
  1453. SA2 SAVE.A6
  1454. SA6 X2 RESTORE (A6) AND ((A6))
  1455. SA2 SAVE.X6
  1456. BX6 X2 RESTORE (X6)
  1457. SA2 SAVE.A7X
  1458. BX7 X2
  1459. SA2 SAVE.A7
  1460. SA7 X2 RESTORE (A7) AND ((A7))
  1461. SA2 SAVE.X7
  1462. BX7 X2 RESTORE (X7)
  1463.  
  1464. EQ REST0167
  1465. * /--- BLOCK /SAVEREG/ 00 000 81/12/05 04.20
  1466.  
  1467. * DEFINE CELLS USED BY *SAVE067* AND *REST067*
  1468.  
  1469. SAVE.A0 BSS 1 FOR SAVING (A0)
  1470. SAVE.A1 BSS 1 FOR SAVING (A1)
  1471. SAVE.A6 BSS 1 FOR SAVING (A6)
  1472. SAVE.A7 BSS 1 FOR SAVING (A7)
  1473. SAVE.X0 BSS 1 FOR SAVING (X0)
  1474. SAVE.X1 BSS 1 FOR SAVING (X1)
  1475. SAVE.X6 BSS 1 FOR SAVING (X6)
  1476. SAVE.X7 BSS 1 FOR SAVING (X7)
  1477. SAVE.A6X BSS 1 FOR SAVING ((A6))
  1478. SAVE.A7X BSS 1 FOR SAVING ((A7))
  1479.  
  1480. QUAL *
  1481.  
  1482. SAVE0167 EQU /SAVEREG/SAVE0167
  1483. REST0167 EQU /SAVEREG/REST0167
  1484. * /--- BLOCK PROSRCH 00 000 79/01/16 14.05
  1485. EJECT
  1486. ** PROSRCH - SPECIAL SEARCH LESSON DESCRIPTOR TABLE
  1487. *
  1488. * THIS ROUTINE PERFORMS A BINARY CHOP SEARCH
  1489. * OF THE SPECIAL LESSON DESCRIPTOR TABLE.
  1490. *
  1491. * ENTRY (B1) = ADDR OF 2-WORD LESSON NAME TO CHECK.
  1492. *
  1493. * EXIT (X1) = NAME OF LESSON.
  1494. * (X2) = DESCRIPTOR WORD (0 IF NOT FOUND).
  1495. *
  1496. * USES A - 1, 2, 3.
  1497. * B - NONE.
  1498. * X - 0, 1, 2, 3, 4, 6, 7.
  1499. *
  1500. * OTHER REGISTERS ARE USED BUT RESTORED.
  1501. * (X0, A1/X1, A2/X2, X7 ARE NOT RESTORED)
  1502. *
  1503. * CALLS NONE.
  1504. *
  1505. * MACROS NONE.
  1506.  
  1507.  
  1508. ENTRY PROSRCH
  1509.  
  1510. PROSRCH EQ *+400000B
  1511.  
  1512. QUAL PROSRCH
  1513.  
  1514. SA1 A6 PRESERVE (A6) AND (CM VALUE)
  1515. SX6 A1
  1516. SA6 PROS.A6 SAVE (A6)
  1517. BX6 X1
  1518. SA6 PROS.X6X SAVE VALUE AT ADDR *A6*
  1519. BX6 X3
  1520. SA6 PROS.X3 SAVE (X3)
  1521. BX6 X4
  1522. SA6 PROS.X4 SAVE (X4)
  1523. SX6 A0
  1524. SA6 PROS.A0 SAVE (A0)
  1525. SX6 A3
  1526. SA6 PROS.A3 SAVE (A3)
  1527.  
  1528. SA1 B1+1 (X1) = LESSON NAME
  1529. BX6 X1 COPY TO *X6*
  1530. SA6 ORIGLSN SAVE ORIGINAL LESSON NAME
  1531.  
  1532. SA2 B1 (X2) = ACCOUNT NAME
  1533. LX2 42 SHIFT TO OLD-STYLE FLAG
  1534. PL X2,PROSZ IF NOT OLD-STYLE
  1535.  
  1536. SX6 1 LOOP COUNTER
  1537. SA6 SRCHCNT SAVE IT
  1538.  
  1539. MX4 60 CHECK ENTIRE WORD FOR LSN NAME
  1540.  
  1541. PROS0 SA2 SYSLST
  1542. BX6 X2 (X6) = EM ADDR OF TOP OF TABLE
  1543. SA2 SYLEND
  1544. BX7 X2 (X7) = EM ADDR OF END OF TABLE
  1545.  
  1546. PROS1 IX3 X7-X6 GET DIFFERENCE
  1547. AX3 2 TO DROP ONES BIT - 2 WORD CHOP
  1548. LX3 1
  1549. IX0 X6+X3 ADDRESS OF NEXT WORD
  1550. RX2 X0 (X2) = NEXT LESSON NAME
  1551. BX2 X4*X2 MASK OFF ANY UNNECESSARY CHARS
  1552. IX2 X2-X1 SEE IF THE SAME
  1553. NZ X2,PROS2 NO MATCH
  1554. SX2 1
  1555. IX0 X0+X2 (X0) = ADDR OF DESCRIPTOR WORD
  1556. RX2 X0 (X2) = DESCRIPTOR WORD
  1557. EQ PROS5 MATCH FOUND
  1558.  
  1559. PROS2 ZR X3,PROS4 RUN OUT OF WORDS
  1560. NG X2,PROS3 IF IN TOP HALF
  1561. BX7 X0 RESET BOTTOM
  1562. EQ PROS1
  1563.  
  1564. * /--- BLOCK PROSRCH 00 000 79/01/04 14.32
  1565. PROS3 BX6 X0 RESET TOP
  1566. EQ PROS1
  1567.  
  1568. PROS4 SX2 0 NO FIND
  1569. SA3 SRCHCNT SEE IF ANOTHER SEARCH NEEDED
  1570. ZR X3,PROS7 NO MORE SEARCHING
  1571. MX6 0 END SEARCH AFTER THIS LOOP
  1572. SA6 A3 SAVE IT
  1573. *
  1574. * * * CHECK TO SEE FILE STARTS WITH ',N',. IF SO,
  1575. * * * IT MAY BE AN ',N', VERSION FOR A SYSTEM LESSON
  1576. * * * (SYSTEM OR LOCAL). IF FILE STARTS WITH ',N',,
  1577. * * * SEE IF THERE IS AN ENTRY WITHOUT THE ',N',.
  1578. *
  1579. MX0 6 SET MASK FOR FIRST CHAR
  1580. BX6 X0*X1 MASK OFF 1ST CHAR
  1581. LX6 6 RIGHT JUSTIFY IT
  1582. SX6 X6-16B SEE IF EQUAL TO ',N',
  1583. NZ X6,PROS7 IF NOT ',N', FILE, END SEARCH
  1584. LX1 6 MOVE ',N', TO END OF WORD
  1585. MX4 54 SET MASK FOR 9 CHARS
  1586. BX1 X4*X1 MASK OFF THE ',N',
  1587. EQ PROS0
  1588.  
  1589. PROS5 SA3 SRCHCNT GET SEARCH COUNT
  1590. NZ X3,PROS7 FOUND ORIGINAL LSN, SAVE
  1591. BX3 X2 COPY TO *X3*
  1592. LX3 ZNVSHF POSITION BIT TO TOP
  1593. MX0 1 SET MASK TO TEST TOP BIT
  1594. BX6 X0*X3 SEE IF *NV* SET
  1595. NG X6,PROS5A IF SET, SET TO NVER SPECS
  1596. SA3 DEVSYS GET *DEVSYS* STATUS
  1597. ZR X3,PROSZ IF NOT DEV SYSTEM, ZERO
  1598. BX3 X2 COPY TO *X3*
  1599. LX3 ZSNVSHF POSITION BIT TO TOP
  1600. BX6 X0*X3 SEE IF *SYSNV* SET
  1601. ZR X6,PROSZ IF NOT SET, SET TO NO MATCH
  1602.  
  1603. PROS5A MX0 1 SET MASK TO ZERO *BIN* BIT
  1604. BX2 -X0*X2 KEEP EVERYTHING BUT *BIN* BIT
  1605. MX0 42 SET MASK TO ZERO *DEL* FIELD
  1606. BX2 X0*X2 ZERO LAST 18 BITS
  1607. SX3 2 SET *DEL* FIELD TO 2
  1608. IX2 X2+X3 STORE IT
  1609.  
  1610. BX7 X2 SAVE COPY OF *X2*
  1611. SA1 ORIGLSN GET ORIGINAL LESSON
  1612. SA2 NPLATO CHECK FOR LESSON -NPLATO-
  1613. IX3 X1-X2 SEE IF IT IS =NPLATO=
  1614. ZR X3,PROS6 HANDLE DIFFERENTLY
  1615.  
  1616. SX3 -1 SET EM CHARGE TO FULL CHARGE
  1617. BX3 X0*X3 KEEP ONLY BOTTOM 18 BITS
  1618. LX3 18 POSITION TO *EM* PORTION
  1619. LX0 18 POSITION 0'7S OVER 18 SPOTS
  1620. BX2 X0*X7 ZERO EM CHARGE
  1621. IX2 X2+X3 SET *EM* FIELD TO -1
  1622. EQ PROS7 GO RETURN SYSTEM LESSON INFO
  1623.  
  1624. * /--- BLOCK PROSRCH 00 000 79/01/16 14.10
  1625. *
  1626. * * * TURN OFF *S1P* BIT SO CAN SHIFT-STOP OUT OF LESSON
  1627. * * * (LEAVE EM CHARGE AT 0)
  1628. *
  1629. PROS6 MX0 1 SET MASK FOR *S1P* BIT
  1630. LX0 60-ZPLDSHF POSITION MASK FOR THAT BIT
  1631. BX2 -X0*X7 TURN OFF *S1P* BIT
  1632. EQ PROS7 CONTINUE
  1633.  
  1634. PROSZ SX2 0 NO SYSTEM PRIVILEDGES
  1635.  
  1636. PROS7 BX7 X2 SAVE DESCRIPTOR WORD
  1637. SA1 PROS.X6X
  1638. SA2 PROS.A6
  1639. BX6 X1
  1640. SA6 X2 RESTORE (A6) AND (CM VALUE)
  1641. SA1 PROS.A0
  1642. SA0 X1 RESTORE (A0)
  1643. SA1 PROS.A3
  1644. SA3 X1 RESTORE (A3)
  1645. SA1 PROS.X3
  1646. BX3 X1 RESTORE (X3)
  1647. SA1 PROS.X4
  1648. BX4 X1 RESTORE (X4)
  1649. SA1 ORIGLSN RETURN (X1) = FILE NAME
  1650. BX6 X1 STORE IT THERE (JUST IN CASE)
  1651. BX2 X7 RETURN (X2) = DESCRIPTOR WORD
  1652. EQ PROSRCH
  1653.  
  1654. PROS.A0 BSS 1 FOR SAVING (A0)
  1655. PROS.A3 BSS 1 FOR SAVING (A3)
  1656. PROS.A6 BSS 1 FOR SAVING (A6)
  1657. PROS.X6X BSS 1 FOR SAVING (CM VALUE OF *A6*)
  1658. PROS.X3 BSS 1 FOR SAVING (X3)
  1659. PROS.X4 BSS 1 FOR SAVING (X4)
  1660.  
  1661. SRCHCNT BSS 1 NUMBER OF SEARCHES
  1662. ORIGLSN BSS 1 ORIGINAL LESSON NAME
  1663. NPLATO DATA 0LNPLATO NPLATO LESSON NAME
  1664.  
  1665. QUAL *
  1666. * /--- BLOCK PROLIST 00 000 81/12/05 03.53
  1667.  
  1668. ENTRY PROLIST,SYSLST,SYLEND
  1669.  
  1670. PROLIST BSS 1
  1671. SYSLST EQU PROLIST
  1672.  
  1673. SYLEND BSS 1
  1674. * /--- BLOCK ZFILL 00 000 78/05/01 22.21
  1675. TITLE -ZFILL- COMMAND
  1676. *
  1677. *
  1678. * -ZFILL- COMMAND
  1679. * CONVERTS ARGUMENT TO LEFT-JUSTIFIED ZERO-FILL
  1680. *
  1681. *
  1682. ZFILLX NGETVAR GET ARGUMENT TO X1
  1683. CALL LJUST,(1R ),0
  1684. BX6 X1
  1685. SA6 A1
  1686. EQ PROC
  1687. *
  1688. *
  1689. TITLE -CPULIM- COMMAND
  1690. *
  1691. *
  1692. * -CPULIM- COMMAND
  1693. * ALLOWS USERS TO CHANGE CPU MILLISECONDS PER
  1694. * SECOND LIMITS WITH BOUNDS UP TO -MSLIMIT-
  1695. * WHICH IS CURRENTLY 10
  1696. *
  1697. CPULIMX NGETVAR GET DESIRED MSEC/SEC
  1698. NG X1,ERXVAL BAD VALUE, EXECERR USES X1
  1699. ZR X1,ERXVAL BAD VALUE, EXECERR USES X1
  1700. **
  1701. SA2 STFLAGS
  1702. LX2 60-FINBIT CHECK FOR IN-FINISH-UNIT
  1703. NG X2,PROC
  1704. **
  1705. SX2 MSLIMIT MAXIMUM PERMISSIBLE
  1706. IX3 X2-X1 CHECK IF MSEC/SEC TOO HIGH
  1707. *
  1708. NG X3,CPERXUL EXECERR IF ABOVE 10 TIPS
  1709. * EXECERR USES X1
  1710. CPUX2 SX2 X1-3 MAKE SURE AT LEAST 3
  1711. PL X2,CPUX3 TO GET PEOPLE FINALLY OUT OF
  1712. SX1 3 FINISH UNIT
  1713. CPUX3 PX1 X1
  1714. NX1 X1 CONVERT TO FLOATING POINT
  1715. SA2 =1000.0
  1716. FX6 X2/X1 1000/CPU LIMIT
  1717. UX6 X6,B1
  1718. LX6 X6,B1
  1719. SA6 TCPUMAX SET MAXIMUM MSEC/SEC
  1720. EQ PROC
  1721. *
  1722. *
  1723. CPERXUL SX2 MSLIMIT
  1724. SA3 =70247011702070230000B 'T'I'P'S
  1725. EQ ERXMXL
  1726. * /--- BLOCK SHOWT 00 000 75/07/09 00.10
  1727. TITLE SHOWT
  1728. * -SHOWT- COMMAND
  1729. *
  1730. * SHOWS TUTOR VARIABLE (CONVERTED TO FLOATING POINT FORMAT)
  1731. * DEFAULT FORMAT IS 4.3 IF THE
  1732. * VARIABLE IS FLOATING POINT AND 8.0 IF IT IS INTEGER.
  1733. * ADDITIONS FOR -SHOW ARRAY- BY SHIRER 7/8/75
  1734. *
  1735. EXT ARAYFLG
  1736. *
  1737. ENTRY SHOWT
  1738. SHOWT BSS 0
  1739. SX7 0
  1740. SA7 ARAYFLG GETVAR SETS NONZERO IF ARRAY
  1741. FGETVAR EVALUATE 1ST ARGUMENT
  1742. BX7 X1
  1743. SA7 SHOWVAL SAVE IT
  1744. SA5 A5 RESTORE COMMAND
  1745. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  1746. NG X5,SHOWT2 DEFAULT IF NEGATIVE
  1747. FGETVAR DO THE CALC TO GET THE FORMAT
  1748. SA2 =.05 ROUND NUMBER OF DECIMAL PLACES
  1749. RX1 X1+X2
  1750. UX6 X1,B1 GET INTEGER PART
  1751. LX6 X6,B1 FIX IT
  1752. SA6 NCHAR
  1753. SA5 A5 REFETCH COMMAND WORD
  1754. LX5 2*XCODEL
  1755. PL X5,SHOWT3A FOR THREE ARG SHOW
  1756. PX2 X6 REFLOAT IT
  1757. NX2 X2
  1758. RX1 X1-X2 SUBTRACT FROM ORIGINAL FORMAT
  1759. SA2 =10.
  1760. RX6 X1*X2 MULTIPLY UP THE DECIMAL PLACE SPECIFIER
  1761. UX6 X6,B1
  1762. LX6 X6,B1 FIX IT
  1763. SHOWT1 SA6 NDECPL STORE NUMBER OF DEC. PLACES
  1764. EQ SHOWT3
  1765. ****
  1766. SHOWT2 SX6 4 DEFAULT FORMAT 4.3
  1767. SX7 3 DEFAULT NDECPL (FLOATING)
  1768. SA5 A5 RETRIEVE ORIGINAL COMMAND WORD
  1769. LX5 XFBIT
  1770. NG X5,SHOWT4 JUMP IF FLOATING POINT
  1771. MX7 0 NDECPL=0 FOR INTEGER
  1772. LX6 1 GET AN 8
  1773. SHOWT4 SA6 NCHAR
  1774. SA7 NDECPL
  1775. SHOWT3 SA1 ARAYFLG
  1776. NZ X1,ASHOWT JUMP IF ARRAY SHOW**DEBUG**
  1777. SHOWT5 RJ =XTSHOW
  1778. SHOWFIN CALL XYFIX A1, X1 SET BY SHOW SUBROUTINE
  1779. CALL TUTWRT B1,B2 SET BY SHOW SUBROUTINE
  1780. EQ PROCO
  1781. *
  1782. SHOWT3A MX0 2*XCODEL+XCMNDL FLAG BIT NOT SET IF GET HERE
  1783. LX5 60-2*XCODEL-XCMNDL POSITION ADDRESS
  1784. BX5 -X0*X5
  1785. SA1 B5+X5 FETCH 3RD ARG
  1786. BX5 X1
  1787. NGETVAR
  1788. MX6 0 REMOVE -0
  1789. IX6 X6+X1
  1790. EQ SHOWT1 RE-ENTER NORMAL FLOW
  1791. *
  1792. *
  1793. * /--- BLOCK NUASHOW 00 000 77/07/26 21.58
  1794. * ARRAY SHOW PREPARATION
  1795. * ENTER WITH X1=ARAYFLG=ADDR OF XSTOR ARAYWRD
  1796. *
  1797. ENTRY ASHOWIN,ASHOW1,ASHOW2
  1798. ENTRY ASHOWEF
  1799. *
  1800. MAXSCOLS EQU 64 MAX NUM COLUMNS TO SHOW
  1801. MAXSROWS EQU 16 MAX NUM ROWS TO SHOW
  1802. *
  1803. ASHOWT SA3 SHOWT5 PLANT RJ=XTSHOW IN LOOP
  1804. SX6 0 FGETVAR TYPE
  1805. ASHOWIN SA6 ASHOTYP KEEP TYPE IN X6 FOR LATER TEST
  1806. BX7 X3
  1807. SA7 ASHOW1
  1808. SA3 NX
  1809. BX7 X3
  1810. SA7 ASHOWNX SAVE STARTING NX
  1811. *
  1812. * ARRAY SHOW ROUTINE USED FOR -SHOWT- AND -SHOWE-
  1813. *
  1814. ASHOW00 SA2 X1 GET ARAYWD IN X2
  1815. BX7 X2
  1816. SA7 ARAYWRD
  1817. MX0 -9
  1818. AX2 27 (LATER WILL NEED PLANES TOO)
  1819. BX7 -X0*X2
  1820. SA7 ASHOWC COLUMNS-1
  1821. SX7 X7-MAXSCOLS
  1822. PL X7,SERXRC *JUMP IF COLS OVER LIMIT*
  1823. * EXECERR USES X2
  1824. AX2 9
  1825. BX7 -X0*X2
  1826. SA7 ASHOWR ROWS-1
  1827. SX7 X7-MAXSROWS
  1828. PL X7,SERXRC *LIMIT TO 16 ROW DISPLAY*
  1829. * EXECERR USES X2
  1830. LX2 3+9+27
  1831. PL X2,ASHOW1 JUMP IF NOT SEGMENTED
  1832. *
  1833. SA5 A5
  1834. NGETVAR RE-EVALUATE INTEGER 1ST VALUE
  1835. SA2 ARAYFLG
  1836. SA2 X2+1 X2=2D ARAYWD
  1837. RJ GETASEG EXTRACT SEGMENT FROM 1ST WORD
  1838. SA2 ASHOTYP
  1839. BX7 -X2 NEGATIVE TYPE INDICATES SEGMENT
  1840. SA7 A2
  1841. NZ X2,ASHOW04 JUMP IF SHOWA OR SHOWO
  1842. PX6 X6
  1843. NX6 X6 SHOWT, SHOWE NEED FLOATING VALU
  1844. ASHOW02 SB1 SHOWVAL
  1845. EQ ASHOW08
  1846. *
  1847. ASHOW04 SX2 X2-1 JUMP IF -SHOWO-
  1848. ZR X2,ASHOW02
  1849. BX6 X1 LEFT ADJSTD STRING FRM GETASEG
  1850. SB1 STRING
  1851. *
  1852. ASHOW08 SA6 B1 STORE 1ST SHOW VALUE
  1853. *
  1854. * ARRAY SHOW LOOP
  1855. *
  1856. * /--- BLOCK NUASHOW 00 000 77/07/22 23.15
  1857. ASHOW1 RJ =XTSHOW CONVERT FLOAT TO ALPHA
  1858. ASHOW2 SA2 ASHOWR =0 IF LAST ROW
  1859. NZ X2,ASHOW3 IF NOT, SKIP OVER XYFIX
  1860. CALL XYFIX
  1861. ASHOW3 CALL TUTWRT WRITE THE STRING
  1862. ASHOW4 SA2 ASHOWC =0 IF LAST COLUMN
  1863. NZ X2,ASHOW8 IF NOT,DECREMENT COLUMN
  1864. SA2 ASHOWR =0 IF LAST ROW
  1865. ZR X2,PROCO EXIT IF DONE
  1866. * *NEW ROW* *
  1867. SA1 ARAYWRD RESET COLUMN INFO FOR NEW ROW
  1868. AX1 27
  1869. MX0 -9
  1870. BX7 -X0*X1 EXTRACT MAX COLS AGAIN
  1871. SA7 ASHOWC AND RESTORE
  1872. SA3 NY SCREEN Y POSITION
  1873. SX7 X3-32
  1874. PL X7,ASHOW5 JUMP IF ON SCREEN
  1875. SX7 X7+512 IF NOT WRAP-AROUND
  1876. ASHOW5 SA7 NY RESTORE NEW VALUE
  1877. *
  1878. * /--- BLOCK NUASHOW5 00 000 80/04/22 01.01
  1879. *
  1880. SA1 ASHOWNX
  1881. BX6 -X0*X1
  1882. SA6 NX RESET WHEREX TO MARGIN
  1883. LX6 9
  1884. BX1 X6+X7 MERGE NX,NY
  1885. OUTCODE WFCODE FINE WHERE TO START NEW ROW
  1886. *
  1887. SA1 XSLCLOK GET RUNNING MS CLOCK
  1888. SA2 MAXCLOK
  1889. IX1 X1-X2
  1890. PL X1,SINTRUP
  1891. *
  1892. SA1 MOUTLOC
  1893. SX1 X1-MOUT150
  1894. PL X1,SINTRUP
  1895. *
  1896. ASHOW6 SA2 ASHOWR RESTORE ROW FOR DECREMENT
  1897. ASHOW8 SX4 1
  1898. IX7 X2-X4 DECREMENT ROW/COL
  1899. SA7 A2 RESTORE IT
  1900. *
  1901. ASHOW9 SA1 ARAYWRD
  1902. IX7 X1+X4 INCREMENT GETVAR ADDRESS
  1903. SA7 A1 AND RESTORE IT
  1904. MX0 -18
  1905. BX5 -X0*X7 GETVAR CODE OF NEXT ELEMENT
  1906. LX5 60-XCODEL LEFT JUSTIFY
  1907. SA2 ASHOTYP
  1908. NG X2,ASHOW70 JUMP IF SEGMENTED
  1909. NZ X2,ASHOW95 JUMP IF SHOWO
  1910. FGETVAR EVALUATE NEXT ARRAY ELEMENT
  1911. ASHOW99 BX6 X1
  1912. SA6 SHOWVAL
  1913. EQ ASHOW1 AND SHOW IT
  1914. *
  1915. ASHOW95 SX2 X2-2
  1916. ZR X2,ASHOW96 JUMP IF SHOWA
  1917. ASHOW94 NGETVAR GET NEXT SHOWO VALUE
  1918. EQ ASHOW99
  1919. ASHOW96 NGETVAR
  1920. SB1 A1 NEXT SHOWA ADDRESS
  1921. EQ ASHOW1
  1922. *
  1923. ASHOW70 NGETVAR WORD CONTAINING SEGMENT IN X1
  1924. SA2 ARAYFLG ADDR OF INFO WD
  1925. SA2 X2+1 GET 2D ARAY INFO WD
  1926. RJ GETASEG EXTRACT SEGMENT
  1927. SA2 ASHOTYP
  1928. NZ X2,ASHOW76 JUMP IF SHOWA OR SHOWO
  1929. PX6 X6
  1930. NX6 X6 FLOAT
  1931. ASHOW74 SA6 SHOWVAL
  1932. EQ ASHOW1
  1933. *
  1934. ASHOW76 SX2 X2+1 X2 WAS -1 IF SHOWO
  1935. ZR X2,ASHOW74 JUMP IF -SHOWO-
  1936. BX6 X1 LEFT-JUSTIFY SEGMENT
  1937. SA6 STRING
  1938. SB1 A6
  1939. EQ ASHOW1
  1940. *
  1941. STRING BSS 1
  1942. ASHOWR BSS 1 ARRAY ROW/COL INDICES
  1943. ASHOWC BSS 1
  1944. ASHOWNX BSS 1 STARTING NX VALUE
  1945. ASHOTYP BSS 1 T,E=TYPE0, O=TYPE1
  1946. ASHOWEF BSS 1 SHOWE FORMAT
  1947. ARAYWRD BSS 1 SEGMENTED ARAYWD
  1948. *
  1949. * /--- BLOCK NUASHOWE 00 000 78/04/04 18.25
  1950. *
  1951. *
  1952. * ARRAY SHOWE PREPARATION
  1953. *
  1954. ASHOWE SA3 SHOWE5 PLANT EQ SHOWE6 IN LOOP
  1955. SA6 ASHOWEF SAVE FORMAT WHICH WAS IN X6
  1956. SX6 0 TYPE=0 FOR FGETVAR
  1957. EQ ASHOWIN
  1958. *
  1959. SHOWE5 EQ SHOWE6
  1960. *
  1961. SHOWE6 SA1 ASHOWEF
  1962. BX7 X1 RECOVER FORMAT
  1963. MX6 0
  1964. SA6 SHOWOUT REQUEST LEADING BLANK/SIGN
  1965. SA7 NCHAR
  1966. RJ =XESHOW
  1967. CALL TUTWRT
  1968. SA1 NX
  1969. SA2 NY
  1970. SA3 ASHOWEF NUMB CHARS
  1971. SX3 X3+10 +SPACE FOR EXPONENT,SIGN,ETC
  1972. LX3 3 TIMES 8 FOR EQUIVALENT DOTS
  1973. IX6 X1+X3 NX FOR NEXT WRITE
  1974. SA6 A1 STORE NEW NX
  1975. MX0 -9
  1976. BX1 -X0*X6
  1977. BX2 -X0*X2
  1978. LX1 9
  1979. BX1 X1+X2 FORM OUTPUT NX,NY
  1980. OUTCODE WFCODE SEND OUT -WHERE-
  1981. EQ ASHOW4 SKIP PAST TUTWRT
  1982. *
  1983. GETASEG EQ * ENTER WITH X1=WORD,X2=ARAYWD1
  1984. LX2 1 EXAMINE TYPE
  1985. PL X2,ERXHSEG HORIZONTAL TYPE SEGMENT ILLEGAL
  1986. LX2 59 RESTORE SIGN
  1987. MX0 -6
  1988. AX2 42
  1989. BX3 -X0*X2 STARTBIT POSITION
  1990. AX2 6
  1991. BX4 -X0*X2 BITS/BYTE
  1992. SB1 X3-1 SB-1 = LEFT JUSTIFY SHIFT
  1993. SB2 X4-1 BB-1 = MASK SHIFT
  1994. RJ GETSEG
  1995. EQ GETASEG
  1996. *
  1997. *
  1998. * SUBROUTINE TO EXTRACT SEGMENT FROM WORD IN X1
  1999. * ENTER WITH B1 = LEFT-JUSTIFY SHIFT, X2 HAS SIGNBIT
  2000. GETSEG EQ * AND B2=BITS/BYTE - 1
  2001. LX1 X1,B1 LEFT-JUSTIFY SEGMENT
  2002. MX0 1
  2003. AX0 X0,B2 FORM MASK
  2004. BX1 X0*X1
  2005. NG X2,GETSEG2 JUMP IF SIGNED SEGMENT
  2006. SB2 B2+1 BITS/BYTE
  2007. LX6 B2,X1 RIGHT JUSTIFY
  2008. EQ GETSEG
  2009. *
  2010. GETSEG2 SB1 59
  2011. SB1 B1-B2 60-BB
  2012. AX6 X1,B1 RIGHT-JUSTIFY, EXTENDING SIGN
  2013. EQ GETSEG
  2014. *
  2015. SERXRC MX0 -9
  2016. SA2 ARAYWRD
  2017. AX2 27 (LATER WILL NEED PLANES TOO)
  2018. BX1 -X0*X2 NUMBER COLUMNS SPECIFIED
  2019. AX2 9
  2020. BX2 -X0*X2 NUMBER ROWS SPECIFIED
  2021. SX1 X1+1 MAKE CARDINAL
  2022. SX2 X2+1 MAKE CARDINAL
  2023. SX3 MAXSCOLS
  2024. SX4 MAXSROWS
  2025. EXECERR 120
  2026. * /--- BLOCK NUSINTRUP 00 000 79/12/21 22.12
  2027. SINTRUP SA1 TBITS ARRAY SHOW INTERRUPT ROUTINE
  2028. LX1 BRKBIT
  2029. NG X1,TOOMUCH JUMP IF AUTOBREAK SUPPRESSED
  2030. SA1 INEMBED
  2031. NZ X1,ERROROF ERROR IF IN EMBEDDED WRITE
  2032. FINISH ERXOUTP NO OUTPUT ALLOWED IN -FINISH-
  2033. SA1 ARAYFLG
  2034. SA2 ASHOWR
  2035. BX6 X1
  2036. BX7 X2
  2037. SA6 TBINTSV
  2038. SA7 TBINTSV+1
  2039. SA1 ASHOWC
  2040. SA2 NDECPL
  2041. BX6 X1
  2042. BX7 X2
  2043. SA6 TBINTSV+2
  2044. SA7 TBINTSV+3
  2045. SA1 NCHAR
  2046. SA2 ASHOW1
  2047. BX6 X1
  2048. BX7 X2
  2049. SA6 TBINTSV+4
  2050. SA7 TBINTSV+5
  2051. SA1 SHOWOUT
  2052. SA2 SUPPFLG
  2053. BX6 X1
  2054. BX7 X2
  2055. SA6 TBINTSV+6
  2056. SA7 TBINTSV+7
  2057. SA2 ASHOWNX
  2058. SA3 ASHOWEF
  2059. MX0 -9 KEEP ONLY 9 BITS OF NX
  2060. BX7 -X0*X2
  2061. BX3 -X0*X3 AND FORMAT
  2062. LX7 20
  2063. BX7 X7+X3 MERGE IN ASHOWEF
  2064. SA7 TBINTSV+8
  2065. SA1 ARAYWRD
  2066. BX6 X1
  2067. SA6 TBINTSV+9
  2068. SA1 =XWHATSIN+0 CURRENT OVERLAY NUMBER
  2069. BX7 X1
  2070. SA7 TBINTSV+10
  2071. SA1 ASHOTYP
  2072. BX6 X1
  2073. SA6 TBINTSV+11
  2074. *
  2075. RJ TFIN GO DO INTERRUPT
  2076. *
  2077. SA1 TBINTSV+10 RESTORE ANY OVERLAY FIRST
  2078. SA2 =XWHATSIN+0
  2079. BX7 X1
  2080. RJ =XLOADOV
  2081. *
  2082. SA1 TBINTSV
  2083. SA2 TBINTSV+1 RESTORE VALUES
  2084. BX6 X1
  2085. BX7 X2
  2086. SA6 ARAYFLG
  2087. SA7 ASHOWR
  2088. SA1 TBINTSV+2
  2089. SA2 TBINTSV+3
  2090. BX6 X1
  2091. BX7 X2
  2092. SA6 ASHOWC
  2093. SA7 NDECPL
  2094. SA1 TBINTSV+4
  2095. SA2 TBINTSV+5
  2096. BX6 X1
  2097. BX7 X2
  2098. SA6 NCHAR
  2099. SA7 ASHOW1
  2100. SA1 TBINTSV+6
  2101. SA2 TBINTSV+7
  2102. BX6 X1
  2103. BX7 X2
  2104. SA6 SHOWOUT
  2105. SA7 SUPPFLG
  2106. SA1 TBINTSV+8
  2107. SX6 X1
  2108. AX1 20
  2109. SA6 ASHOWEF
  2110. SX7 X1
  2111. SA7 ASHOWNX
  2112. SA1 TBINTSV+9
  2113. BX6 X1
  2114. SA6 ARAYWRD
  2115. SA1 TBINTSV+11
  2116. BX6 X1
  2117. SA6 ASHOTYP
  2118. EQ ASHOW6
  2119. *
  2120. *
  2121. * /--- BLOCK SHOW 00 000 78/04/04 19.23
  2122. TITLE SHOW
  2123. * -SHOW-
  2124. *
  2125. * SHOWS TUTOR VARIABLE IN (STANDARD) NOTATION,
  2126. * THE SECOND ARGUMENT SPECIFIES THE NUMBER OF
  2127. * SIGNIFICANT FIGURES DESIRED.
  2128. * 'THE THIRD ARGUMENT SPECIFIES THE FLOOR
  2129. * (=10&-&9 AS DEFAULT).
  2130. *
  2131. *
  2132. ENTRY SHOW
  2133. *
  2134. SHOW BSS 0
  2135. FGETVAR EVALUATE 1ST ARGUMENT
  2136. BX7 X1
  2137. SA7 SHOWVAL SAVE IT
  2138. SA5 A5 RESTORE COMMAND
  2139. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  2140. SX6 4 DEFAULT SHOW WIDTH
  2141. NG X5,SHOW1 IF SHOULD USE DEFAULT
  2142. NGETVAR DO THE CALC TO GET THE FORMAT
  2143. BX6 X1
  2144. ZR X6,PROCESS OUT IF NOTHING TO DO
  2145. SHOW1 SA6 NCHAR SAVE DISPLAY WIDTH
  2146. SA5 A5 RETRIEVE ORIGINAL COMMAND
  2147. LX5 XFBIT
  2148. MX6 60 NEG 0 IF INTEGER
  2149. PL X5,SHOW4 JUMP IF INTEGER
  2150. LX5 2*XCODEL-XFBIT
  2151. PL X5,SHOW5 CHECK FOR THIRD ARGUMENT
  2152. SA1 =XEQTOLER GET DEFAULT TOLERANCE
  2153. SHOW2 SA2 SHOWVAL GET X
  2154. BX6 X2 GET
  2155. AX6 60 ABSOLUTE
  2156. BX2 X2-X6 VALUE OF X
  2157. FX7 X2-X1 ABS(X)-FLOOR
  2158. MX6 0 SET X=0 OR FLAG F.P.
  2159. PL X7,SHOW4
  2160. SA6 SHOWVAL
  2161. MX6 60 SET FOR INTEGER
  2162. SHOW4 SA6 SHOWOUT INTEGER/FLOATING FLAG IN SHOWOUT
  2163. SX7 1 SET TO SEE ZEROES
  2164. BX7 X6*X7
  2165. SA7 SUPPFLG SET ZERO SUPPRESSION FLAG
  2166. SA2 NCHAR GET NSIG
  2167. SX3 4
  2168. IX7 X2+X3 NSIG+4
  2169. SA7 SUPPFLG+1 RANGE N
  2170. SX7 3
  2171. SA7 SUPPFLG+2 RANGE M
  2172. SX7 1
  2173. SA7 SUPPFLG+3 ALLOW TRANSFER TO -SHOWE-
  2174. SX7 0
  2175. SA7 STARFLG FORCE SUP/SUB FORMAT, NOT **
  2176. *
  2177. RJ =XZSHOW
  2178. EQ SHOWFIN
  2179. *
  2180. SHOW5 AX5 2*XCODEL+XCMNDL AND SIGN BIT WAS OFF
  2181. SA1 B5+X5 GET EXTRA STORAGE WORD
  2182. BX5 X1
  2183. FGETVAR GET TOLERANCE
  2184. PL X1,SHOW5B OK IF PLUS
  2185. NZ X1,ERXSTOL ERROR IF NEGATIVE
  2186. MX1 0 SET TO ZERO
  2187. SHOW5B SA2 =1. GET A ONE
  2188. FX2 X2-X1 MUST BE LESS THAN OR EQUAL ONE
  2189. PL X2,SHOW2
  2190. EQ ERXSTOL
  2191. * /--- BLOCK SHOWZ 00 000 78/01/19 01.07
  2192. TITLE SHOWZ
  2193. * -SHOWZ-
  2194. *
  2195. * SHOWS TUTOR VARIABLE IN (STANDARD) NOTATION,
  2196. * THE SECOND ARGUMENT SPECIFIES THE NUMBER OF
  2197. * SIGNIFICANT FIGURES DESIRED.
  2198. *
  2199. *
  2200. **
  2201. ENTRY SHOWZ
  2202. *
  2203. SHOWZ SX7 1 FLAG TO SEE TR. ZEROES
  2204. SA7 SHOWOUT
  2205. FGETVAR EVALUATE 1ST ARGUMENT
  2206. BX7 X1
  2207. SA7 SHOWVAL SAVE IT
  2208. SA5 A5 RESTORE COMMAND
  2209. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  2210. SX6 4 DEFAULT SIGNIFICANT DIGITS
  2211. NG X5,SHOWZ3 IF SHOULD USE DEFAULT
  2212. NGETVAR DO THE CALC TO GET THE FORMAT
  2213. ZR X1,PROCESS OUT IF NOTHING TO DO
  2214. BX6 X1
  2215. AX6 6 CATCH IF GREATER THAN 64
  2216. NZ X6,ERXBADL
  2217. SX6 X1 SET NUMBER OF SIG FIGS
  2218. SHOWZ3 SA5 A5 RETRIEVE ORIGINAL COMMAND
  2219. LX5 XFBIT
  2220. SA6 NCHAR STORE NSIG FIGS
  2221. MX6 60 NEG 0 IF INTEGER
  2222. SX7 1 TURN OFF ZERO-SUPPRESSOR
  2223. PL X5,SHOWZ4 JUMP IF INTEGER
  2224. MX6 0 +0 IF FLOATING POINT
  2225. SA1 SHOWOUT
  2226. BX7 X1 SET TO PRESET VALUE
  2227. *
  2228. *
  2229. SHOWZ4 SA6 SHOWOUT INTEGER/FLOATING FLAG IN SHOWOUT
  2230. SA7 SUPPFLG ZERO SUPPRESS FLAG
  2231. SA2 NCHAR GET NSIG
  2232. SX3 4
  2233. IX7 X2+X3 NSIG+4
  2234. SA7 SUPPFLG+1 RANGE N
  2235. SX7 3
  2236. SA7 SUPPFLG+2 RANGE M
  2237. SX7 1
  2238. SA7 SUPPFLG+3 ALLOW TRANSFER TO -SHOWE-
  2239. SX7 0
  2240. SA7 STARFLG FORCE SUP/SUB FORMAT, NOT **
  2241. *
  2242. RJ =XZSHOW
  2243. EQ SHOWFIN
  2244. *
  2245. ENTRY ASHOWE,SHOWFIN,ASHOW3,ASHOWIN
  2246. * ABOVE ENTRIES ARE DUE TO OVERLAYING OF
  2247. * -SHOWE-, -SHOWO- AND -SHOWH-
  2248. * /--- BLOCK -ZERO- 00 000 79/01/03 13.35
  2249. ZEROSAV SPACE 5,11
  2250. ** ZEROSAV - SAVE REGISTERS *X4* AND *A4*
  2251.  
  2252. ENTRY ZEROSAV
  2253.  
  2254. ZEROSAV PS
  2255.  
  2256. SA0 A7 SAVE *A7*
  2257. SA7 ZBSAVX7 SAVE CURRENT *X7*
  2258. BX7 X4
  2259. SA7 ZBSAVX4 SAVE *X4*
  2260. SX7 A4
  2261. SA7 ZBSAVA4 SAVE *A4*
  2262. SA4 A0 GET DATA AT *A7*
  2263. BX7 X4
  2264. SA7 A0 WRITE IT BACK AND RESET *A7*
  2265. SA4 ZBSAVX7 GET ORIGINAL *X7*
  2266. BX7 X4 RESET *X7*
  2267. EQ ZEROSAV -- EXIT
  2268.  
  2269. ZERORST SPACE 5,11
  2270. ** ZERORST - RESTORE *X4* AND *A4* AFTER -ZERO-
  2271. *
  2272. * RESTORE *X4*, *A4* -- *X0* LOST
  2273.  
  2274. ENTRY ZERORST
  2275.  
  2276. ZERORST PS
  2277.  
  2278. SA4 ZBSAVX4 GET *X4*
  2279. BX0 X4 HOLD *X4*
  2280. SA4 ZBSAVA4 GET *A4*
  2281. SA4 X4 RESET *A4*
  2282. BX4 X0 RESET *X4*
  2283. EQ ZERORST RETURN
  2284. *
  2285. ZBSAVX7 BSS 1
  2286. ZBSAVX4 BSS 1
  2287. ZBSAVA4 BSS 1
  2288. *
  2289.  
  2290. * /--- BLOCK END 00 000 78/09/01 21.41
  2291. *
  2292. *
  2293. END
plato/source/plaopl/exec2.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator