Table of Contents

VIRTERM

Table Of Contents

  • [00008] VIRTUAL TERMINAL INTERFACE.
  • [00229] VDTBOI - BEGINNING OF INPUT.
  • [00261] VDTBOX - OUTPUT LINE DRAWING CHARACTER.
  • [00287] VDTCAA - CHANGE ALL ATTRIBUTES.
  • [00308] VDTCLR - CLEAR TO END OF SCREEN.
  • [00336] VDTCUD - MOVE CURSOR DOWN ONE POSITION.
  • [00378] VDTCUL - MOVE CURSOR LEFT ONE POSITION.
  • [00420] VDTCUR - MOVE CURSOR RIGHT ONE POSITION.
  • [00462] VDTCUU - MOVE CURSOR UP ONE POSTION.
  • [00504] VDTDEC - DELETE ONE CHARACTER.
  • [00527] VDTDEL - DELETE ONE LINE.
  • [00566] VDTDRW - SET LINE DRAWING CHARACTER SET.
  • [00611] VDTEOI - END OF INFORMATION.
  • [00632] VDTERC - ERASE CHARACTER.
  • [00670] VDTERL - ERASE LINE.
  • [00713] VDTGTF - GET TERMINAL ATTRIBUTE FLAGS.
  • [00737] VDTINC - INSERT ONE SPACE CHARACTER.
  • [00760] VDTINL - INSERT ONE BLANK LINE.
  • [00799] VDTINP - IDENTIFY NEXT VIRTUAL INPUT EVENT.
  • [00843] VDTPRO - SET PROTECTION.
  • [00870] VDTPSU - PSEUDO UNDERLINE.
  • [00902] VDTRES - RESET.
  • [00923] VDTRET - RETURN.
  • [00944] VDTTAB - TAB FORWARD.
  • [00969] VDTTBB - TAB BACKWARD.
  • [00999] VDTTFF - TEST FOR OUTPUT FUNCTION.
  • [01269] VDTBEL - RING THE BELL.
  • [01290] VDTBOO - BEGINNING OF OUTPUT SEQUENCE.
  • [01323] VDTCHR - OUTPUT ONE 12 BIT BYTE.
  • [01388] VDTCLL - CLEAR TO END OF LINE.
  • [01481] VDTCLS - CLEAR SCREEN.
  • [01530] VDTCOR - SET INTERNAL CURSOR POSITION.
  • [01565] VDTCTS - CLEAR ALL TABS.
  • [01588] VDTEOO - END OF OUTPUT SEQUENCE.
  • [01620] VDTGTD - GET TERMINAL DIMENSIONS.
  • [01646] VDTHOM - MOVE CURSOR TO HOME POSITION.
  • [01683] VDTITD - INITIALIZE *TDU* TABLE.
  • [01858] VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD.
  • [01900] VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD.
  • [01940] VDTPOS - POSITION CURSOR.
  • [01976] VDTPPI - PRE-PROCESS INPUT.
  • [02046] VDTPPI - PRE-PROCESS INPUT.
  • [02081] VDTSAM - SET ATTRIBUTE MASK.
  • [02237] VDTSAP - SET ATTRIBUTE POSITION.
  • [02314] VDTSTD - SET TERMINAL DIMENSIONS.
  • [02395] VDTSTM - SET TERMINAL MODE.
  • [02536] VDTSTR - WRITE ONE LINE OF OUTPUT.
  • [02576] VDTSTR - WRITE ONE LINE OF OUTPUT.
  • [02650] VDTSTS - SET TAB STOP.
  • [02689] VDTWTO - WRITE ONE WORD OF OUTPUT.
  • [02717] VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR.
  • [02753] VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR.
  • [02788] VDCTRL - ISSUE AN OUTPUT CONTROL SEQUENCE BY ORDINAL.
  • [02993] VDGETW - GET WORD FROM *TDU* TABLE.
  • [03036] VDMOVE - CURSOR MOVEMENT.
  • [03172] VDNUMC - NUMBER CONVERSION.
  • [03232] VDNXTI - FETCH NEXT INPUT BYTE FROM BUFFER/ACCUMULATOR.
  • [03274] VDTIINP - IDENTIFY NEXT VIRTUAL INPUT EVENT.

Source Code

VIRTERM.txt
  1. PROC VIRTERM;
  2.  
  3. # TITLE VIRTERM - VIRTUAL TERMINAL INTERFACE. #
  4.  
  5. BEGIN # VIRTERM #
  6.  
  7. #
  8. *** VIRTERM - VIRTUAL TERMINAL INTERFACE.
  9. *
  10. * *VIRTERM* PROVIDES VIRTUAL TERMINAL OBJECT ROUTINES TO MAP
  11. * TO AND FROM TERMINAL-INDEPENDENT APPLICATION REQUESTS AND
  12. * TERMINAL-DEPENDENT CODE SEQUENCES.
  13. *
  14. * PROC VIRTERM
  15. *
  16. * ENTRY OBJECT ROUTINE CALLED.
  17. *
  18. * EXIT OBJECT ROUTINE EXECUTED.
  19. *
  20. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  21. #
  22.  
  23. DEF LISTCON #1#; # LIST COMDECKS #
  24.  
  25. *IFCALL SINGLE,COMFSGL
  26. *IFCALL ONLY,COMFONL
  27. *IFCALL MULTI,COMFMLT
  28. *IFCALL EDITOR,COMFFSE
  29.  
  30. # START OF CODE SEQUENCE CONDITIONALLY PRODUCED BY MODIFY UTILITY #
  31.  
  32. *NIFCALL EDITOR,COMFTIO
  33. *IF UNDEF,EDITOR
  34. DEF EDITORVDT #0#; # STANDALONE VERSION OF VIRTERM #
  35. DEF IOBEGIN(XXX) #BEGIN#; # BEGIN COMPOUND STATEMENT #
  36. DEF IOEND #END#; # END COMPOUND STATEMENT #
  37. DEF IORET #RETURN;#; # RETURN FROM SUBPROGRAM #
  38. DEF SINGLE #1#; # SINGLE-USER VERSION #
  39. DEF MULTI #0#; # NOT MULTI-USER #
  40.  
  41. CONTROL PRESET;
  42. *ENDIF
  43.  
  44. *IF UNDEF,QTRM
  45. DEF QTRMV #0#; # NOT QTRM VERSION #
  46. *ELSE
  47. DEF QTRMV #1#; # QTRM VERSION #
  48. *ENDIF
  49.  
  50. # END OF CODE SEQUENCE CONDITIONALLY PRODUCED BY MODIFY UTILITY #
  51. CONTROL EJECT;
  52.  
  53. CONTROL IFEQ MULTI,1; # IF MULTI USER FSE VIRTERM #
  54. XREF ARRAY RENTSTK [1:MAXREENT] P(1); # SUBROUTINE STACK #
  55. BEGIN # ARRAY RENTSTK #
  56. ITEM RSTK I; # STACK WORD #
  57. END # ARRAY RENTSTK #
  58. XREF ITEM RSTKPTR I; # STACK POINTER #
  59. CONTROL FI; # END OF IF MULTI USER FSE #
  60.  
  61. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  62. ARRAY TDUFET [0:0] P(5); # FET TO READ ZZZZTRM FILE #
  63. BEGIN
  64. ITEM TDUNAME C(00,00,07) = ["ZZZZTRM"]; # FILE NAME #
  65. ITEM TDUCODE U(00,42,18) = [1]; # STATUS CODE #
  66. ITEM TDUFET1 U(01,00,42) = [0]; # FET + 1 #
  67. ITEM TDUFIRST U(01,42,18) = [0]; # FIRST #
  68. ITEM TDUFET2 U(02,00,42) = [0]; # FET + 2 #
  69. ITEM TDUIN U(02,42,18) = [0]; # IN #
  70. ITEM TDUFET3 U(03,00,42) = [0]; # FET + 3 #
  71. ITEM TDUOUT U(03,42,18) = [0]; # OUT #
  72. ITEM TDUFET4 U(04,00,42) = [0]; # FET + 4 #
  73. ITEM TDULIMIT U(04,42,18) = [0]; # LIMIT #
  74. END
  75.  
  76. DEF TDUBUFFLEN #O"301"#; # *TDU* BUFFER LENGTH #
  77.  
  78. ARRAY TDUBUF [0:0] P(TDUBUFFLEN);; # *TDU* BUFFER #
  79.  
  80. BASED ARRAY TEMPSTORE [0:0] P(1);
  81. BEGIN # USED TO MOVE *TDU* TABLE #
  82. ITEM TEMPWORD U; # WORD #
  83. END
  84.  
  85. ARRAY T3270RTA [0:63] P(1);
  86. BEGIN # 3270 RELATIVE TO ABSOLUTE #
  87. ITEM RTA3270 U(00,00,60) = [
  88. X"20", X"41", X"42", X"43", X"44", X"45", X"46", X"47",
  89. X"48", X"49", X"5B", X"2E", X"3C", X"28", X"2B", X"21",
  90. X"26", X"4A", X"4B", X"4C", X"4D", X"4E", X"4F", X"50",
  91. X"51", X"52", X"5D", X"24", X"2A", X"29", X"3B", X"5E",
  92. X"2D", X"2F", X"53", X"54", X"55", X"56", X"57", X"58",
  93. X"59", X"5A", X"7C", X"2C", X"25", X"5F", X"3E", X"3F",
  94. X"30", X"31", X"32", X"33", X"34", X"35", X"36", X"37",
  95. X"38", X"39", X"3A", X"23", X"40", X"27", X"3D", X"22" ];
  96. END
  97.  
  98. ARRAY T3270ATR [0:127] P(1);
  99. BEGIN # 3270 ABSOLUTE TO RELATIVE #
  100. ITEM ATR3270 U(00,00,60) = [
  101. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 00-07 #
  102. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 08-0F #
  103. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 10-17 #
  104. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 18-1F #
  105. X"00", X"0F", X"3F", X"3B", X"1B", X"2C", X"10", X"3D", # 20-27 #
  106. X"0D", X"1D", X"1C", X"0E", X"2B", X"20", X"0B", X"21", # 28-2F #
  107. X"30", X"31", X"32", X"33", X"34", X"35", X"36", X"37", # 30-30 #
  108. X"38", X"39", X"3A", X"1E", X"0C", X"3E", X"2E", X"2F", # 38-3F #
  109. X"3C", X"01", X"02", X"03", X"04", X"05", X"06", X"07", # 40-40 #
  110. X"08", X"09", X"11", X"12", X"13", X"14", X"15", X"16", # 48-4F #
  111. X"17", X"18", X"19", X"22", X"23", X"24", X"25", X"26", # 50-50 #
  112. X"27", X"28", X"29", X"0A", X"00", X"1A", X"1F", X"2D", # 58-5F #
  113. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 60-60 #
  114. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 68-6F #
  115. X"00", X"00", X"00", X"00", X"00", X"00", X"00", X"00", # 70-70 #
  116. X"00", X"00", X"00", X"00", X"2A", X"00", X"00", X"00" ]; # 78-7F #
  117. END
  118.  
  119. CONTROL FI; # END OF NOT MULTI USER FSE #
  120. CONTROL EJECT;
  121.  
  122. XDEF
  123. BEGIN
  124. *CALL COMFXVT
  125. *IF DEF,QTRM
  126. PROC VDTWTO; # WRITE ONE WORD OF OUTPUT #
  127. *ENDIF
  128. END
  129.  
  130. XREF
  131. BEGIN
  132. *IF DEF,QTRM
  133. PROC PF; # GET PERMANENT FILE #
  134. PROC SCRCCK; # VALIDATE TERMINAL CAPSULE #
  135. PROC SCRLCP; # LOAD TERMINAL CAPSULE #
  136. PROC SCRUGD; # UNLOAD GROUP DIRECTORY #
  137. PROC SFDQUE; # QTRM DEQUEUE #
  138. PROC SFNQUE; # QTRM ENQUEUE #
  139. PROC VDTGTO; # GET TERMINAL ORDINAL #
  140. *ENDIF
  141. *IF DEF,DEBUG
  142. PROC VDTDMP$; # DUMP OUTPUT TO XXXDUMP #
  143. *ENDIF
  144. PROC VDTGSL; # GET OS SCREEN LINE MODE #
  145. PROC VDTGTA; # GET *TDU* TABLE ADDRESS #
  146. PROC VDTRDO; # READ ONE WORD OF INPUT #
  147. PROC VDTRD$; # READ FILE TO CIO BUFFER #
  148. PROC VDTREO$; # READ WORD FROM CIO BUFFER #
  149. PROC VDTWRR$; # WRITE END OF RECORD #
  150. *IF UNDEF,QTRM
  151. PROC VDTWTO; # WRITE ONE WORD OF OUTPUT #
  152. *ENDIF
  153. PROC VDTWTC; # WRITE ONE LINE OF OUTPUT #
  154. END
  155.  
  156. CONTROL IFEQ EDITORVDT,0;
  157. XREF
  158. BEGIN
  159. PROC VDTABT$; # ABORT THE CALLING ROUTINE #
  160. PROC VDTCLO; # DO WRITER ON OUTPUT FET #
  161. PROC VDTMSG$; # MESSAGE MACRO #
  162. END
  163. CONTROL FI;
  164.  
  165. *IF UNDEF,QTRM
  166. CONTROL IFEQ SINGLE,1;
  167. CONTROL IFEQ EDITORVDT,1;
  168. XREF
  169. BEGIN
  170. PROC VDTCLO; # DO WRITER ON OUTPUT FET #
  171. PROC VDTPRT$; # PROMPT ON/OFF #
  172. END
  173. CONTROL FI;
  174. CONTROL FI;
  175. *ENDIF
  176.  
  177. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  178. XREF
  179. BEGIN
  180. PROC VDTRWD; # REWIND FILE #
  181. END
  182. CONTROL FI;
  183. CONTROL EJECT;
  184.  
  185. DEF XPARENTOUT #O"00070000000000000000"#; # XPARENT OUTPUT #
  186.  
  187. *CALL COMFVDT
  188. # COMMON DATA BLOCK #
  189. *IFCALL EDITOR,COMFDS1
  190. *IFCALL EDITOR,COMFVD2
  191. *IFCALL EDITOR,COMFDS2
  192.  
  193. *NIFCALL EDITOR,COMFVD1
  194. *NIFCALL EDITOR,COMFVD2
  195. *NIFCALL EDITOR,COMFVD3
  196.  
  197. CONTROL IFEQ SINGLE,1;
  198. CONTROL IFEQ EDITORVDT,1;
  199. ARRAY ENABLEMMSG [0:3] P(1); # ENABLE MULTI-MSG TRANSPARENT #
  200. BEGIN
  201. ITEM MULTIMSG I = [ # TERMDEF CODES #
  202. O"0016 4070 4001 4071 4011", # XPT CHAR, UPPER BITS 2500D #
  203. O"4072 4304 4073 4015 4074", # LOWER BITS 2500D, CR DEL #
  204. O"4000 4105 4377 4106 4001", # NO TIMEOUT, R.O. DEL, M-MSG #
  205. O"4064 4001 0000 0000 0000" ]; # START TRANSPARENT #
  206. END
  207.  
  208. ARRAY DISABLMMSG [0:3] P(1); # DISABLE MULTI-MSG TRANSPARENT #
  209. BEGIN
  210. ITEM SINGLEMSG I = [ # TERMDEF CODES #
  211. O"0016 4070 4001 4071 4011", # XPT CHAR, UPPER BITS 2500D #
  212. O"4072 4304 4073 4015 4074", # LOWER BITS 2500D, CR DEL #
  213. O"4000 4105 4377 4106 4000", # NO TIMEOUT, R.O. DEL, S-MSG #
  214. O"4064 4000 0000 0000 0000" ]; # END TRANSPARENT #
  215. END
  216. CONTROL FI;
  217. CONTROL FI;
  218. CONTROL EJECT;
  219.  
  220. CONTROL IFEQ EDITORVDT,0; # PROCEDURES NOT NEEDED BY FSE #
  221.  
  222. PROC VDTBOI(ORDINAL);
  223.  
  224. # TITLE VDTBOI - BEGINNING OF INPUT. #
  225.  
  226. BEGIN # VDTBOI #
  227.  
  228. #
  229. ** VDTBOI - BEGINNING OF INPUT.
  230. *
  231. * THIS PROCEDURES PROVIDES THE ABILITY TO START AND MONITOR
  232. * INPUT SEQUENCES. IT IS IDENTICAL TO PROCEDURE *VDTPPI* EX-
  233. * CEPT THAT IT RETURNS AN ORDINAL.
  234. *
  235. * PROC VDTBOI(ORDINAL)
  236. *
  237. * EXIT ORDINAL = 0, IF TRANSPARENT INPUT RECEIVED OK.
  238. * = NON ZERO, IF TYPEAHEAD.
  239. *
  240. * CALLS VDTPPI.
  241. *
  242. * USES VTORDN.
  243. #
  244.  
  245. ITEM ORDINAL I; # VTORDN #
  246.  
  247. VDTPPI; # PRE-PROCESS INPUT #
  248. IF VTINPDATA EQ 0 THEN VTORDN = 1; # NULL TYPEAHEAD #
  249. ORDINAL = VTORDN;
  250.  
  251. END # VDTBOI #
  252. CONTROL EJECT;
  253.  
  254. PROC VDTBOX(ORDINAL);
  255.  
  256. # TITLE VDTBOX - OUTPUT LINE DRAWING CHARACTER. #
  257.  
  258. BEGIN # VDTBOX #
  259.  
  260. #
  261. ** VDTBOX - OUTPUT LINE DRAWING CHARACTER.
  262. *
  263. * THIS PROCEDURE OUTPUTS LINE DRAWING CHARACTERS BY ORDINAL.
  264. *
  265. * PROC VDTBOX(ORDINAL)
  266. *
  267. * CALLS VDCTRL.
  268. #
  269.  
  270. ITEM ORDINAL I; # LINE DRAWING CHARACTER ORDINAL #
  271.  
  272. IF ORDINAL GQ 0 AND ORDINAL LQ 11 THEN
  273. BEGIN # IF VALID ORDINAL #
  274. VDCTRL(OUT"LDFHORIZON" + ORDINAL + (13 * (BOXWEIGHT - 1)));
  275. END
  276.  
  277. END # VDTBOX #
  278. CONTROL EJECT;
  279.  
  280. PROC VDTCAA(NEWMASK);
  281.  
  282. # TITLE VDTCAA - CHANGE ALL ATTRIBUTES. #
  283.  
  284. BEGIN # VDTCAA #
  285.  
  286. #
  287. ** VDTCAA - CHANGE ALL ATTRIBUTES.
  288. *
  289. * THIS PROCEDURE CHANGES THE CURRENT ATTRIBUTE MASK.
  290. *
  291. * PROC VDTCAA(NEWMASK)
  292. #
  293. ITEM NEWMASK U; # NEW ATTRIBUTE MASK #
  294.  
  295. ATTRIBMASK[0] = NEWMASK; # SET NEW ATTRIBUTE MASK #
  296.  
  297. END # VDTCAA #
  298. *IF DEF,ECHO
  299. CONTROL EJECT;
  300.  
  301. PROC VDTCLR;
  302.  
  303. # TITLE VDTCLR - CLEAR TO END OF SCREEN. #
  304.  
  305. BEGIN # VDTCLR #
  306.  
  307. #
  308. ** VDTCLR - CLEAR TO END OF SCREEN.
  309. *
  310. * THIS PROCEDURE CLEARS THE SCREEN FROM THE CURRENT CURSOR
  311. * POSITION TO THE END OF THE SCREEN AND POSITIONS THE CURSOR
  312. * TO THE HOME POSITION.
  313. *
  314. * PROC VDTCLR
  315. *
  316. * EXIT VTXCUR = 0.
  317. * VTYCUR = 0 OR VTYMAX.
  318. *
  319. * CALLS VDCTRL, VDTBOO, VDTHOM.
  320. #
  321.  
  322. VDTBOO; # BEGIN OUTPUT SEQUENCE #
  323. VDCTRL(OUT"CLREOS"); # CLEAR TO END OF SCREEN #
  324. VDTHOM; # POSITION CURSOR TO HOME #
  325.  
  326. END # VDTCLR #
  327. CONTROL EJECT;
  328.  
  329. PROC VDTCUD;
  330.  
  331. # TITLE VDTCUD - MOVE CURSOR DOWN ONE POSITION. #
  332.  
  333. BEGIN # VDTCUD #
  334.  
  335. #
  336. ** VDTCUD - MOVE CURSOR DOWN ONE POSITION.
  337. *
  338. * THIS PROCEDURE MOVES THE CURSOR DOWN ONE POSITION.
  339. *
  340. * PROC VDTCUD
  341. *
  342. * EXIT VTYCUR AND VTXCUR ADJUSTED IF NECESSARY.
  343. *
  344. * CALLS VDCTRL.
  345. *
  346. * USES VTXCUR, VTYCUR.
  347. *
  348. * NOTES IF MOVING THE CURSOR DOWN ONE POSITON WILL CAUSE
  349. * THE TERMINAL TO SCROLL, OR THE CURSOR TO GO HOME
  350. * (OR IF THE CURSOR WILL STOP) THIS IS A NOOP.
  351. #
  352.  
  353. IF VTYCUR EQ VTYMAX THEN
  354. BEGIN # IF PRESENTLY ON LAST LINE #
  355. IF TABDWNCRSR[0] GQ CURSORMOVE"SPIRAL" THEN
  356. BEGIN # IF NOT STOP, SCROLL OR HOME #
  357. VTYCUR = 0; # CURSOR WILL MOVE TO FIRST LINE #
  358. IF TABDWNCRSR[0] EQ CURSORMOVE"SPIRAL" THEN VTXCUR = VTXCUR + 1;
  359. VDCTRL(OUT"CURSORDOWN"); # MOVE CURSOR DOWN #
  360. END
  361. END
  362. ELSE
  363. BEGIN # NOT YET AT BOTTOM OF SCREEN #
  364. VTYCUR = VTYCUR + 1; # ADJUST POSITION #
  365. VDCTRL(OUT"CURSORDOWN"); # MOVE CURSOR DOWN #
  366. END
  367.  
  368. END # VDTCUD #
  369. CONTROL EJECT;
  370.  
  371. PROC VDTCUL;
  372.  
  373. # TITLE VDTCUL - MOVE CURSOR LEFT ONE POSITION. #
  374.  
  375. BEGIN # VDTCUL #
  376.  
  377. #
  378. ** VDTCUL - MOVE CURSOR LEFT ONE POSITION.
  379. *
  380. * THIS PROCEDURE MOVES THE CURSOR LEFT ONE POSITION.
  381. *
  382. * PROC VDTCUL
  383. *
  384. * EXIT VTXCUR AND VTYCUR ADJUSTED IF NECESSARY.
  385. *
  386. * CALLS VDCTRL, VDTCUU.
  387. *
  388. * USES VTXCUR, VTYCUR.
  389. *
  390. * NOTES IF MOVING THE CURSOR LEFT ONE POSITON WILL CAUSE
  391. * THE TERMINAL TO SCROLL, OR THE CURSOR TO GO HOME
  392. * (OR IF THE CURSOR WILL STOP) THIS IS A NOOP.
  393. #
  394.  
  395. IF VTXCUR EQ 0 THEN
  396. BEGIN # IF PRESENTLY IN FIRST COLUMN #
  397. IF TABLEFTCUR[0] GQ CURSORMOVE"SPIRAL" THEN
  398. BEGIN # IF NOT STOP, SCROLL OR HOME #
  399. VTYCUR = VTYMAX; # CURSOR MOVES TO LAST COLUMN #
  400. IF TABLEFTCUR[0] EQ CURSORMOVE"SPIRAL" THEN VTYCUR = VTYCUR - 1;
  401. VDCTRL(OUT"CURSORLEFT"); # MOVE CURSOR LEFT #
  402. END
  403. END
  404. ELSE
  405. BEGIN # NOT YET AT LEFT SIDE OF SCREEN #
  406. VTXCUR = VTXCUR - 1; # ADJUST POSITION #
  407. VDCTRL(OUT"CURSORLEFT"); # MOVE CURSOR LEFT #
  408. END
  409.  
  410. END # VDTCUL #
  411. CONTROL EJECT;
  412.  
  413. PROC VDTCUR;
  414.  
  415. # TITLE VDTCUR - MOVE CURSOR RIGHT ONE POSITION. #
  416.  
  417. BEGIN # VDTCUR #
  418.  
  419. #
  420. ** VDTCUR - MOVE CURSOR RIGHT ONE POSITION.
  421. *
  422. * THIS PROCEDURE MOVES THE CURSOR RIGHT ONE POSITION.
  423. *
  424. * PROC VDTCUR
  425. *
  426. * EXIT VTXCUR AND VTYCUR ADJUSTED IF NECESSARY.
  427. *
  428. * CALLS VDCTRL.
  429. *
  430. * USES VTXCUR, VTYCUR.
  431. *
  432. * NOTES IF MOVING THE CURSOR RIGHT ONE POSITON WILL CAUSE
  433. * THE TERMINAL TO SCROLL, OR THE CURSOR TO GO HOME
  434. * (OR IF THE CURSOR WILL STOP) THIS IS A NOOP.
  435. #
  436.  
  437. IF VTXCUR EQ VTXMAX THEN
  438. BEGIN # IF PRESENTLY IN LAST COLUMN #
  439. IF TABRGHTCUR[0] GQ CURSORMOVE"SPIRAL" THEN
  440. BEGIN # IF NOT STOP, SCROLL OR HOME #
  441. VTYCUR = 0; # CURSOR MOVES TO FIRST COLUMN #
  442. IF TABRGHTCUR[0] EQ CURSORMOVE"SPIRAL" THEN VTYCUR = VTYCUR + 1;
  443. VDCTRL(OUT"CURSORIGHT"); # MOVE CURSOR RIGHT #
  444. END
  445. END
  446. ELSE
  447. BEGIN # NOT AT RIGHT SIDE OF SCREEN #
  448. VTXCUR = VTXCUR + 1; # ADJUST POSITION #
  449. VDCTRL(OUT"CURSORIGHT"); # MOVE CURSOR RIGHT #
  450. END
  451.  
  452. END # VDTCUR #
  453. CONTROL EJECT;
  454.  
  455. PROC VDTCUU;
  456.  
  457. # TITLE VDTCUU - MOVE CURSOR UP ONE POSITION. #
  458.  
  459. BEGIN # VDTCUU #
  460.  
  461. #
  462. ** VDTCUU - MOVE CURSOR UP ONE POSTION.
  463. *
  464. * THIS PROCEDURE MOVES THE CURSOR UP ONE POSITION.
  465. *
  466. * PROC VDTCUU
  467. *
  468. * EXIT VTYCUR AND VTXCUR ADJUSTED IF NECESSARY.
  469. *
  470. * CALLS VDCTRL.
  471. *
  472. * USES VTXCUR, VTYCUR
  473. *
  474. * NOTES IF MOVING THE CURSOR UP ONE POSITON WILL CAUSE
  475. * THE TERMINAL TO SCROLL, OR THE CURSOR TO GO HOME
  476. * (OR IF THE CURSOR WILL STOP) THIS IS A NOOP.
  477. #
  478.  
  479. IF VTYCUR EQ 0 THEN
  480. BEGIN # IF PRESENTLY ON FIRST LINE #
  481. IF TABUPCURSR[0] GQ CURSORMOVE"SPIRAL" THEN
  482. BEGIN # IF NOT STOP, SCROLL OR HOME #
  483. VTYCUR = VTYMAX; # CURSOR WILL MOVE TO LAST LINE #
  484. IF TABUPCURSR[0] EQ CURSORMOVE"SPIRAL" THEN VTXCUR = VTXCUR - 1;
  485. VDCTRL(OUT"CURSORUP"); # MOVE CURSOR UP #
  486. END
  487. END
  488. ELSE
  489. BEGIN # NOT YET AT TOP OF SCREEN #
  490. VTYCUR = VTYCUR - 1; # ADJUST POSITION #
  491. VDCTRL(OUT"CURSORUP"); # MOVE CURSOR UP #
  492. END
  493.  
  494. END # VDTCUU #
  495. CONTROL EJECT;
  496.  
  497. PROC VDTDEC;
  498.  
  499. # TITLE VDTDEC - DELETE ONE CHARACTER. #
  500.  
  501. BEGIN # VDTDEC #
  502.  
  503. #
  504. ** VDTDEC - DELETE ONE CHARACTER.
  505. *
  506. * THIS PROCEDURE DELETES ONE CHARACTER FROM THE TEXT ON THE SCREEN
  507. * SHIFTING EXISTING TEXT THAT WAS TO THE RIGHT OF THE CHARACTER ONE
  508. * POSITION TO THE LEFT.
  509. *
  510. * PROC VDTDEC
  511. *
  512. * CALLS VDCTRL.
  513. #
  514.  
  515. VDCTRL(OUT"DELETECHAR"); # DELETE CHARACTER #
  516.  
  517. END # VDTDEC #
  518. CONTROL EJECT;
  519.  
  520. PROC VDTDEL;
  521.  
  522. # TITLE VDTDEL - DELETE ONE LINE. #
  523.  
  524. BEGIN # VDTDEL #
  525.  
  526. #
  527. ** VDTDEL - DELETE ONE LINE.
  528. *
  529. * THIS PROCEDURE DELETES THE LINE THAT THE CURSOR IS ON AND
  530. * MOVES THE REMAINING LINES BELOW THE DELETED AREA UP ONE,
  531. * POSITIONING THE CURSOR TO THE START OF THE LINE.
  532. *
  533. * PROC VDTDEL
  534. *
  535. * CALLS VDCTRL, VDMOVE.
  536. *
  537. * USES VTXCUR.
  538. #
  539.  
  540. VDCTRL(OUT"DELINECURL"); # DELETE LINE, CURSOR LEFT #
  541. IF NUMBERBYTE EQ 0 THEN
  542. BEGIN # IF NO FUNCTION AVAILABLE #
  543. VDCTRL(OUT"DELETELINE"); # DELETE LINE #
  544. IF NUMBERBYTE NQ 0 AND VTXCUR NQ 0 THEN
  545. BEGIN # IF POSITION NEEDS UPDATE #
  546. VTXCUR = 0; # CLEAR X POSITION #
  547. VDMOVE(VTXCUR,VTYCUR); # POSITION CURSOR #
  548. END
  549. END
  550. ELSE
  551. BEGIN # FUNCTION AVAILABLE #
  552. VTXCUR = 0; # CLEAR X POSITION #
  553. END
  554.  
  555. END # VDTDEL #
  556. *ENDIF
  557. CONTROL EJECT;
  558.  
  559. PROC VDTDRW(WEIGHT);
  560.  
  561. # TITLE VDTDRW - SET LINE DRAWING CHARACTER SET. #
  562.  
  563. BEGIN # VDTDRW #
  564.  
  565. #
  566. ** VDTDRW - SET LINE DRAWING CHARACTER SET.
  567. *
  568. * THIS PROCEDURE SETS OR CLEARS THE LINE DRAWING CHARACTER SET FOR
  569. * THOSE TERMINALS THAT HAVE A LINE DRAWING CHARACTER SET.
  570. *
  571. * PROC VDTDRW(WEIGHT)
  572. *
  573. * ENTRY BOXWEIGHT = CURRENT LINE DRAWING WEIGHT.
  574. * WEIGHT = REQUESTED LINE DRAWING WEIGHT.
  575. * = 0, IF TURNING OFF LINE DRAWING.
  576. * = 1, IF FINE LINE DRAWING REQUESTED.
  577. * = 2, IF MEDIUM LINE DRAWING REQUESTED.
  578. * = 3, IF BOLD LINE DRAWING REQUESTED.
  579. *
  580. * EXIT BOXWEIGHT = CURRENT LINE DRAWING WEIGHT.
  581. *
  582. * CALLS VDCTRL.
  583. #
  584.  
  585. ITEM WEIGHT I; # LINE DRAWING WEIGHT #
  586.  
  587. IF WEIGHT GQ 0 AND WEIGHT LQ 3 AND WEIGHT NQ BOXWEIGHT THEN
  588. BEGIN # IF VALID CHANGE REQUESTED #
  589. IF BOXWEIGHT GR 0 THEN
  590. BEGIN # IF LINE DRAWING IS ON #
  591. VDCTRL(OUT"LDFINEOFF"+((BOXWEIGHT-1)*13));
  592. END
  593. IF WEIGHT GR 0 THEN
  594. BEGIN # IF NEW WEIGHT REQUESTED #
  595. VDCTRL(OUT"LDFINEON"+((WEIGHT-1)*13));
  596. END
  597. BOXWEIGHT = WEIGHT; # SAVE NEW BOX WEIGHT #
  598. END
  599.  
  600. END # VDTDRW #
  601. *IF DEF,ECHO
  602. CONTROL EJECT;
  603.  
  604. PROC VDTEOI;
  605.  
  606. # TITLE VDTEOI - END OF INFORMATION. #
  607.  
  608. BEGIN # VDTEOI #
  609.  
  610. #
  611. ** VDTEOI - END OF INFORMATION.
  612. *
  613. * THIS PROCEDURE SENDS AN END OF INFORMATION BYTE.
  614. *
  615. * PROC VDTEOI
  616. *
  617. * CALLS VDTOUT.
  618. #
  619.  
  620. VDTOUT(X"00"); # END OF INFORMATION BYTE #
  621.  
  622. END # VDTEOI #
  623. CONTROL EJECT;
  624.  
  625. PROC VDTERC;
  626.  
  627. # TITLE VDTERC - ERASE CHARACTER. #
  628.  
  629. BEGIN # VDTERC #
  630.  
  631. #
  632. ** VDTERC - ERASE CHARACTER.
  633. *
  634. * THIS PROCEDURE MOVES THE CURSOR LEFT ONE POSITION AND
  635. * CLEARS THE (UNPROTECTED) CHARACTER IN THAT POSITION.
  636. *
  637. * PROC VDTERC
  638. *
  639. * EXIT VTXCUR AND VTYCUR ADJUSTED IF NECESSARY.
  640. *
  641. * CALLS VDCTRL.
  642. #
  643.  
  644. VDCTRL(OUT"ERASECHAR");
  645.  
  646. VTXCUR = VTXCUR - 1;
  647. IF VTXCUR LS 0 THEN
  648. BEGIN # IF OFF LEFT SIDE OF SCREEN #
  649. IF TABLEFTCHR[0] GQ CURSORMOVE"SPIRAL" THEN
  650. BEGIN # IF WRAP OR SPIRAL #
  651. VTXCUR = VTXMAX; # CURSOR IS IN LAST COLUMN #
  652. IF TABLEFTCHR[0] EQ CURSORMOVE"SPIRAL" THEN VTYCUR = VTYCUR - 1;
  653. END
  654. ELSE
  655. BEGIN # CURSOR HAS STOPPED AT LEFT #
  656. VTXCUR = 0; # CURSOR IS IN FIRST COLUMN #
  657. END
  658. END
  659.  
  660. END # VDTERC #
  661. CONTROL EJECT;
  662.  
  663. PROC VDTERL;
  664.  
  665. # TITLE VDTERL - ERASE LINE. #
  666.  
  667. BEGIN # VDTERL #
  668.  
  669. #
  670. ** VDTERL - ERASE LINE.
  671. *
  672. * THIS PROCEDURE ERASES THE UNPROTECTED AREAS OF THE ACTIVE LINE.
  673. *
  674. * PROC VDTERL
  675. *
  676. * EXIT VTXCUR = 0.
  677. *
  678. * CALLS VDTCLL, VDCTRL, VDMOVE.
  679. *
  680. * USES VTXCUR.
  681. #
  682.  
  683. VDCTRL(OUT"ERASELNECL"); # ERASE LINE, CURSOR LEFT #
  684. IF NUMBERBYTE EQ 0 THEN
  685. BEGIN # IF NO FUNCTION AVAILABLE #
  686. IF VTXCUR NQ 0 THEN
  687. BEGIN # IF NOT AT START OF LINE #
  688. VTXCUR = 0; # SET X POSITION #
  689. VDMOVE(VTXCUR,VTYCUR); # POSITION CURSOR #
  690. END
  691. VDCTRL(OUT"ERASELINE"); # ERASE LINE #
  692. IF NUMBERBYTE EQ 0 THEN
  693. BEGIN # IF NO FUNCTION AVAILABLE #
  694. VDTCLL(VTXCUR,VTYCUR); # CLEAR LINE #
  695. END
  696. END
  697. ELSE
  698. BEGIN
  699. VTXCUR = 0; # CLEAR X POSITION #
  700. END
  701.  
  702. END # VDTERL #
  703. *ENDIF
  704. CONTROL EJECT;
  705.  
  706. PROC VDTGTF(WORD,INDEX);
  707.  
  708. # TITLE VDTGTF - GET TERMINAL ATTRIBUTE FLAGS. #
  709.  
  710. BEGIN # VDTGTF #
  711.  
  712. #
  713. ** VDTGTF - GET TERMINAL ATTRIBUTE FLAGS.
  714. *
  715. * THIS PROCEDURE RETURNS *TDU* TERMINAL ATTRIBUTE FLAGS.
  716. *
  717. * PROC VDTGTF(WORD,INDEX)
  718. *
  719. * EXIT WORD = TERMINAL ATTRIBUTE WORD FROM *TDU* TABLE.
  720. #
  721. ITEM WORD U; # TERMINAL ATTRIBUTE WORD #
  722. ITEM INDEX I; # INDEX INTO *TDU* TABLE #
  723.  
  724. WORD = TABHEADONE[INDEX]; # RETURN WORD FROM TABLE #
  725.  
  726. END # VDTGTF #
  727. *IF DEF,ECHO
  728. CONTROL EJECT;
  729.  
  730. PROC VDTINC;
  731.  
  732. # TITLE VDTINC - INSERT ONE SPACE CHARACTER. #
  733.  
  734. BEGIN # VDTINC #
  735.  
  736. #
  737. ** VDTINC - INSERT ONE SPACE CHARACTER.
  738. *
  739. * THIS PROCEDURE INSERTS ONE BLANK CHARACTER INTO THE TEXT ON THE
  740. * SCREEN, SHIFTING EXISTING TEXT PAST THE CURSOR ONE POSITION TO
  741. * THE RIGHT.
  742. *
  743. * PROC VDTINC
  744. *
  745. * CALLS VDCTRL.
  746. #
  747.  
  748. VDCTRL(OUT"INSERTCHAR"); # INSERT CHARACTER #
  749.  
  750. END # VDTINC #
  751. CONTROL EJECT;
  752.  
  753. PROC VDTINL;
  754.  
  755. # TITLE VDTINL - INSERT ONE BLANK LINE. #
  756.  
  757. BEGIN # VDTINL #
  758.  
  759. #
  760. ** VDTINL - INSERT ONE BLANK LINE.
  761. *
  762. * THIS PROCEDURE INSERTS A BLANK LINE, MOVING THE LINE THAT
  763. * THE CURSOR IS ON AND ALL FOLLOWING LINES DOWN ONE, POS-
  764. * TIONING THE CURSOR TO THE START OF THE LINE.
  765. *
  766. * PROC VDTINL
  767. *
  768. * CALLS VDCTRL, VDMOVE.
  769. *
  770. * USES VTXCUR.
  771. #
  772.  
  773. VDCTRL(OUT"INSLNECURL"); # INSERT LINE, CURSOR LEFT #
  774. IF NUMBERBYTE EQ 0 THEN
  775. BEGIN # IF NO FUNCTION AVAILABLE #
  776. VDCTRL(OUT"INSERTLINE"); # INSERT LINE #
  777. IF NUMBERBYTE NQ 0 AND VTXCUR NQ 0 THEN
  778. BEGIN # IF POSITION NEEDS UPDATE #
  779. VTXCUR = 0; # CLEAR X POSITION #
  780. VDMOVE(VTXCUR,VTYCUR); # POSITION CURSOR #
  781. END
  782. END
  783. ELSE
  784. BEGIN # FUNCTION AVAILABLE #
  785. VTXCUR = 0; # CLEAR X POSITION #
  786. END
  787.  
  788. END # VDTINL #
  789. *ENDIF
  790. CONTROL EJECT;
  791.  
  792. PROC VDTINP(ORDINAL,COLUMN,LINE,CHAR,N);
  793.  
  794. # TITLE VDTINP - IDENTIFY NEXT VIRTUAL INPUT EVENT. #
  795.  
  796. BEGIN # VDTINP #
  797.  
  798. #
  799. ** VDTINP - IDENTIFY NEXT VIRTUAL INPUT EVENT.
  800. *
  801. * THIS PROCEDURE INDENTIFIES THE NEXT VIRTUAL TERMINAL INPUT
  802. * EVENT. THIS REQUIRES THAT *VDTBOI* MUST BE CALLED FIRST TO
  803. * SET UP FOR INPUT EVENTS.
  804. *
  805. * PROC VDTINP(ORDINAL,COLUMN,LINE,CHAR,N)
  806. *
  807. * ENTRY VTINCR = RESIDUAL CURSOR INCREMENT.
  808. * VTXMAX = NUMBER OF COLUMNS ON SCREEN.
  809. * VTYMAX = NUMBER OF LINES ON SCREEN.
  810. *
  811. * EXIT ORDINAL = EVENT CATEGORY.
  812. * CHAR = DATA CHARACTER, OR FUNCTION ORDINAL.
  813. * COLUMN = COLUMN CURSOR POSITION.
  814. * LINE = LINE CURSOR POSITION.
  815. * N = INCREMENTAL CURSOR MOVEMENT.
  816. *
  817. * CALLS VDTIINP.
  818. #
  819.  
  820. ITEM ORDINAL I; # EVENT CATEGORY #
  821. ITEM COLUMN I; # COLUMN POSITION #
  822. ITEM LINE I; # LINE POSITION #
  823. ITEM CHAR I; # DATA CHARACTER #
  824. ITEM N I; # INCREMENTAL CURSOR MOVEMENT #
  825.  
  826. VDTIINP; # PERFORM INPUT SEQUENCE #
  827. ORDINAL = VTORDN;
  828. COLUMN = VTXCUR;
  829. LINE = VTYCUR;
  830. CHAR = VTCHAR;
  831. N = VTDELT;
  832.  
  833. END # VDTINP #
  834. CONTROL EJECT;
  835.  
  836. PROC VDTPRO(ORD);
  837.  
  838. # TITLE VDTPRO - SET PROTECTION. #
  839.  
  840. BEGIN # VDTPRO #
  841.  
  842. #
  843. ** VDTPRO - SET PROTECTION.
  844. *
  845. * THIS PROCEDURE ISSUES OUTPUT SEQUENCES DEALING WITH PROTECT.
  846. *
  847. * PROC VDTPRO(ORD)
  848. *
  849. * ENTRY ORD = OUTPUT SEQUENCE ORDINAL FOR PROTECT
  850. * ALL, BEGIN DISPLAY OR END DISPLAY.
  851. *
  852. * EXIT REQUESTED SEQUENCE ISSUED.
  853. *
  854. * CALLS VDCTRL.
  855. #
  856. ITEM ORD I; # OUTPUT SEQUENCE ORDINAL #
  857.  
  858. VDCTRL(ORD); # ISSUE REQUESTED SEQUENCE #
  859.  
  860. END # VDTPRO #
  861. CONTROL EJECT;
  862.  
  863. PROC VDTPSU;
  864.  
  865. # TITLE VDTPSU - PSEUDO UNDERLINE. #
  866.  
  867. BEGIN # VDTPSU #
  868.  
  869. #
  870. ** VDTPSU - PSEUDO UNDERLINE.
  871. *
  872. * THIS PROCEDURE ALLOWS INPUT FIELDS TO BE SEEN ON DUMB TERMINALS
  873. * BY TURNING THE BLANK AREA OF AN INPUT FIELD INTO UNDERSCORES.
  874. *
  875. * PROC VDTPSU
  876. *
  877. * ENTRY VTPSUNDACT = TRUE, IF PSEUDO UNDERLINING.
  878. *
  879. * EXIT BLANK OR UNDERSCORE OUTPUT AS NECESSARY.
  880. #
  881.  
  882. IF VTPSUNDACT[0] THEN
  883. BEGIN # IF PSEUDO UNDERLINING #
  884. VDTCHR(O"0137");
  885. END
  886. ELSE
  887. BEGIN # JUST A BLANK #
  888. VDTCHR(O"0040");
  889. END
  890.  
  891. END # VDTPSU #
  892. *IF DEF,ECHO
  893. CONTROL EJECT;
  894.  
  895. PROC VDTRES;
  896.  
  897. # TITLE VDTRES - RESET. #
  898.  
  899. BEGIN # VDTRES #
  900.  
  901. #
  902. ** VDTRES - RESET.
  903. *
  904. * THIS PROCEDURE ISSUES A RESET SEQUENCE.
  905. *
  906. * PROC VDTRES
  907. *
  908. * CALLS VDCTRL.
  909. #
  910.  
  911. VDCTRL(OUT"RESET"); # ISSUE RESET SEQUENCE #
  912.  
  913. END # VDTRES #
  914. CONTROL EJECT;
  915.  
  916. PROC VDTRET;
  917.  
  918. # TITLE VDTRET - RETURN. #
  919.  
  920. BEGIN # VDTRET #
  921.  
  922. #
  923. ** VDTRET - RETURN.
  924. *
  925. * THIS PROCEDURE ISSUES A RETURN SEQUENCE.
  926. *
  927. * PROC VDTRET
  928. *
  929. * CALLS VDCTRL.
  930. #
  931.  
  932. VDCTRL(OUT"RET");
  933.  
  934. END # VDTRET #
  935. CONTROL EJECT;
  936.  
  937. PROC VDTTAB;
  938.  
  939. # TITLE VDTTAB - TAB FORWARD. #
  940.  
  941. BEGIN # VDTTAB #
  942.  
  943. #
  944. ** VDTTAB - TAB FORWARD.
  945. *
  946. * THIS PROCEDURE MOVES THE CURSOR TO THE NEXT TAB POSITION OR
  947. * UNPROTECTED FIELD.
  948. *
  949. * PROC VDTTAB
  950. *
  951. * CALLS VDCTRL.
  952. *
  953. * NOTES THE INTERNAL CURSOR POSITION IS INCORRECT AFTER
  954. * A TAB FUNCTION SO PROCEDURE VDTCOR MUST BE CALLED.
  955. #
  956.  
  957. VDCTRL(OUT"TABFORWARD"); # TAB FORWARD #
  958.  
  959. END # VDTTAB #
  960. CONTROL EJECT;
  961.  
  962. PROC VDTTBB;
  963.  
  964. # TITLE VDTTBB - TAB BACKWARD. #
  965.  
  966. BEGIN # VDTTBB #
  967.  
  968. #
  969. ** VDTTBB - TAB BACKWARD.
  970. *
  971. * THIS PROCEDURE MOVES THE CURSOR TO THE PREVIOUS TAB POSITION
  972. * OR UNPROTECTED FIELD.
  973. *
  974. * PROC VDTTBB
  975. *
  976. * CALLS VDCTRL.
  977. *
  978. * NOTES THE INTERNAL CURSOR POSITION IS INCORRECT AFTER
  979. * A TAB FUNCTION SO PROCEDURE VDTCOR MUST BE CALLED.
  980. #
  981.  
  982. VDCTRL(OUT"TABACKWARD"); # TAB BACKWARD #
  983.  
  984. END # VDTTBB #
  985. *ENDIF
  986.  
  987. CONTROL FI; # END OF SFORM ONLY PROCEDURES #
  988. CONTROL EJECT; # VDTTFF USED BY SFORM AND FSE #
  989.  
  990. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  991.  
  992. PROC VDTTFF(OUTORD,COUNT);
  993.  
  994. # TITLE VDTTFF - TEST FOR OUTPUT FUNCTION. #
  995.  
  996. BEGIN # VDTTFF #
  997.  
  998. #
  999. ** VDTTFF - TEST FOR OUTPUT FUNCTION.
  1000. *
  1001. * THIS PROCEDURE TESTS FOR A *TDU* DEFINED OUTPUT FUNCTION FOR A
  1002. * GIVEN ORDINAL.
  1003. *
  1004. * PROC VDTTFF(OUTORD,COUNT)
  1005. *
  1006. * ENTRY OUTORD = THE *TDU* OUPUT ORDINAL TO BE CHECKED.
  1007. *
  1008. * EXIT COUNT = THE NUMBER OF BYTES IN THE SEQUENCE.
  1009. #
  1010.  
  1011. ITEM OUTORD I; # *TDU* OUTPUT ORDINAL #
  1012. ITEM COUNT I; # BTYE COUNT FOR SEQUENCE #
  1013.  
  1014. ITEM TDUOFFSET I; # *TDU* OFFSET FOR SEQUENCE #
  1015. ITEM CHARINDEX I; # CHARACTER INDEX INTO WORD #
  1016. ITEM WORDINDEX I; # WORD INDEX INTP *TDU* TABLE #
  1017.  
  1018. IF OUTORD GR OUT"RESERVED" AND OUTORD LS OUT"LASTOUT" THEN
  1019. BEGIN # IF LEGAL OUTPUT ORDINAL #
  1020. WORDINDEX = OUTORD / 5; # GET OFFSET FOR ORDINAL #
  1021. CHARINDEX = 12 * (OUTORD - (WORDINDEX * 5));
  1022. TDUOFFSET = B<CHARINDEX,12>TABFULLWRD[WORDINDEX];
  1023. IF CHARINDEX NQ 48 THEN
  1024. BEGIN # IF NEXT BYTE IS IN SAME WORD #
  1025. COUNT = B<CHARINDEX+12,12>TABFULLWRD[WORDINDEX];
  1026. END
  1027. ELSE
  1028. BEGIN # GET BYTE FROM NEXT WORD #
  1029. COUNT = B<0,12>TABFULLWRD[WORDINDEX+1];
  1030. END
  1031. COUNT = COUNT - TDUOFFSET; # CALCULATE NUMBER OF BYTES #
  1032. IF COUNT LS 0 THEN COUNT = 0; # IF NEGATIVE COUNT, RETURN ZERO #
  1033. END
  1034. ELSE
  1035. BEGIN # IF ILLEGAL ORDINAL #
  1036. COUNT = 0; # RETURN ZERO COUNT #
  1037. END
  1038.  
  1039. END # VDTTFF #
  1040.  
  1041. CONTROL FI; # END OF IF NOT MULTI USER FSE #
  1042. CONTROL EJECT; # FSE USED PROCEDURE VDTAPS #
  1043. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VERSION OF VIRTERM #
  1044. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1045.  
  1046. PROC VDTAPS(NAME,STRING,LENGTH,STAT);
  1047.  
  1048. # TITLE VDTAPS - GET APPLICATION STRING FROM *TDU* TABLE. #
  1049.  
  1050. BEGIN # VDTAPS #
  1051.  
  1052. #
  1053. ** VDTAPS - GET APPLICATION STRING FROM *TDU* TABLE.
  1054. *
  1055. * THIS PROCEDURE GETS THE NEXT APPLICATION STRING FROM THE
  1056. * *TDU* TABLE.
  1057. *
  1058. * PROC VDTAPS(NAME,STRING,LENGTH,STAT)
  1059. *
  1060. * ENTRY NAME = NAME OF APPLICATION STRING REQUESTED.
  1061. * TDUINDEX = WORD COUNT READ SO FAR OF *TDU* TABLE.
  1062. * TDURESID = RESIDENT *TDU* TABLE FLAG.
  1063. *
  1064. * EXIT STRING = APPLICATION STRING (SEVEN BIT FORMAT).
  1065. * LENGTH = NUMBER OF CHARACTERS IN STRING.
  1066. * STAT = 0, IF NO ERROR.
  1067. * = 1, IF NO STRING.
  1068. * TDUINDEX = UPDATED.
  1069. *
  1070. * CALLS VDGETW.
  1071. *
  1072. * USES TDUINDEX.
  1073. #
  1074.  
  1075. ITEM NAME C(7); # NAME OF STRING #
  1076. ARRAY STRING [0:0] P(1);
  1077. BEGIN # APPLICATION STRING #
  1078. ITEM STRINGWORD U; # WORD #
  1079. END
  1080. ITEM LENGTH I; # NUMBER OF CHARACTERS #
  1081. ITEM STAT I; # STATUS RETURNED #
  1082.  
  1083. ITEM FOUND B; # FLAG #
  1084. ITEM COUNTER I; # COUNTER #
  1085. ITEM COUNTER2 I; # COUNTER2 #
  1086. ITEM COUNTER3 I; # COUNTER3 #
  1087. ITEM WORD U; # WORD FROM *TDU* TABLE #
  1088. ARRAY WORDEXP [0:0] P(1); # EXPANDED *TDU* TABLE WORD #
  1089. BEGIN
  1090. ITEM WORDFULL U(00,00,60); # FULL WORD #
  1091. ITEM WORDNAME C(00,00,07); # APPLICATION STRING NAME #
  1092. ITEM WORDCOUNT I(00,42,18); # CHARACTER COUNT #
  1093. END
  1094.  
  1095. STAT = 0;
  1096. IF TDUINDEX[0] GQ TABSTRINIT[0] THEN
  1097. BEGIN # IF PAST APPLICATION STRINGS #
  1098. STAT = 1; # NO MORE STRINGS #
  1099. END
  1100. ELSE
  1101. BEGIN
  1102. IF TDUINDEX[0] LS TABSTRAPPS THEN
  1103. BEGIN # IF NOT AT APPLICATION STRINGS #
  1104. COUNTER2 = TABSTRAPPS[0] - TDUINDEX[0];
  1105. FOR COUNTER = 0 STEP 1 UNTIL COUNTER2 - 1 DO
  1106. BEGIN # SKIP TO APPLICATION STRINGS #
  1107. VDGETW(WORD,STAT);
  1108. END
  1109. END
  1110. IF STAT EQ 0 THEN
  1111. BEGIN # IF NOT END OF TABLE #
  1112. FOUND = FALSE; # NOT FOUND YET #
  1113. FOR COUNTER = 0 STEP 1 WHILE STAT EQ 0 AND NOT FOUND DO
  1114. BEGIN
  1115. VDGETW(WORD,STAT); # GET APPLICATION STRING NAME #
  1116. WORDFULL = WORD;
  1117. IF WORDCOUNT[0] EQ 0 THEN
  1118. BEGIN # IF END OF APPLICATION STRINGS #
  1119. STAT = 1;
  1120. END
  1121. IF STAT EQ 0 THEN
  1122. BEGIN # IF NOT END OF TABLE #
  1123. COUNTER3 = (WORDCOUNT[0] + 7) / 8;
  1124. IF WORDNAME[0] NQ NAME THEN
  1125. BEGIN # IF NO MATCH ON NAME #
  1126. FOR COUNTER2 = 0 STEP 1 UNTIL COUNTER3 - 1 DO
  1127. BEGIN
  1128. VDGETW(WORD,STAT); # SKIP THROUGH STRING #
  1129. END
  1130. END
  1131. ELSE
  1132. BEGIN # IF NAME MATCHES #
  1133. FOR COUNTER2 = 0 STEP 1 UNTIL COUNTER3 - 1 DO
  1134. BEGIN
  1135. VDGETW(WORD,STAT); # GET WORD FROM *TDU* TABLE #
  1136. STRINGWORD[COUNTER2] = WORD;
  1137. END
  1138. LENGTH = WORDCOUNT[0];
  1139. FOUND = TRUE; # FOUND IT #
  1140. END
  1141. END
  1142. END
  1143. END
  1144. END
  1145.  
  1146. END # VDTAPS #
  1147. CONTROL FI; # END OF NOT MULTI USER FSE #
  1148. CONTROL FI; # END OF IF EDITOR VIRTERM #
  1149. CONTROL EJECT; # SFORM USED PROCEDURE VDTAPS #
  1150. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VIRTERM #
  1151. CONTROL IFEQ EDITORVDT,0; # IF NOT EDITOR VIRTERM #
  1152.  
  1153. PROC VDTAPS(NAME,STRING,LENGTH,STAT);
  1154.  
  1155. # TITLE VDTAPS - GET APPLICATION STRING FROM *TDU* TABLE. #
  1156.  
  1157. BEGIN # VDTAPS #
  1158.  
  1159. #
  1160. ** VDTAPS - GET APPLICATION STRING FROM *TDU* TABLE.
  1161. *
  1162. * THIS PROCEDURE GETS THE NEXT APPLICATION STRING FROM THE
  1163. * *TDU* TABLE.
  1164. *
  1165. * PROC VDTAPS(NAME,STRING,LENGTH,STAT)
  1166. *
  1167. * ENTRY NAME = NAME OF APPLICATION STRING REQUESTED.
  1168. * TDUINDEX = WORD COUNT READ SO FAR OF *TDU* TABLE.
  1169. * TDURESID = RESIDENT *TDU* TABLE FLAG.
  1170. *
  1171. * EXIT STRING = APPLICATION STRING (8/12 FORMAT).
  1172. * LENGTH = NUMBER OF CHARACTERS IN STRING.
  1173. * STAT = 0, IF NO ERROR.
  1174. * = 1, IF NO STRING.
  1175. * TDUINDEX = UPDATED.
  1176. *
  1177. * CALLS VDGETW.
  1178. *
  1179. * USES TDUINDEX.
  1180. #
  1181.  
  1182. ITEM NAME C(7); # NAME OF STRING #
  1183. ARRAY STRING [0:0] P(1);
  1184. BEGIN # APPLICATION STRING #
  1185. ITEM STRINGWORD U; # WORD #
  1186. END
  1187. ITEM LENGTH I; # NUMBER OF CHARACTERS #
  1188. ITEM STAT I; # STATUS RETURNED #
  1189.  
  1190. ITEM FOUND B; # FLAG #
  1191. ITEM COUNTER I; # COUNTER #
  1192. ITEM COUNTER2 I; # COUNTER2 #
  1193. ITEM COUNTER3 I; # COUNTER3 #
  1194. ITEM WORD U; # WORD FROM *TDU* TABLE #
  1195. ARRAY WORDEXP [0:0] P(1); # EXPANDED *TDU* TABLE WORD #
  1196. BEGIN
  1197. ITEM WORDFULL U(00,00,60); # FULL WORD #
  1198. ITEM WORDNAME C(00,00,07); # APPLICATION STRING NAME #
  1199. ITEM WORDCOUNT I(00,42,18); # CHARACTER COUNT #
  1200. END
  1201.  
  1202. STAT = 0;
  1203. IF TDUINDEX[0] GQ TABSTRINIT[0] THEN
  1204. BEGIN # IF PAST APPLICATION STRINGS #
  1205. STAT = 1; # NO MORE STRINGS #
  1206. END
  1207. ELSE
  1208. BEGIN # NOT PAST APPLICATION STRINGS #
  1209. IF TDUINDEX[0] LS TABSTRAPPS THEN
  1210. BEGIN # IF NOT AT APPLICATION STRINGS #
  1211. COUNTER2 = TABSTRAPPS[0] - TDUINDEX[0];
  1212. FOR COUNTER = 0 STEP 1 UNTIL COUNTER2 - 1 DO
  1213. BEGIN # SKIP TO APPLICATION STRINGS #
  1214. VDGETW(WORD,STAT);
  1215. END
  1216. END
  1217. IF STAT EQ 0 THEN
  1218. BEGIN # IF NOT END OF TABLE #
  1219. FOUND = FALSE; # NOT FOUND YET #
  1220. FOR COUNTER = 0 STEP 1 WHILE STAT EQ 0 AND NOT FOUND DO
  1221. BEGIN
  1222. VDGETW(WORD,STAT); # GET APPLICATION STRING NAME #
  1223. WORDFULL = WORD;
  1224. IF WORDCOUNT[0] EQ 0 THEN
  1225. BEGIN # IF END OF APPLICATION STRINGS #
  1226. STAT = 1;
  1227. END
  1228. IF STAT EQ 0 THEN
  1229. BEGIN # IF NOT END OF TABLE #
  1230. COUNTER3 = (WORDCOUNT[0] + 7) / 8;
  1231. IF WORDNAME[0] NQ NAME THEN
  1232. BEGIN # IF NO MATCH ON NAME #
  1233. FOR COUNTER2 = 0 STEP 1 UNTIL COUNTER3 - 1 DO
  1234. BEGIN
  1235. VDGETW(WORD,STAT); # SKIP THROUGH STRING #
  1236. END
  1237. END
  1238. ELSE
  1239. BEGIN # IF NAME MATCHES #
  1240. FOR COUNTER2 = 0 STEP 1 UNTIL COUNTER3 - 1 DO
  1241. BEGIN
  1242. VDGETW(WORD,STAT); # GET WORD FROM *TDU* TABLE #
  1243. B<0,12>STRINGWORD[COUNTER2] = B<4,7>WORD;
  1244. B<12,12>STRINGWORD[COUNTER2] = B<11,7>WORD;
  1245. B<24,12>STRINGWORD[COUNTER2] = B<18,7>WORD;
  1246. B<36,12>STRINGWORD[COUNTER2] = B<25,7>WORD;
  1247. B<48,12>STRINGWORD[COUNTER2] = B<32,7>WORD;
  1248. END
  1249. LENGTH = WORDCOUNT[0];
  1250. FOUND = TRUE; # FOUND IT #
  1251. END
  1252. END
  1253. END
  1254. END
  1255. END
  1256.  
  1257. END # VDTAPS #
  1258. CONTROL FI; # END OF IF EDITOR #
  1259. CONTROL FI; # END OF IF NOT EDITOR #
  1260. CONTROL EJECT;
  1261.  
  1262. PROC VDTBEL;
  1263.  
  1264. # TITLE VDTBEL - RING THE BELL. #
  1265.  
  1266. IOBEGIN(VDTBEL)
  1267.  
  1268. #
  1269. ** VDTBEL - RING THE BELL.
  1270. *
  1271. * THIS PROCEDURE SOUNDS THE AUDIBLE ALARM.
  1272. *
  1273. * PROC VDTBEL
  1274. *
  1275. * CALLS VDCTRL.
  1276. #
  1277.  
  1278. VDCTRL(OUT"RINGBELL"); # RING THE BELL #
  1279.  
  1280. IOEND # VDTBELL #
  1281. CONTROL EJECT;
  1282.  
  1283. PROC VDTBOO;
  1284.  
  1285. # TITLE VDTBOO - BEGINNING OF OUTPUT SEQUENCE. #
  1286.  
  1287. IOBEGIN(VDTBOO)
  1288.  
  1289. #
  1290. ** VDTBOO - BEGINNING OF OUTPUT SEQUENCE.
  1291. *
  1292. * THIS PROCEDURE IS CALLED TO START EACH OUTPUT SEQUENCE.
  1293. *
  1294. * PROC VDTBOO
  1295. *
  1296. * CALLS VDCTRL.
  1297. *
  1298. * NOTES TO PROTECT USERS FROM THEMSELVES THE CONTROL
  1299. * SEQUENCE TO TURN OFF INSERT MODE IS ISSUED.
  1300. #
  1301.  
  1302. VTINSMODE[0] = FALSE; # INSERT MODE IS FALSE #
  1303. VDCTRL(OUT"INSRTMDOFF"); # TURN OFF INSERT MODE #
  1304. VDCTRL(OUT"BEGINOUT"); # BEGIN OUTPUT SEQUENCE #
  1305. CONTROL IFEQ EDITORVDT,0; # IF NOT EDITOR VIRTERM #
  1306. VDCTRL(OUT"BEGINDIS"); # OUTPUT BEGIN DISPLAY #
  1307. IF NUMBERBYTE NQ 0 THEN
  1308. BEGIN # IF A SEQUENCE WAS SENT #
  1309. ATTRIBMASK = O"6001"; # PROTECT ATTRIBUTE IS ON #
  1310. END
  1311. CONTROL FI; # END OF IF NOT EDITOR #
  1312.  
  1313. IOEND # VDTBOO #
  1314. CONTROL EJECT;
  1315.  
  1316. PROC VDTCHR(CHAR);
  1317.  
  1318. # TITLE VDTCHR - OUTPUT ONE BYTE OF TEXT. #
  1319.  
  1320. IOBEGIN(VDTCHR)
  1321.  
  1322. #
  1323. ** VDTCHR - OUTPUT ONE 12 BIT BYTE.
  1324. *
  1325. * THIS PROCEDURE OUTPUTS A CHARACTER.
  1326. *
  1327. * PROC VDTCHR(CHAR)
  1328. *
  1329. * ENTRY CHAR = 12 BIT BYTE OF DATA.
  1330. *
  1331. * EXIT VTXCUR AND VTYCUR ADJUSTED AS NECESSARY.
  1332. *
  1333. * CALLS VDTOUT.
  1334. *
  1335. * USES VTCHAR, VTXCUR, VTYCUR.
  1336. *
  1337. * NOTES IF THE MOVEMENT OF THE CURSOR THAT WILL OCCUR WHEN
  1338. * THE CHARACTER IS OUTPUT WILL CAUSE THE TERMINAL TO
  1339. * SCROLL THEN THE CHARACTER WILL NOT BE OUTPUT.
  1340. #
  1341.  
  1342. ITEM CHAR I; # OUTPUT BYTE #
  1343.  
  1344. VTCHAR = CHAR;
  1345.  
  1346. # END OF NON-REENTRANT PARAMETER USAGE #
  1347.  
  1348. IF VTXCUR EQ VTXMAX THEN
  1349. BEGIN # IF PRESENTLY IN LAST COLUMN #
  1350. IF VTYCUR EQ VTYMAX THEN
  1351. BEGIN # IF PRESENTLY ON LAST LINE #
  1352. IF TABLASTPOS[0] NQ CURSORMOVE"SCROLL" THEN
  1353. BEGIN # IF TERMINAL WILL NOT SCROLL #
  1354. VDTOUT(VTCHAR); # OUTPUT CHARACTER #
  1355. IF TABLASTPOS[0] GQ CURSORMOVE"SPIRAL" THEN
  1356. BEGIN # IF WRAP OR SPIRAL #
  1357. VTXCUR = 0;
  1358. IF TABLASTPOS[0] EQ CURSORMOVE"SPIRAL" THEN VTYCUR = 0;
  1359. END
  1360. END
  1361. END
  1362. ELSE
  1363. BEGIN # NOT YET AT BOTTOM OF SCREEN #
  1364. VDTOUT(VTCHAR); # OUTPUT CHARACTER #
  1365. IF TABRGHTCHR[0] GQ CURSORMOVE"SPIRAL" THEN
  1366. BEGIN # IF WRAP OR SPIRAL #
  1367. VTXCUR = 0;
  1368. IF TABRGHTCHR[0] EQ CURSORMOVE"SPIRAL" THEN VTYCUR = VTYCUR + 1;
  1369. END
  1370. END
  1371. END
  1372. ELSE
  1373. BEGIN # NOT YET AT LAST COLUMN #
  1374. VDTOUT(VTCHAR); # OUTPUT CHARACTER #
  1375. VTXCUR = VTXCUR + 1; # ADJUST POSITION #
  1376. END
  1377.  
  1378. IOEND # VDTCHR #
  1379. CONTROL EJECT;
  1380.  
  1381. PROC VDTCLL(XX,YY);
  1382.  
  1383. # TITLE VDTCLL - CLEAR TO END OF LINE. #
  1384.  
  1385. IOBEGIN(VDTCLL)
  1386.  
  1387. #
  1388. ** VDTCLL - CLEAR TO END OF LINE.
  1389. *
  1390. * THIS PROCEDURE ERASES ALL CHARACTERS FROM THE COLUMN XX TO THE
  1391. * END OF THE LINE FOR LINE YY.
  1392. *
  1393. * PROC VDTCLL(XX,YY)
  1394. *
  1395. * ENTRY XX = X COORDINATE TO CLEAR FROM.
  1396. * YY = Y COORDINATE OF LINE TO CLEAR.
  1397. *
  1398. * EXIT VTXCUR UPDATED.
  1399. * VTYCUR UPDATED.
  1400. * LINE CLEARED.
  1401. *
  1402. * USES VTHOLD, VTXCUR, VTYCUR.
  1403. *
  1404. * CALLS VDCTRL, VDMOVE, VDTCHR, VDTOUT.
  1405. #
  1406.  
  1407. ITEM XX I; # X CORDINATE #
  1408. ITEM YY I; # Y CORDINATE #
  1409.  
  1410. # START OF NON-REENTRANT PARAMETER USAGE #
  1411.  
  1412. IF VTXCUR NQ XX OR VTYCUR NQ YY THEN
  1413. BEGIN
  1414. VTXCUR = XX;
  1415. VTYCUR = YY;
  1416.  
  1417. # END OF NON-REENTRANT PARAMETER USAGE #
  1418.  
  1419. VDMOVE(VTXCUR,VTYCUR); # POSITION CURSOR #
  1420. END
  1421.  
  1422. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VERSION OF VIRTERM #
  1423. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1424.  
  1425. #
  1426. * FSE USES THE LAST CHARACTER POSITION OF EACH LINE AS THE FIELD
  1427. * ATTRIBUTE FOR THE NEXT LINE ON A BLOCK MODE TERMINAL. TO PRE-
  1428. * VENT THIS ATTRIBUTE CHARACTER FROM BEING OVERWRITTEN BY THE
  1429. * NORMAL CLEAR-TO-END-OF-LINE SEQUENCE, A SPECIAL SEQUENCE IS
  1430. * GENERATED THAT ONLY CLEARS UP TO, BUT NOT INCLUDING THE LAST
  1431. * POSITION OF THE LINE.
  1432. #
  1433.  
  1434. IF TABLOCKMDE[0] THEN
  1435. BEGIN # IF BLOCK MODE TERMINAL #
  1436. IF VTXCUR NQ VTXMAX THEN
  1437. BEGIN # IF NOT ALREADY AT END OF LINE #
  1438. VTI = (VTYCUR * (VTXMAX + 1)) + VTXMAX;
  1439. VDTOUT(X"14"); # REPEAT TO ADDRESS #
  1440. VDTOUT(RTA3270[B<48,6>VTI]); # OUTPUT BYTE 1 OF ADDRESS #
  1441. VDTOUT(RTA3270[B<54,6>VTI]); # OUTPUT BYTE 2 OF ADDRESS #
  1442. VDTOUT(X"00"); # REPEAT (NULL CHARACTER) #
  1443. VDMOVE(VTXCUR,VTYCUR); # REPOSITION CURSOR #
  1444. END
  1445. IORET
  1446. END
  1447.  
  1448. CONTROL FI; # END OF IF NOT MULTI FSE #
  1449. CONTROL FI; # END OF IF EDITOR VIRTERM #
  1450.  
  1451. VDCTRL(OUT"CLREOL"); # CLEAR TO END OF LINE #
  1452. IF NUMBERBYTE EQ 0 THEN
  1453. BEGIN # IF NO FUNCTION AVAILABLE #
  1454. FOR VTI = VTXCUR STEP 1 UNTIL VTXMAX - 1 DO
  1455. BEGIN # UNTIL END OF LINE #
  1456. VDTOUT(X"20"); # OUTPUT BLANK #
  1457. END
  1458. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VERSION OF VIRTERM #
  1459. VTHOLD = VTXCUR; # SAVE X COORDINATE #
  1460. VTI = VTYCUR;
  1461. CONTROL FI; # END OF IF EDITOR VIRTERM #
  1462. VTXCUR = VTXMAX; # CURSOR IS AT EDGE OF SCREEN #
  1463. VDTCHR(X"20"); # OUTPUT CHARACTER WITH CHECK #
  1464. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VERSION OF VIRTERM #
  1465. VTXCUR = VTHOLD; # RESTORE X COORDINATE #
  1466. VTYCUR = VTI;
  1467. VDMOVE(VTXCUR,VTYCUR); # RESET CURSOR POSITION #
  1468. CONTROL FI; # END OF IF EDITOR VIRTERM #
  1469. END
  1470.  
  1471. IOEND # VDTCLL #
  1472. CONTROL EJECT;
  1473.  
  1474. PROC VDTCLS;
  1475.  
  1476. # TITLE VDTCLS - CLEAR SCREEN. #
  1477.  
  1478. IOBEGIN(VDTCLS)
  1479.  
  1480. #
  1481. ** VDTCLS - CLEAR SCREEN.
  1482. *
  1483. * THIS PROCEDURE CLEARS THE SCREEN AND POSITIONS THE CURSOR TO
  1484. * THE HOME POSITION.
  1485. *
  1486. * PROC VDTCLS
  1487. *
  1488. * EXIT VTXCUR = 0.
  1489. * VTYCUR = 0 OR VTYMAX.
  1490. *
  1491. * CALLS VDCTRL, VDTHOM.
  1492. *
  1493. * USES VTXCUR, VTYCUR.
  1494. *
  1495. * NOTES THE *TDU* DEFINITION OF THE BEGIN OUTPUT SEQUENCE
  1496. * (WHICH MUST BE ISSUED PRIOR TO CALLING VDTCLS)
  1497. * INCLUDES THE SEQUENCE TO TURN OFF INSERT MODE AND
  1498. * TO DISABLE PROTECT.
  1499. #
  1500.  
  1501. VDCTRL(OUT"CLRSCRCURH"); # CLEAR SCREEN, CURSOR HOME #
  1502. IF NUMBERBYTE EQ 0 THEN
  1503. BEGIN # IF NO CLEAR WITH CURSOR HOME #
  1504. VDCTRL(OUT"CLRSCREEN"); # ISSUE CLEAR SCREEN SEQUENCE #
  1505. VDTHOM; # POSITION CURSOR TO HOME #
  1506. END
  1507. ELSE
  1508. BEGIN # CURSOR IS AT HOME POSITION #
  1509. VTXCUR = 0; # RESET COLUMN POINTER #
  1510. IF TABVTHOMEU[0] THEN
  1511. BEGIN # IF HOME POSITION IS TOP #
  1512. VTYCUR = 0; # CLEAR Y COORDINATE #
  1513. END
  1514. ELSE
  1515. BEGIN # HOME IS AT BOTTOM #
  1516. VTYCUR = VTYMAX; # SET Y COORDINATE #
  1517. END
  1518. END
  1519.  
  1520. IOEND # VDTCLS #
  1521. CONTROL EJECT;
  1522.  
  1523. PROC VDTCOR(LINE,COLUMN);
  1524.  
  1525. # TITLE VDTCOR - SET INTERNAL CURSOR POSITION. #
  1526.  
  1527. BEGIN # VDTCOR #
  1528.  
  1529. #
  1530. ** VDTCOR - SET INTERNAL CURSOR POSITION.
  1531. *
  1532. * THIS PROCEDURE ALLOWS AN APPLICATION PROGRAM TO SET THE
  1533. * INTERNAL CURSOR POSITION TO A SPECIFIED LINE AND COLUMN.
  1534. *
  1535. * PROC VDTCOR(LINE,COLUMN)
  1536. *
  1537. * ENTRY LINE = DESIRED Y COORDINATE.
  1538. * COLUMN = DESIRED X COORDINATE.
  1539. *
  1540. * EXIT VTYCUR = LINE.
  1541. * VTXCUR = COLUMN.
  1542. *
  1543. * NOTES THIS ROUTINE DOES NOT PHYSICALLY MOVE THE CURSOR
  1544. * BUT MERELY CHANGES THE INTERNAL POINTERS TO THE
  1545. * CORRECT VALUES IF THEY ARE NO LONGER VALID, FOR
  1546. * EXAMPLE AFTER A TAB FUNCTION HAS BEEN RECEIVED.
  1547. #
  1548.  
  1549. ITEM LINE I; # DESIRED X COORDINATE #
  1550. ITEM COLUMN I; # DESIRED Y COORDIANTE #
  1551.  
  1552. VTYCUR = LINE;
  1553. VTXCUR = COLUMN;
  1554.  
  1555. END # VDTCOR #
  1556. CONTROL EJECT;
  1557.  
  1558. PROC VDTCTS;
  1559.  
  1560. # TITLE VDTCTS - CLEAR ALL TABS. #
  1561.  
  1562. IOBEGIN(VDTCTS)
  1563.  
  1564. #
  1565. ** VDTCTS - CLEAR ALL TABS.
  1566. *
  1567. * THIS PROCEDURE CLEARS ALL TAB STOPS.
  1568. *
  1569. * PROC VDTCTS
  1570. *
  1571. * EXIT VTTABS CLEARED.
  1572. *
  1573. * CALLS VDCTRL.
  1574. #
  1575.  
  1576. VDCTRL(OUT"CLRALLTABS"); # CLEAR TAB STOPS #
  1577.  
  1578. IOEND # VDTCTS #
  1579. CONTROL EJECT;
  1580.  
  1581. PROC VDTEOO;
  1582.  
  1583. # TITLE VDTEOO - END OF OUTPUT SEQUENCE. #
  1584.  
  1585. IOBEGIN(VDTEOO)
  1586.  
  1587. #
  1588. ** VDTEOO - END OF OUTPUT SEQUENCE.
  1589. *
  1590. * THIS PROCEDURE IS CALLED TO END EACH OUTPUT SEQUENCE.
  1591. *
  1592. * EXIT VTOUTDATA = TRANSPARENT OUTPUT WORD.
  1593. * VTOUTNEXT = 12.
  1594. *
  1595. * CALLS VDCTRL, VDSYNCH.
  1596. *
  1597. #
  1598.  
  1599. CONTROL IFEQ EDITORVDT,0; # IF NOT EDITOR VIRTERM #
  1600. VDCTRL(OUT"ENDISPLAY"); # OUTPUT END DISPLAY #
  1601. IF NUMBERBYTE NQ 0 THEN
  1602. BEGIN # IF A SEQUENCE WAS SENT #
  1603. ATTRIBMASK = 0; # NO ATTRIBUTES #
  1604. END
  1605. CONTROL FI; # END OF IF NOT EDITOR #
  1606. VDCTRL(OUT"ENDOUTPUT"); # END OUTPUT SEQUENCE #
  1607.  
  1608. VDSYNCH;
  1609.  
  1610. IOEND # VDTEOO #
  1611. CONTROL EJECT;
  1612.  
  1613. PROC VDTGTD(COLUMNS,LINES);
  1614.  
  1615. # TITLE VDTGTD - GET TERMINAL DIMENSIONS. #
  1616.  
  1617. BEGIN # VDTGTD #
  1618.  
  1619. #
  1620. ** VDTGTD - GET TERMINAL DIMENSIONS.
  1621. *
  1622. * THIS PROCEDURE RETURNS THE CURRENT NUMBER OF COLUMNS AND LINES.
  1623. *
  1624. * PROC VDTGTD(COLUMNS,LINES)
  1625. *
  1626. * EXIT COLUMNS = NUMBER OF COLUMNS ON SCREEN.
  1627. * LINES = NUMBER OF LINES ON SCREEN.
  1628. #
  1629.  
  1630. ITEM COLUMNS I; # NUMBER OF COLUMNS #
  1631. ITEM LINES I; # NUMBER OF LINES #
  1632.  
  1633. COLUMNS = VTXMAX + 1;
  1634. LINES = VTYMAX + 1;
  1635.  
  1636. END # VDTGTD #
  1637. CONTROL EJECT;
  1638.  
  1639. PROC VDTHOM;
  1640.  
  1641. # TITLE VDTHOM - MOVE CURSOR TO HOME POSITION. #
  1642.  
  1643. IOBEGIN(VDTHOM)
  1644.  
  1645. #
  1646. ** VDTHOM - MOVE CURSOR TO HOME POSITION.
  1647. *
  1648. * THIS PROCEDURE POSITIONS THE CURSOR TO HOME.
  1649. *
  1650. * PROC VDTHOM
  1651. *
  1652. * EXIT VTXCUR = 0.
  1653. * VTYCUR = 0 OR VTYMAX.
  1654. *
  1655. * CALLS VDCTRL.
  1656. *
  1657. * USES VTXCUR, VTYCUR.
  1658. #
  1659.  
  1660. VDCTRL(OUT"CURSORHOME"); # POSITION CURSOR TO HOME #
  1661.  
  1662. VTXCUR = 0; # RESET COLUMN POINTER #
  1663. IF TABVTHOMEU[0] THEN
  1664. BEGIN # IF HOME POSITION IS TOP #
  1665. VTYCUR = 0; # CLEAR Y COORDINATE #
  1666. END
  1667. ELSE
  1668. BEGIN # HOME IS AT BOTTOM #
  1669. VTYCUR = VTYMAX; # SET Y COORDINATE #
  1670. END
  1671.  
  1672. IOEND # VDTHOM #
  1673. CONTROL EJECT;
  1674. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1675.  
  1676. PROC VDTITD(MODELNAME);
  1677.  
  1678. # TITLE VDTITD - INITIALIZE *TDU* TABLE. #
  1679.  
  1680. BEGIN # VDTITD #
  1681.  
  1682. #
  1683. ** VDTITD - INITIALIZE *TDU* TABLE.
  1684. *
  1685. * THIS PROCEDURE GETS THE *TDU* (TERMINAL DEFINITION UTILITY) TABLE
  1686. * FROM MEMORY OR FILE *ZZZZTRM* AND MOVES IT TO ARRAYS *TABLEHEADR*
  1687. * AND *TABLEWORDS* SO THAT THE TERMINAL CAN BE RUN IN SCREEN MODE.
  1688. * TDUINDEX IS LEFT POSITIONED WHERE THE READING OF THE INPUT AND
  1689. * OUPTUT DATA STOPPED TO ALLOW SUBSEQUENT ACCESS TO THE REST OF
  1690. * THE DATA IN THE REMAINING SECTIONS OF THE *TDU* TABLE.
  1691. *
  1692. * PROC VDTITD(MODELNAME)
  1693. *
  1694. * EXIT MODELNAME = THE MODELNAME OF THE TERMINAL AS DEFINED
  1695. * TO *TDU*, LEFT JUSTIFIED, BLANK FILL.
  1696. * = BLANK, IF NO *TDU* DEFINITION EXISTS.
  1697. *
  1698. * CALLS VDGETW, VDTGSL, VDTGTA.
  1699. *
  1700. * USES VTI, VTJ, VTMODEL.
  1701. *
  1702. * NOTES VDTITD CAN NOT BE CALLED IN THE MULTI USER VERSION
  1703. * VERSION OF THE EDITOR SINCE IT MAY DO DISK I/O TO
  1704. * TO GET A USER DEFINED *TDU* TABLE.
  1705. #
  1706.  
  1707. ITEM MODELNAME C(6); # MODEL NAME #
  1708. ITEM TDUINOUT U; # COUNT OF *TDU* I/O INFORMATION #
  1709. ITEM TDUWORD U; # WORD FROM *TDU* TABLE #
  1710.  
  1711. CONTROL IFEQ QTRMV,1; # IF QTRM #
  1712. ITEM I I;
  1713. ITEM TMODEL C(7); # TEMP MODEL NAME #
  1714. ITEM SCRCLS I; # CAPSULE LOADED SUCCESSFULLY #
  1715. ITEM SCRLCA U; # LOADED CAPSULE ADDRESS #
  1716. ITEM SCRPFF I; # PERMANENT FILE FOUND FLAG #
  1717. ITEM SCRPFN C(7) = "TERMLIB"; # PERMANENT FILE NAME #
  1718. ITEM SCRSTS B; # *TERMLIB* STATUS FLAG #
  1719. ITEM SCRTCL I; # TERMINAL CAPSULE LENGTH #
  1720. ITEM SCRUSN C(7) = "LIBRARY"; # ALTERNATE USER NUMBER #
  1721. ITEM SCRZTM C(7); # MODEL NAME PREFACED WITH Z #
  1722. CONTROL FI; # END OF IF QTRM #
  1723.  
  1724. IF NOT VTTDUREAD[0] THEN
  1725. BEGIN # IF *TDU* TABLE NOT READ YET #
  1726. *IF UNDEF,QTRM
  1727. VDTGSL(VTMODEL,VTI); # GET MODEL AND SCREEN OR LINE #
  1728. IF VTMODEL NQ 0 THEN
  1729. BEGIN # IF TERMINAL HAS BEEN DEFINED #
  1730. IF VTMODEL NQ 1 THEN
  1731. BEGIN # IF SYSTEM RESIDENT TABLE #
  1732. VDTGTA(VTMODEL,VTJ); # GET ADDRESS FOR *TDU* TABLE #
  1733. P<TEMPSTORE> = VTJ; # POSITION BASED ARRAY #
  1734. TDURESID[0] = TRUE; # SET RESIDENT TABLE #
  1735. END
  1736. ELSE
  1737. BEGIN # NOT SYSTEM RESIDENT TABLE #
  1738. VTJ = LOC(TDUBUF); # PRESET FET FOR READ #
  1739. TDUCODE = 1;
  1740. TDUIN = VTJ;
  1741. TDUFIRST = VTJ;
  1742. TDUOUT = VTJ;
  1743. TDULIMIT = VTJ + TDUBUFFLEN; # BUFFER LENGTH #
  1744. VDTRWD(TDUFET,1); # REWIND FET WITH RECALL #
  1745. VDTRD$(TDUFET,1); # READ *TDU* TABLE WITH RECALL #
  1746. TDURESID[0] = FALSE; # CLEAR RESIDENT TABLE #
  1747. END
  1748. TDUINDEX[0] = 0; # START INDEX AT ZERO #
  1749. VDGETW(TDUWORD,VTI); # MOVE TABLE HEADER TO COMMON #
  1750. IF VTI EQ 0 THEN
  1751. BEGIN # IF TABLE EXISTS #
  1752. TABHEADONE[0] = TDUWORD;
  1753. VDGETW(TDUWORD,VTI);
  1754. TABHEADTWO[0] = TDUWORD;
  1755. VDGETW(TDUWORD,VTI);
  1756. TABHEADTHR[0] = TDUWORD;
  1757. VDGETW(TDUWORD,VTI);
  1758. TABHEADFOU[0] = TDUWORD;
  1759. VDGETW(TDUWORD,VTI);
  1760. TABHEADFIV[0] = TDUWORD;
  1761. VDGETW(TDUWORD,VTI);
  1762. TABHEADSIX[0] = TDUWORD;
  1763. TDUINOUT = TABSTRNMES[0] - 7; # COUNT *TDU* I/O INFORMATION #
  1764. IF TDUINOUT GR TDUBUFFLEN - O"10" THEN
  1765. BEGIN # IF TOO MUCH I/O INFORMATION #
  1766. TDUINOUT = TDUBUFFLEN - O"10";
  1767. END
  1768. FOR VTJ = 0 STEP 1 UNTIL TDUINOUT DO
  1769. BEGIN # MOVE BODY OF TABLE TO COMMON #
  1770. VDGETW(TDUWORD,VTI);
  1771. TABFULLWRD[VTJ] = TDUWORD;
  1772. END
  1773. VTTDUREAD[0] = TRUE; # SET TABLE READ FLAG #
  1774. END
  1775. ELSE
  1776. BEGIN # TABLE CAN NOT BE FOUND #
  1777. TABMODNAME[0] = " "; # SET BLANK NAME IN BLOCK #
  1778. END
  1779. END
  1780. ELSE
  1781. BEGIN # UNDEFINED TERMINAL #
  1782. TABMODNAME[0] = " "; # SET BLANK NAME IN BLOCK #
  1783. END
  1784. END
  1785. *ELSE
  1786. VDTGTO(VTMODEL,MODELNAME); # GET TERMINAL ORDINAL #
  1787. IF VTMODEL NQ 0 THEN
  1788. BEGIN # IF SYSTEM RESIDENT TABLE #
  1789. VDTGTA(VTMODEL,VTJ); # GET ADDRESS FOR *TDU* TABLE #
  1790. P<TEMPSTORE> = VTJ; # POSITION BASED ARRAY #
  1791. TDURESID[0] = TRUE; # SET RESIDENT TABLE #
  1792. END
  1793. ELSE
  1794. BEGIN # NOT SYSTEM RESIDENT TABLE #
  1795. PF("GET",SCRPFN,SCRPFN,"RC",SCRPFF,"UN",SCRUSN,0);
  1796. IF SCRPFF NQ 0 THEN
  1797. BEGIN # IF NOT INDIRECT, TRY DIRECT #
  1798. PF("ATTACH",SCRPFN,SCRPFN,"RC",SCRPFF,"UN",SCRUSN,"PN",
  1799. "0","NA",0,0);
  1800. END
  1801. IF SCRPFF EQ 0 THEN
  1802. BEGIN # IF FILE FOUND #
  1803. C<0>SCRZTM = "Z"; # LOADER PREFIX #
  1804. FOR I = 1 STEP 1 UNTIL 6 DO C<I>SCRZTM = C<I-1>MODELNAME;
  1805. SCRLCP(SCRZTM,SCRLCA,SCRCLS); # LOAD TERMINAL CAPSULE #
  1806. IF SCRCLS EQ 0 THEN
  1807. BEGIN # IF CAPSULE LOADED #
  1808. P<TEMPSTORE> = SCRLCA; # POSITION BASED ARRAY #
  1809. TDURESID[0] = TRUE; # SET RESIDENT TABLE #
  1810. TABMODNAME[0] = MODELNAME; # BLANK NAME IN BLOCK #
  1811. END # CAPSULE LOADED #
  1812. END
  1813. IF ((SCRCLS NQ 0) OR (SCRPFF NQ 0)) THEN
  1814. BEGIN # IF CAPSULE NOT FOUND #
  1815. TABMODNAME[0] = " "; # SET BLANK NAME IN BLOCK #
  1816. END
  1817. END
  1818. TDUINDEX[0] = 0; # START INDEX AT ZERO #
  1819. VDGETW(TDUWORD,VTI); # MOVE TABLE HEADER TO COMMON #
  1820. TABHEADONE[0] = TDUWORD;
  1821. VDGETW(TDUWORD,VTI);
  1822. TABHEADTWO[0] = TDUWORD;
  1823. VDGETW(TDUWORD,VTI);
  1824. TABHEADTHR[0] = TDUWORD;
  1825. VDGETW(TDUWORD,VTI);
  1826. TABHEADFOU[0] = TDUWORD;
  1827. VDGETW(TDUWORD,VTI);
  1828. TABHEADFIV[0] = TDUWORD;
  1829. VDGETW(TDUWORD,VTI);
  1830. TABHEADSIX[0] = TDUWORD;
  1831. TDUINOUT = TABSTRNMES[0] - 7; # COUNT *TDU* I/O INFORMATION #
  1832. IF TDUINOUT GR TDUBUFFLEN - O"10" THEN
  1833. BEGIN # IF TOO MUCH I/O INFORMATION #
  1834. TDUINOUT = TDUBUFFLEN - O"10";
  1835. END
  1836. FOR VTJ = 0 STEP 1 UNTIL TDUINOUT DO
  1837. BEGIN # MOVE BODY OF TABLE TO COMMON #
  1838. VDGETW(TDUWORD,VTI);
  1839. TABFULLWRD[VTJ] = TDUWORD;
  1840. END
  1841. VTTDUREAD[0] = TRUE; # SET TABLE READ FLAG #
  1842. END
  1843. *ENDIF
  1844. C<0,6>MODELNAME = TABMODNAME[0]; # RETURN MODEL NAME #
  1845.  
  1846. END # VDTITD #
  1847. CONTROL FI; # END OF IF SINGLE USER FSE #
  1848. *IF UNDEF,QTRM
  1849. CONTROL EJECT;
  1850.  
  1851. PROC VDTOUT(CHAR);
  1852.  
  1853. # TITLE VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD. #
  1854.  
  1855. IOBEGIN(VDTOUT)
  1856.  
  1857. #
  1858. ** VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD.
  1859. *
  1860. * THIS PROCEDURE ALLOWS THE GENERAL OUTPUT OF ONE CHARACTER.
  1861. *
  1862. * PROC VDTOUT(CHAR)
  1863. *
  1864. * ENTRY CHAR = 12 BIT BYTE TO QUEUE OR TRANSMIT.
  1865. * VTOUTDATA = ACCUMULATOR WORD.
  1866. * VTOUTNEXT = PRESENT BIT POSITION.
  1867. *
  1868. * EXIT VTOUTDATA, VTOUTNEXT UPDATED.
  1869. *
  1870. * CALLS VDTWTO.
  1871. *
  1872. * USES VTOUTDATA, VTOUTNEXT.
  1873. #
  1874.  
  1875. ITEM CHAR I; # OUTPUT BYTE #
  1876.  
  1877. B<VTOUTNEXT,12>VTOUTDATA = CHAR LOR O"4000"; # XPARENT BYTE #
  1878.  
  1879. # END OF NON-REENTRANT PARAMETER USAGE #
  1880.  
  1881. VTOUTNEXT = VTOUTNEXT +12; # INCREMENT BIT POSITION #
  1882. IF VTOUTNEXT EQ 60 THEN
  1883. BEGIN # IF ACCUMULATOR WORD IS FULL #
  1884. VDTWTO(VTOUTDATA); # WRITE WORD #
  1885. VTOUTDATA = 0; # CLEAR ACCUMULATOR WORD #
  1886. VTOUTNEXT = 0; # SET BIT POSITION #
  1887. END
  1888.  
  1889. IOEND # VDTOUT #
  1890. *ELSE
  1891. CONTROL EJECT; # QTRM VARIANT OF VDTOUT #
  1892.  
  1893. PROC VDTOUT(CHAR);
  1894.  
  1895. # TITLE VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD. #
  1896.  
  1897. BEGIN # VDTOUT #
  1898.  
  1899. #
  1900. ** VDTOUT - ISSUE ONE BYTE TO ACCUMULATOR WORD.
  1901. *
  1902. * THIS PROCEDURE ALLOWS GENERAL QTRM OUTPUT OF ONE CHARACTER.
  1903. *
  1904. * PROC VDTOUT(CHAR)
  1905. *
  1906. * ENTRY CHAR = 12 BIT BYTE TO QUEUE OR TRANSMIT.
  1907. * VTOUTDATA = ACCUMULATOR WORD.
  1908. * VTOUTNEXT = PRESENT BIT POSITION.
  1909. *
  1910. * EXIT VTOUTDATA, VTOUTNEXT UPDATED.
  1911. *
  1912. * CALLS SFNQUE.
  1913. *
  1914. * USES VTOUTDATA, VTOUTNEXT.
  1915. #
  1916. ITEM CHAR I; # OUTPUT BYTE #
  1917. ITEM I I; # DUMMY PARAMETER #
  1918.  
  1919. B<VTOUTNEXT,12>VTOUTDATA = CHAR;
  1920. VTOUTNEXT = VTOUTNEXT + 12;
  1921. IF VTOUTNEXT EQ 60 THEN
  1922. BEGIN # IF ACCUMULATOR WORD IS FULL #
  1923. NIT$CTLC = 5; # ENQUEUE WORD #
  1924. SFNQUE("PUT",VTOUTDATA,I);
  1925. VTOUTDATA = 0; # CLEAR ACCUMULATOR WORD #
  1926. VTOUTNEXT = 0; # SET BIT POSITION #
  1927. END
  1928.  
  1929. END # VDTOUT #
  1930. *ENDIF
  1931. CONTROL EJECT;
  1932.  
  1933. PROC VDTPOS(XX,YY);
  1934.  
  1935. # TITLE VDTPOS - POSITION CURSOR. #
  1936.  
  1937. IOBEGIN(VDTPOS)
  1938.  
  1939. #
  1940. ** VDTPOS - POSITION CURSOR.
  1941. *
  1942. * THIS PROCEDURE MOVES THE CURSOR TO THE SPECIFIED POSITION.
  1943. *
  1944. * PROC VDTPOS(XX,YY)
  1945. *
  1946. * ENTRY XX = DESIRED X COORDINATE.
  1947. * YY = DESIRED Y COORDINATE.
  1948. *
  1949. * EXIT VTXCUR = XX.
  1950. * VTYCUR = YY.
  1951. *
  1952. * CALLS VDMOVE.
  1953. #
  1954.  
  1955. ITEM XX I; # COLUMN POSITION #
  1956. ITEM YY I; # LINE POSITION #
  1957.  
  1958. VTXCUR = XX; # RESET COLUMN POINTER #
  1959. VTYCUR = YY; # RESET LINE POINTER #
  1960.  
  1961. # END OF NON-REENTRANT PARAMETER USAGE #
  1962.  
  1963. VDMOVE(VTXCUR,VTYCUR); # POSITION CURSOR #
  1964.  
  1965. IOEND # VDTPOS #
  1966. *IF UNDEF,QTRM
  1967. CONTROL EJECT;
  1968.  
  1969. PROC VDTPPI;
  1970.  
  1971. # TITLE VDTPPI - PRE-PROCESS INPUT. #
  1972.  
  1973. IOBEGIN(VDTPPI)
  1974.  
  1975. #
  1976. ** VDTPPI - PRE-PROCESS INPUT.
  1977. *
  1978. * THIS PROCEDURE VERIFIES THAT THE INPUT IS EITHER NULL OR IS
  1979. * TRANSPARENT INPUT. THE EFFECT IS TO BANISH MOST TYPE AHEAD
  1980. * EXCEPT FOR TYPED AHEAD CARRIAGE RETURNS WHICH CAN BE IGNORED.
  1981. *
  1982. * PROC VDTPPI
  1983. *
  1984. * EXIT VTORDN = 0, IF TRANSPARENT INPUT RECEIVED OK.
  1985. * = NON ZERO, IF NON-NULL TYPEAHEAD.
  1986. * VTINPDATA = CONTAINS NEW TRANSPARENT INPUT DATA.
  1987. * VTRESINP = BLOCK MODE RESIDUAL INPUT.
  1988. * VTINPNEXT = UPDATED.
  1989. *
  1990. * CALLS VDTRDO, VDTWTO.
  1991. *
  1992. * USES VTINPDATA, VTINPDATA, VTORDN.
  1993. *
  1994. * NOTES SINCE THIS PROCEDURE INITIALIZES THE BIT POINTER
  1995. * (VTINPNEXT), IT MUST BE CALLED EXACTLY AT THE
  1996. * START OF EACH INPUT SEQUENCE.
  1997. #
  1998.  
  1999. CONTROL IFEQ EDITORVDT,1; # IF EDITOR VIRTERM #
  2000. CONTROL IFEQ SINGLE,1; # MULTI DOES THIS IN TTITRAP #
  2001. IF NOT TABTYPHEAD[0] THEN
  2002. BEGIN # IF TYPE AHEAD NOT ENABLED #
  2003. VDTWTO(O"0006 4704 0015 0000 0000"); # XPARENT INPUT MODE #
  2004. END
  2005. CONTROL FI;
  2006. CONTROL FI;
  2007.  
  2008. CONTROL IFEQ EDITORVDT,0; # IF STAND ALONE VIRTERM #
  2009. VDTWTO(O"0006 4704 0015 0000 0000"); # XPARENT INPUT MODE #
  2010. CONTROL FI;
  2011.  
  2012. VTORDN = 1;
  2013. VDTRDO(VTINPDATA); # READ WORD #
  2014. VTINPNEXT = 12; # RESET BIT POSITION #
  2015. VTRESINP = 0; # CLEAR RESIDUAL INPUT #
  2016.  
  2017. IF B<0,12>VTINPDATA EQ 7 THEN
  2018. BEGIN # IF TRANSPARENT INPUT #
  2019. VTORDN = 0;
  2020. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2021. IF TABLOCKMDE[0] THEN
  2022. BEGIN # IF BLOCK MODE TYPE TERMINAL #
  2023. B<00,12>VTRESINP = B<24,12>VTINPDATA; # CURSOR ADDRESS #
  2024. B<12,12>VTRESINP = B<36,12>VTINPDATA;
  2025. B<24,12>VTRESINP = B<12,12>VTINPDATA; # ATTENTION IDENTIFIER #
  2026. VTINPNEXT = 48; # SET BIT POINTER #
  2027. END
  2028. CONTROL FI; # END OF IF NOT MULTI FSE #
  2029. END
  2030. ELSE
  2031. BEGIN # NOT TRANSPARENT INPUT #
  2032. IF VTINPDATA EQ 0 THEN VTORDN = 0; # CHECK FOR NULL TYPE AHEAD #
  2033. END
  2034.  
  2035. IOEND # VDTPPI #
  2036. *ELSE
  2037. CONTROL EJECT; # QTRM VARIANT OF VDTPPI #
  2038.  
  2039. PROC VDTPPI;
  2040.  
  2041. # TITLE VDTPPI - PRE-PROCESS INPUT. #
  2042.  
  2043. BEGIN # VDTPPI #
  2044.  
  2045. #
  2046. ** VDTPPI - PRE-PROCESS INPUT.
  2047. *
  2048. * THIS PROCEDURE DOES INITIALIZATION FOR QTRM INPUT.
  2049. *
  2050. * PROC VDTPPI
  2051. *
  2052. * EXIT VTINPDATA = FIRST WORD OF INPUT.
  2053. * VTINPWORD = 1.
  2054. * VTINPNEXT = 0.
  2055. * VTORDN = 0.
  2056. *
  2057. * USES VTINPDATA, VTINPNEXT, VTINPWORD, VTORDN.
  2058. #
  2059. ITEM WORD I; # WORD POINTER #
  2060. ITEM BIT I; # BIT POINTER #
  2061.  
  2062. VTINPNEXT = 0; # CLEAR INPUT WORD #
  2063. VTORDN = 0; # CLEAR ORDINAL #
  2064. VTINPWORD = 1;
  2065. WORD = (NIT$CTLC + 1) / 5; # INSERT DUMMY CARRIAGE RETURN #
  2066. BIT = (NIT$CTLC + 1 - (WORD * 5)) * 12;
  2067. B<BIT,12>QTRM$WD0[WORD] = O"15";
  2068. VTINPDATA = QTRM$WD0[0];
  2069.  
  2070. END # VDTPPI #
  2071. *ENDIF
  2072. CONTROL EJECT;
  2073.  
  2074. PROC VDTSAM(MASK);
  2075.  
  2076. # TITLE VDTSAM - SET ATTRIBUTE MASK. #
  2077.  
  2078. IOBEGIN(VDTSAM)
  2079.  
  2080. #
  2081. ** VDTSAM - SET ATTRIBUTE MASK.
  2082. *
  2083. * THIS PROCEDURE SETS THE ATTRIBUTES REQUESTED BY MASK.
  2084. *
  2085. * PROC VDTSAM(MASK)
  2086. *
  2087. * ENTRY MASK = MASK OF LOGICAL/PHYSICAL ATTRIBUTES.
  2088. * ATTRIBMASK = CURRENT ATTRIBUTE MASK.
  2089. *
  2090. * EXIT ATTRIBMASK = NEW ATTRIBUTE MASK.
  2091. *
  2092. * CALLS VDCTRL, VDTOUT.
  2093. *
  2094. * USES ATTNEWMASK, ATTRIBMASK, ATTRIBSAME.
  2095. #
  2096.  
  2097. ITEM MASK U; # REQUESTED ATTRIBUTES #
  2098.  
  2099. ATTNEWMASK = MASK; # SAVE NEW ATTRIBUTES #
  2100.  
  2101. IF NOT TABNOTMASK[0] THEN
  2102. BEGIN # IF ATTRIBUTES ARE MASKABLE #
  2103.  
  2104. # CALCULATE ATTRIBUTES THAT WILL BE UNCHANGED #
  2105.  
  2106. ATTRIBSAME = (ATTNEWMASK LAN ATTRIBMASK[0]) LAN O"3000";
  2107. IF ATTLOGICAL[0] THEN
  2108. BEGIN # IF LOGICAL ATTRIBUTE #
  2109. IF B<0,1>ATTNEWMASK EQ 1 AND ATTORDINAL[0] EQ B<6,6>ATTNEWMASK THEN
  2110. ATTRIBSAME = ATTRIBSAME LOR (ATTNEWMASK LAN O"4077");
  2111. END
  2112. ELSE
  2113. BEGIN # PHYSICAL ATTRIBUTES #
  2114. IF B<0,1> ATTNEWMASK EQ 0 THEN
  2115. BEGIN
  2116. ATTRIBSAME = ATTRIBSAME LOR
  2117. ((ATTNEWMASK LAN ATTRIBMASK[0]) LAN O"0017");
  2118. END
  2119. END
  2120.  
  2121. # TURN OFF ATTRIBUTES THAT ARE ON AND NOT REQUESTED THIS CALL #
  2122.  
  2123. ATTRIBMASK[0] = ATTRIBMASK[0] LXR ATTRIBSAME;
  2124.  
  2125. END
  2126.  
  2127. IF ATTRIBMASK[0] NQ 0 THEN
  2128. BEGIN # IF TURNING OFF ANY ATTRIBUTES #
  2129. IF ATTLOGICAL[0] THEN
  2130. BEGIN # TURN OFF LOGICAL ATTRIBUTE #
  2131. IF ATTORDINAL[0] GQ 0 AND ATTORDINAL[0] LQ MAXLOGTYPE THEN
  2132. BEGIN # IF GROUP ONE LOGICAL #
  2133. VDCTRL(OUT"INPTEXTOFF" + (ATTORDINAL[0] * 2));
  2134. IF ATTORDINAL[0] EQ 0 THEN VTPSUNDACT[0] = FALSE;
  2135. END
  2136. ELSE
  2137. BEGIN # NOT GROUP ONE LOGICAL #
  2138. IF ATTORDINAL[0] LQ MAXLOGTYPE*2+1 THEN
  2139. BEGIN # IF LEGAL GROUP TWO LOGICAL #
  2140. VDCTRL(OUT"INPUTE2" + ((ATTORDINAL[0]-6) * 2));
  2141. END
  2142. END
  2143. END
  2144. ELSE
  2145. BEGIN # TURN OFF PHYSICAL ATTRIBUTES #
  2146. IF ATTUNDERLN[0] THEN VTPSUNDACT[0] = FALSE;
  2147. IF ATTUNDERLN[0] THEN VDCTRL(OUT"UNDERLNOFF");
  2148. IF ATTALTERIN[0] THEN VDCTRL(OUT"ALTINTNOFF");
  2149. IF ATTINVERSE[0] THEN VDCTRL(OUT"INVERSEOFF");
  2150. IF ATTBLINKMD[0] THEN VDCTRL(OUT"BLINKOFF");
  2151. END
  2152. IF ATTPROTECT[0] THEN VDCTRL(OUT"PROTECTOFF");
  2153. IF ATTGUARDMD[0] THEN VDCTRL(OUT"GUARDOFF");
  2154. END
  2155.  
  2156. # TURN ON ATTRIBUTES THAT ARE NOT ON AND ARE REQUESTED THIS CALL #
  2157.  
  2158. ATTRIBMASK[0] = ATTNEWMASK; # RESET NEW ATTRIBUTES #
  2159.  
  2160. IF ATTRIBMASK NQ 0 THEN
  2161. BEGIN # IF ANY ATTRIBUTES TO TURN ON #
  2162. IF NOT TABLOCKMDE[0] THEN
  2163. BEGIN # IF NOT BLOCK TYPE TERMINAL #
  2164. IF NOT TABNOTMASK[0] THEN
  2165. BEGIN # IF ATTRIBUTES ARE MASKABLE #
  2166. ATTRIBMASK[0] = ATTRIBMASK[0] LXR ATTRIBSAME;
  2167. END
  2168. IF ATTPROTECT[0] THEN VDCTRL(OUT"PROTECTON");
  2169. IF ATTGUARDMD[0] THEN VDCTRL(OUT"GUARDON");
  2170. END
  2171. IF ATTLOGICAL[0] THEN
  2172. BEGIN # TURN ON LOGICAL ATTRIBUTE #
  2173. IF ATTORDINAL[0] GQ 0 AND ATTORDINAL[0] LQ MAXLOGTYPE THEN
  2174. BEGIN # IF GROUP ONE LOGICAL #
  2175. VDCTRL(OUT"INPTEXTON" + (ATTORDINAL[0] * 2));
  2176. IF ATTORDINAL[0] EQ 0 THEN VTPSUNDACT[0] = VTPSUNDREQ[0];
  2177. END
  2178. ELSE
  2179. BEGIN # NOT GROUP ONE LOGICAL #
  2180. IF ATTORDINAL[0] LQ MAXLOGTYPE*2+1 THEN
  2181. BEGIN # IF LEGAL GROUP TWO LOGICAL #
  2182. VDCTRL(OUT"INPUTB2" + ((ATTORDINAL[0]-6)* 2));
  2183. END
  2184. END
  2185. END
  2186. ELSE
  2187. BEGIN # TURN ON PHYSICAL ATTRIBUTES #
  2188. IF TABLOCKMDE[0] THEN
  2189. BEGIN # IF BLOCK TYPE TERMINAL #
  2190. VDTOUT(X"1D"); # OUTPUT START FIELD ORDER #
  2191. IF ATTGUARDMD[0] THEN
  2192. BEGIN # IF GUARD MODE #
  2193. VTCHAR = X"3C"; # ASSUME UNPROTECTED #
  2194. IF ATTPROTECT[0] THEN VTCHAR = VTCHAR + X"04";
  2195. END
  2196. ELSE
  2197. BEGIN # UNGUARDED FIELD #
  2198. VTCHAR = X"44"; # ASSUME UNPROTECTED AND NORMAL #
  2199. IF ATTPROTECT[0] THEN VTCHAR = VTCHAR - X"10";
  2200. IF ATTALTERIN[0] OR ATTUNDERLN[0] OR
  2201. ATTINVERSE[0] OR ATTBLINKMD[0] THEN
  2202. VTCHAR = VTCHAR + X"04";
  2203. END
  2204. VDTOUT(VTCHAR); # OUTPUT FIELD ATTRIBUTE #
  2205. END
  2206. ELSE
  2207. BEGIN
  2208. IF ATTUNDERLN[0] THEN VTPSUNDACT[0] = VTPSUNDREQ[0];
  2209. IF ATTUNDERLN[0] THEN VDCTRL(OUT"UNDERLNEON");
  2210. IF ATTALTERIN[0] THEN VDCTRL(OUT"ALTINTENON");
  2211. IF ATTINVERSE[0] THEN VDCTRL(OUT"INVERSEON");
  2212. IF ATTBLINKMD[0] THEN VDCTRL(OUT"BLINKON");
  2213. END
  2214. END
  2215. END
  2216. ELSE
  2217. BEGIN # NO ATTRIBUTES #
  2218. IF TABLOCKMDE[0] THEN
  2219. BEGIN # IF BLOCK MODE TERMINAL #
  2220. VDTOUT(X"1D"); # OUTPUT *START FIELD* ORDER #
  2221. VDTOUT(X"20"); # UNPROTECTED #
  2222. END
  2223. END
  2224.  
  2225. ATTRIBMASK[0] = ATTNEWMASK; # SAVE CURRENT ATTRIBUTES #
  2226.  
  2227. IOEND # VDTSAM #
  2228. CONTROL EJECT;
  2229.  
  2230. PROC VDTSAP(LASTPOS,XPOS,YPOS);
  2231.  
  2232. # TITLE VDTSAP - SET ATTRIBUTE POSITION. #
  2233.  
  2234. IOBEGIN(VDTSAP)
  2235.  
  2236. #
  2237. ** VDTSAP - SET ATTRIBUTE POSITION.
  2238. *
  2239. * THIS PROCEDURE MOVES THE CURSOR TO THE SPECIFIED ROW AND COLUMN.
  2240. * FOR A NON BLOCK MODE TERMINAL THIS IS IDENTICAL TO VDTPOS BUT A
  2241. * BLOCK MODE TERMINAL WHOSES ATTRIBUTE CHARACTER OCCUPIES A SPACE
  2242. * ON THE SCREEN REQUIRES THAT THE POSITION BE BACKED UP ONE SPACE.
  2243. *
  2244. * PROC VDTSAP(LASTPOS,XPOS,YPOS)
  2245. *
  2246. * ENTRY LASTPOS = BUFFER POSITION OF LAST FIELD ATTRIBUTE.
  2247. * XPOS = DESIRED X COORDINATE.
  2248. * YPOS = DESIRED Y COORDINATE.
  2249. *
  2250. * EXIT CURSOR MOVED TO APPROPRIATE POSITION.
  2251. *
  2252. * CALLS VDMOVE, VDTOUT.
  2253. *
  2254. * USES VTCOUNT, VTHOLD, VTXCUR, VTYCUR.
  2255. #
  2256. ITEM LASTPOS I; # LAST ATTRIBUTE POSITION #
  2257. ITEM XPOS I; # DESIRED X COORDINATE #
  2258. ITEM YPOS I; # DESIRED Y COORDINATE #
  2259.  
  2260. VTXCUR = XPOS;
  2261. VTYCUR = YPOS;
  2262. VTHOLD = LASTPOS;
  2263.  
  2264. CONTROL IFEQ EDITORVDT,0; # IF NOT FSE VERSION OF VIRTERM #
  2265. IF TABLOCKMDE[0] OR TABATTRCHR[0] THEN
  2266. BEGIN # IF ATTRIBUTE WILL TAKE A BYTE #
  2267. CONTROL FI; # END OF IF NOT FSE #
  2268. CONTROL IFEQ EDITORVDT,1; # IF FSE VERSION OF VIRTERM #
  2269. IF TABLOCKMDE[0] THEN
  2270. BEGIN # IF BLOCK MODE TERMINAL #
  2271. CONTROL FI; # END OF IF FSE #
  2272. VTXCUR = VTXCUR - 1; # BACK CURSOR UP ONE POSITION #
  2273. IF VTXCUR LS 0 THEN
  2274. BEGIN # IF WRAP TO PREVIOUS LINE #
  2275. VTXCUR = VTXMAX;
  2276. VTYCUR = VTYCUR - 1;
  2277. IF VTYCUR LS 0 THEN
  2278. BEGIN # IF WRAP TO LAST SCREEN POSTION #
  2279. VTYCUR = VTYMAX;
  2280. IF TABATTRCHR[0] THEN
  2281. BEGIN # IF ATTRIBUTE TAKES A SPACE #
  2282. VTXCUR = 0;
  2283. VTYCUR = 0;
  2284. END
  2285. END
  2286. END
  2287. CONTROL IFEQ EDITORVDT,0; # IF NOT FSE VERSION OF VIRTERM #
  2288. IF TABLOCKMDE[0] THEN
  2289. BEGIN # IF BLOCK MODE TERMINAL #
  2290. VTCOUNT = (VTYCUR * (VTXMAX + 1)) + VTXCUR;
  2291. IF VTCOUNT LS VTHOLD - 1 OR VTCOUNT GR VTHOLD THEN
  2292. BEGIN # IF TERMINATING PREVIOUS FIELD #
  2293. VDTOUT(X"1D"); # START FIELD ORDER #
  2294. VDTOUT(X"30"); # AUTOSKIP, DISPLAY, NON-SELECT #
  2295. END
  2296. VTHOLD = VTCOUNT; # UPDATE POSITION #
  2297. END
  2298. CONTROL FI; # END OF IF NOT FSE #
  2299. END
  2300. VDMOVE(VTXCUR,VTYCUR); # MOVE CURSOR #
  2301.  
  2302. LASTPOS = VTHOLD; # UPDATE LAST POSITION #
  2303.  
  2304. IOEND # VDTSAP #
  2305. CONTROL EJECT;
  2306.  
  2307. PROC VDTSTD(COLUMNS,LINES);
  2308.  
  2309. # TITLE VDTSTD - SET TERMINAL DIMENSIONS. #
  2310.  
  2311. IOBEGIN(VDTSTD)
  2312.  
  2313. #
  2314. ** VDTSTD - SET TERMINAL DIMENSIONS.
  2315. *
  2316. * THIS PROCEDURE ATTEMPTS TO SET THE REQUESTED TERMINAL DIMENSIONS.
  2317. * IF THE DIMENSIONS CAN NOT BE ALTERED AS REQUESTED, NO ACTION WILL
  2318. * OCCUR. IF POSSIBLE, *VDTSTD* WILL CHANGE THE WIDTH AND/OR LENGTH
  2319. * OF THE TERMINAL SCREEN TO CONFORM AS NEARLY AS POSSIBLE TO THE
  2320. * SPECIFIED SIZE.
  2321. *
  2322. * PROC VDTSTD(COLUMNS,LINES)
  2323. *
  2324. * ENTRY COLUMNS = NUMBER OF COLUMNS DESIRED.
  2325. * LINES = NUMBER OF LINES DESIRED.
  2326. *
  2327. * EXIT TERMINAL DIMENSIONS ADJUSTED IF NECESSARY AND POSSIBLE.
  2328. *
  2329. * CALLS VDCTRL.
  2330. *
  2331. * USES VTI, VTJ, VTXMAX, VTYMAX.
  2332. #
  2333.  
  2334. ITEM COLUMNS I; # NUMBER OF COLUMNS DESIRED #
  2335. ITEM LINES I; # NUMBER OF LINES DESIRED #
  2336.  
  2337. ITEM TMP1 U; # TEMPORARY STORAGE #
  2338. ITEM TMP2 U; # TEMPORARY STORAGE #
  2339. ITEM TMP3 U; # TEMPORARY STORAGE #
  2340. ITEM TMP4 U; # TEMPORARY STORAGE #
  2341. ITEM TMP5 U; # TEMPORARY STORAGE #
  2342.  
  2343. VTI = COLUMNS;
  2344. VTJ = LINES;
  2345. TMP2 = 0;
  2346. TMP3 = -1;
  2347. TMP4 = 0;
  2348. TMP5 = 0;
  2349. FOR TMP1 = 0 STEP 15 WHILE TMP3 LS VTI
  2350. AND TMP3 NQ 0 AND TMP1 LS 60 DO
  2351. BEGIN # FIND BEST COLUMNS FIT #
  2352. TMP3 = B<TMP1,8>TABHEADSIX;
  2353. IF TMP3 GR TMP4 THEN
  2354. BEGIN # IF BETTER THAN PREVIOUS BEST #
  2355. TMP2 = TMP1;
  2356. TMP4 = TMP3;
  2357. TMP5 = B<TMP1+8,7>TABHEADSIX;
  2358. END
  2359. END
  2360.  
  2361. TMP3 = -1;
  2362. FOR TMP1 = TMP2 STEP 15 WHILE TMP3 LS VTJ
  2363. AND TMP3 NQ 0 AND TMP1 LS 60 DO
  2364. BEGIN # FIND BEST ROWS FIT #
  2365. TMP3 = B<TMP1+8,7>TABHEADSIX;
  2366. IF TMP3 GR TMP5 THEN
  2367. BEGIN # IF BETTER THAN PREVIOUS BEST #
  2368. TMP2 = TMP1;
  2369. TMP4 = B<TMP1,8>TABHEADSIX;
  2370. TMP5 = TMP3;
  2371. END
  2372. END
  2373.  
  2374. IF VTXMAX NQ TMP4-1 OR VTYMAX NQ TMP5-1 THEN
  2375. BEGIN # IF SIZE CHANGE REQUIRED #
  2376. VTXMAX = TMP4 - 1;
  2377. VTYMAX = TMP5 - 1;
  2378. IF TMP2 LS 15 THEN VDCTRL(OUT"SCREENSZ1");
  2379. ELSE IF TMP2 LS 30 THEN VDCTRL(OUT"SCREENSZ2");
  2380. ELSE IF TMP2 LS 45 THEN VDCTRL(OUT"SCREENSZ3");
  2381. ELSE VDCTRL(OUT"SCREENSZ4");
  2382. END
  2383.  
  2384. IOEND # VDTSTD #
  2385. CONTROL EJECT;
  2386. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2387.  
  2388. PROC VDTSTM(MODE,STAT);
  2389.  
  2390. # TITLE VDTSTM - SET TERMINAL MODE. #
  2391.  
  2392. BEGIN # VDTSTM #
  2393.  
  2394. #
  2395. ** VDTSTM - SET TERMINAL MODE.
  2396. *
  2397. * THIS PROCEDURE SETS THE TERMINAL MODE TO EITHER SCREEN OR LINE.
  2398. *
  2399. * PROC VDTSTM(MODE,STAT)
  2400. *
  2401. * ENTRY MODE = 1, IF SCREEN MODE REQUESTED.
  2402. * = 0, IF LINE MODE REQUESTED.
  2403. *
  2404. * EXIT STAT = 1, IF CURRENT MODE IS SCREEN.
  2405. * = 0, IF CURRENT MODE IS LINE.
  2406. *
  2407. *IF UNDEF QTRM
  2408. * CALLS VDCTRL, VDTBOO, VDTCLO, VDTGSL, VDTITD, VDTPRT$
  2409. * VDTSTR, VDSYNCH, VDTWTO.
  2410. *ELSE
  2411. * CALLS VDTITD, VDSYNCH.
  2412. *ENDIF
  2413. *
  2414. * USES VTXMAX, VTYMAX.
  2415. *
  2416. * NOTES VDTSTM DOES NOT SET THE TERMINAL SIZE, THAT
  2417. * TASK IS PERFORMED BY A CALL TO VDTSTD. THE
  2418. * VDTBOO OUTPUT SEQUENCE INCLUDES THE SEQUENCE
  2419. * NECESSARY TO DISABLE PROTECT FOR THE TERMINAL.
  2420. * VDTBOO MUST HAVE BEEN CALLED PRIOR TO VDTSTM.
  2421. #
  2422.  
  2423. ITEM MODE I; # REQUESTED MODE #
  2424. ITEM MODELNAME C(6); # *TDU* DEFINED MODEL NAME #
  2425. ITEM STAT I; # SELECTED MODE #
  2426.  
  2427. DEF XONOFF #O"00164104400100000000"#; # XPARENT ON AND OFF #
  2428.  
  2429. VDTITD(MODELNAME); # INITIALIZE *TDU* DEFINITION #
  2430. *IF UNDEF,QTRM
  2431. VDTGSL(VTMODEL,STAT); # GET MODEL AND SCREEN OR LINE #
  2432. *ELSE
  2433. MODELNAME = NIT$TRNAM[NIT$CON]; # GET MODELNAME #
  2434. MODE = 1;
  2435. STAT = 1;
  2436. *ENDIF
  2437.  
  2438. IF MODELNAME NQ " " THEN
  2439. BEGIN # IF OS MODE IS SCREEN #
  2440. IF MODE EQ 1 THEN
  2441. BEGIN # IF SCREEN MODE IS REQUESTED #
  2442. TABLOCKMDE[0] = TABCURADDT[0] EQ 4;
  2443. VDSYNCH; # FLUSH ANY OUTPUT #
  2444. *IF UNDEF,QTRM
  2445. VDTWTO(XONOFF); # XPARENT ON AND OFF #
  2446. *ENDIF
  2447. CONTROL IFEQ EDITORVDT,1;
  2448. IF TABTYPHEAD[0] THEN
  2449. BEGIN # IF TYPE AHEAD REQUESTED #
  2450. VDTSTR(ENABLEMMSG); # ENABLE MULTI-MSG TRANSPARENT #
  2451. VDTPRT$(0); # PROMPT OFF #
  2452. END
  2453. CONTROL FI;
  2454. VDTTFF(OUT"CLREOL",VTCOUNT); # TEST CLEAR EOL AND SET FLAG #
  2455. VTCLRFRST[0] = VTCOUNT NQ 0 AND NOT TABLOCKMDE[0];
  2456. IF VTCLRFRST[0] THEN
  2457. BEGIN # IF TERMINAL HAS A CLEAR TO EOL #
  2458. VDTTFF(OUT"CURSORSTR",VTCOUNT);
  2459. VTNUMBLNK[0] = VTCOUNT; # FIND BLANK/VDTPOS THRESHOLD #
  2460. VDTTFF(OUT"CURSORSEC",VTCOUNT);
  2461. VTNUMBLNK[0] = VTNUMBLNK[0] + VTCOUNT;
  2462. VDTTFF(OUT"CURSORTHR",VTCOUNT);
  2463. VTNUMBLNK[0] = VTNUMBLNK[0] + VTCOUNT;
  2464. IF TABCURADDT[0] EQ 3 THEN
  2465. BEGIN # IF ANSI #
  2466. IF TABXDECIML[0] EQ 0 THEN
  2467. BEGIN # IF NOT FIXED LENGTH X/Y #
  2468. VTNUMBLNK[0] = VTNUMBLNK[0] + 4;
  2469. END
  2470. ELSE
  2471. BEGIN # FIXED LENGTH COORDINATES #
  2472. VTNUMBLNK[0] = VTNUMBLNK[0] + TABXDECIML[0] + TABYDECIML[0];
  2473. END
  2474. END
  2475. ELSE IF TABCURADDT[0] EQ 5 THEN
  2476. BEGIN # IF 3151 #
  2477. VTNUMBLNK[0] = VTNUMBLNK[0] + 4;
  2478. END
  2479. ELSE
  2480. BEGIN # BINARY OR 721 #
  2481. VTNUMBLNK[0] = VTNUMBLNK[0] + 2;
  2482. END
  2483. END
  2484. CONTROL IFEQ EDITORVDT,1;
  2485. VDTBOO; # BEGIN OUTPUT SEQUENCE #
  2486. CONTROL FI;
  2487. SCREENMODE = TRUE; # SCREEN MODE IS TRUE #
  2488. VDCTRL(OUT"SETSCRMODE"); # SET SCREEN MODE #
  2489. VDTTFF(OUT"UNDERLNEON",VTCOUNT); # TEST UNDERLINE AND SET FLAG #
  2490. VTPSUNDREQ[0] = VTCOUNT EQ 0 AND NOT TABLOCKMDE[0];
  2491. STAT = 1;
  2492. VDSYNCH; # FLUSH OUTPUT #
  2493. END
  2494. ELSE
  2495. BEGIN # IF LINE MODE REQUESTED #
  2496. IF SCREENMODE THEN
  2497. BEGIN # IF CURRENT MODE IS SCREEN #
  2498. VDSYNCH; # FLUSH ANY OUTPUT #
  2499. CONTROL IFEQ EDITORVDT,1;
  2500. IF TABTYPHEAD[0] THEN
  2501. BEGIN # IF TYPE AHEAD WAS ON #
  2502. VDTSTR(DISABLMMSG); # DISABLE MULTI-MSG TRANSPARENT #
  2503. VDTPRT$(1); # PROMPT ON #
  2504. END
  2505. CONTROL FI;
  2506. VTXMAX = 0; # CLEAR SCREEN SIZE #
  2507. VTYMAX = 0;
  2508. SCREENMODE = FALSE; # SCREEN MODE IS FALSE #
  2509. VDCTRL(OUT"SETLNEMODE"); # SET LINE MODE #
  2510. VDSYNCH; # FLUSH OUTPUT #
  2511. STAT = 0;
  2512. CONTROL IFEQ EDITORVDT,1;
  2513. VDTCLO(0); # FLUSH THE OUTPUT BUFFER #
  2514. VTTDUREAD[0] = FALSE; # CLEAR VALID TABLE READ FLAG #
  2515. CONTROL FI;
  2516. END
  2517. END
  2518. END
  2519. ELSE
  2520. BEGIN # OS MODE IS LINE #
  2521. STAT = 0;
  2522. END
  2523.  
  2524. END # VDTSTM #
  2525. CONTROL FI; # END OF IF SINGLE USER FSE #
  2526. *IF UNDEF,QTRM
  2527. CONTROL EJECT;
  2528.  
  2529. PROC VDTSTR(STRING);
  2530.  
  2531. # TITLE VDTSTR - WRITE ONE LINE OF OUTPUT. #
  2532.  
  2533. IOBEGIN(VDTSTR)
  2534.  
  2535. #
  2536. ** VDTSTR - WRITE ONE LINE OF OUTPUT.
  2537. *
  2538. * THIS PROCEDURES WRITES A STRING OF ASCII8 CHARACTERS.
  2539. *
  2540. * PROC VDTSTR(STRING)
  2541. *
  2542. * ENTRY STRING = ASCII8 STRING, ZERO BYTE TERMINATED.
  2543. *
  2544. * USES VTHOLD.
  2545. *
  2546. * CALLS VDTWTC, VDSYNCH.
  2547. #
  2548.  
  2549. ARRAY STRING [0:0] P(1);; # LINE IMAGE BUFFER #
  2550. BASED ARRAY PARM [0:0] P(1);; # LINE IMAGE BUFFER ADDRESS #
  2551.  
  2552. VTHOLD = LOC(STRING); # SAVE PARAMETER ADDRESS #
  2553.  
  2554. # END OF NON-REENTRANT PARAMETER USAGE #
  2555.  
  2556. VDSYNCH;
  2557.  
  2558. # START OF NON-REENTRANT CODE SEQUENCE #
  2559.  
  2560. P<PARM> = VTHOLD; # RESTORE BUFFER ADDRESS #
  2561. VDTWTC(PARM); # WRITE LINE OF OUTPUT #
  2562.  
  2563. # END OF NON-REENTRANT CODE SEQUENCE #
  2564.  
  2565. IOEND # VDTSTR #
  2566. *ELSE
  2567. CONTROL EJECT; # QTRM VARIANT OF VDTSTR #
  2568.  
  2569. PROC VDTSTR(STRING);
  2570.  
  2571. # TITLE VDTSTR - WRITE ONE LINE OF OUTPUT. #
  2572.  
  2573. BEGIN # VDTSTR #
  2574.  
  2575. #
  2576. ** VDTSTR - WRITE ONE LINE OF OUTPUT.
  2577. *
  2578. * THIS PROCEDURE WRITES A STRING OF ASCII CHARACTERS.
  2579. *
  2580. * PROC VDTSTR(STRING)
  2581. *
  2582. * ENTRY STRING = ASCII8 STRING, ZERO BYTE TERMINATED.
  2583. *
  2584. * USES VTHOLD.
  2585. *
  2586. * CALLS SFNQUE, VDSYNCH.
  2587. #
  2588. ARRAY STRING [0:0] P(1); # LINE IMAGE BUFFER #
  2589. BEGIN
  2590. ITEM STRING$WORD U(00,00,60); # BUFFER WORD (INTEGER) #
  2591. END
  2592. BASED ARRAY PARM [0:0] P(1);; # LINE IMAGE BUFFER ADDRESS #
  2593.  
  2594. ITEM BIT I; # BIT POSITION #
  2595. ITEM I I; # DUMMY PARAMETER #
  2596. ITEM OH$SEVEN I; # SET FOR 0007 IN BYTE 1 #
  2597. ITEM NUMCHAR I; # NUMBER OF CHARACTERS #
  2598. ITEM WORD I; # BUFFER WORD #
  2599.  
  2600. VTHOLD = LOC(STRING);
  2601. VDSYNCH; # POSITION TO A WORD BOUNDARY #
  2602. P<PARM> = VTHOLD;
  2603. WORD = 0;
  2604. BIT = 0;
  2605. NUMCHAR = 0;
  2606. OH$SEVEN = 0;
  2607.  
  2608. IF B<0,12>STRING$WORD[0] EQ O"0007" THEN
  2609. BEGIN # IF TRANSPARENT OUTPUT BYTE #
  2610. B<0,12>STRING$WORD[0] = O"0000";
  2611. OH$SEVEN = 1; # SET FLAG TO RESTORE 0007 BYTE #
  2612. NUMCHAR = 1;
  2613. BIT = 12;
  2614. END
  2615.  
  2616. VDTSTR1: # LOOP FOR A ZERO BYTE #
  2617.  
  2618. IF B<BIT,12>STRING$WORD[WORD] EQ 0 THEN
  2619. BEGIN # IF LAST WORD #
  2620. NIT$CTLC = NUMCHAR; # STORE STRING INTO QTRM BUFFER #
  2621. SFNQUE("PUT",PARM,I);
  2622. IF OH$SEVEN NQ 0 THEN
  2623. BEGIN # IF NEED TO RESTORE 0007 BYTE #
  2624. B<0,12>STRING$WORD[0] = O"0007";
  2625. END
  2626. RETURN; # RETURN #
  2627. END
  2628.  
  2629. NUMCHAR = NUMCHAR + 1; # POSITION TO NEXT CHARACTER #
  2630. BIT = BIT + 12;
  2631. IF BIT GQ 60 THEN
  2632. BEGIN # IF WORD FULL #
  2633. BIT = 0; # POSITION TO NEXT WORD #
  2634. WORD = WORD + 1;
  2635. END
  2636.  
  2637. GOTO VDTSTR1; # CONTINUE #
  2638.  
  2639. END # VDTSTR #
  2640. *ENDIF
  2641. CONTROL EJECT;
  2642.  
  2643. PROC VDTSTS(TABX);
  2644.  
  2645. # TITLE VDTSTS - SET TAB STOP. #
  2646.  
  2647. IOBEGIN(VDTSTS)
  2648.  
  2649. #
  2650. ** VDTSTS - SET TAB STOP.
  2651. *
  2652. * THIS PROCEDURE SETS A TAB STOP AT POSITION TABX ON THE
  2653. * CURRENT LINE.
  2654. *
  2655. * PROC VDTSTS(TABX)
  2656. *
  2657. * ENTRY TABX = X COORDINATE FOR TAB STOP.
  2658. *
  2659. * EXIT TAB SET AT POSITION (TABX,VTYCUR).
  2660. *
  2661. * CALLS VDCTRL, VDMOVE.
  2662. #
  2663.  
  2664. ITEM TABX I; # X COORDINATE FOR TAB STOP #
  2665.  
  2666. # START OF NON-REENTRANT CODE SEQUENCE #
  2667.  
  2668. IF TABX GR VTXMAX OR TABX LS 0 THEN IORET
  2669.  
  2670. # END OF NON-REENTRANT CODE SEQUENCE #
  2671.  
  2672. VDMOVE(TABX,VTYCUR); # POSITION CURSOR #
  2673.  
  2674. # END OF NON-REENTRANT PARAMETER USAGE #
  2675.  
  2676. VDCTRL(OUT"SETTABSTOP"); # SET TAB STOP #
  2677.  
  2678. IOEND # VDTSTS #
  2679. *IF DEF,QTRM
  2680. CONTROL EJECT; # QTRM VDTWTO ROUTINE #
  2681.  
  2682. PROC VDTWTO (A);
  2683.  
  2684. # TITLE - WRITE ONE WORD OF OUTPUT. #
  2685.  
  2686. BEGIN # VDTWTO #
  2687.  
  2688. #
  2689. ** VDTWTO - WRITE ONE WORD OF OUTPUT.
  2690. *
  2691. * THIS PROCEDURE WRITES ONE WORD OF OUTPUT FROM BUFFER *A*.
  2692. *
  2693. * PROC VDTWTO(A)
  2694. *
  2695. * ENTRY A = THE BUFFER.
  2696. *
  2697. * CALLS SFNQUE.
  2698. #
  2699. ARRAY A [0:0] P(1);; # WORD OF OUTPUT #
  2700. ITEM I I; # DUMMY PARAMETER #
  2701.  
  2702. NIT$CTLC = 5; # PUT WORD INTO QUEUE #
  2703. SFNQUE("PUT",A,I);
  2704.  
  2705. END # VDTWTO #
  2706. *ENDIF
  2707. *IF UNDEF,QTRM
  2708. CONTROL EJECT; # EDITOR CALLABLE ONLY #
  2709.  
  2710. PROC VDSYNCH;
  2711.  
  2712. # TITLE VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR. #
  2713.  
  2714. IOBEGIN(VDSYNCH)
  2715.  
  2716. #
  2717. ** VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR.
  2718. *
  2719. * THIS PROCEDURE FLUSHES PARTIAL WORDS OF OUTPUT AND INITIALIZES
  2720. * THE ACCUMULATOR WORD AND POINTER.
  2721. *
  2722. * PROC VDSYNCH
  2723. *
  2724. * ENTRY VTOUTNEXT = ACCUMULATOR BIT POSITION.
  2725. * VTOUTDATA = ACCUMULATOR WORD.
  2726. *
  2727. * EXIT VTOUTDATA = TRANSPARENT OUTPUT WORD.
  2728. * VTOUTNEXT = 12.
  2729. *
  2730. * CALLS VDTWTO.
  2731. *
  2732. * USES VTOUTDATA, VTOUTNEXT.
  2733. #
  2734.  
  2735. IF VTOUTNEXT NQ 0 AND VTOUTDATA NQ XPARENTOUT THEN
  2736. BEGIN # IF NOT EMPTY ACCUMULATOR #
  2737. VDTWTO(VTOUTDATA); # FLUSH ACCUMULATOR WORD #
  2738. END
  2739. VTOUTDATA = XPARENTOUT; # ASSURE XPARENT OUTPUT #
  2740. VTOUTNEXT = 12; # SET BIT POSITION #
  2741.  
  2742. IOEND # VDSYNCH #
  2743. *ELSE
  2744. CONTROL EJECT; # QTRM VERSION OF VDSYNCH #
  2745.  
  2746. PROC VDSYNCH;
  2747.  
  2748. # TITLE VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR. #
  2749.  
  2750. BEGIN # VDSYNCH #
  2751.  
  2752. #
  2753. ** VDSYNCH - INSURE FLUSH OF ONE WORD ACCUMULATOR.
  2754. *
  2755. * THIS PROCEDURE FLUSHES PARTIAL WORDS OF OUPUT FOR QTRM.
  2756. *
  2757. * PROC VDSYNCH
  2758. *
  2759. * ENTRY VTOUTNEXT = ACCUMULATOR BIT POSITION.
  2760. * VTOUTDATA = ACCUMULATOR WORD.
  2761. *
  2762. * EXIT VTOUTNEXT = 0.
  2763. * VTOUTDATA = 0.
  2764. *
  2765. * CALLS SFNQUE.
  2766. #
  2767. ITEM I I; # DUMMY PARAMETER #
  2768.  
  2769. IF VTOUTNEXT NQ 0 THEN
  2770. BEGIN # IF DATA TO ENQUEUE #
  2771. NIT$CTLC = VTOUTNEXT / 12; # ENQUEUE DATA #
  2772. SFNQUE("PUT",VTOUTDATA,I);
  2773. VTOUTDATA = 0; # CLEAR ACCUMULATOR #
  2774. VTOUTNEXT = 0; # SET BIT POSITION #
  2775. END
  2776.  
  2777. END # VDSYNCH #
  2778. *ENDIF
  2779. CONTROL EJECT; # INTERNAL (VIRTERM) PROCEDURES #
  2780.  
  2781. PROC VDCTRL(ORDINAL);
  2782.  
  2783. # TITLE VDCTRL - ISSUE AN OUTPUT CONTROL SEQUENCE BY ORDINAL. #
  2784.  
  2785. IOBEGIN(VDCTRL)
  2786.  
  2787. #
  2788. ** VDCTRL - ISSUE AN OUTPUT CONTROL SEQUENCE BY ORDINAL.
  2789. *
  2790. * THIS PROCEDURE OUTPUTS 0 TO N CHARACTERS (BY ORDINAL) USING
  2791. * THE ORDINAL AS A POINTER IN THE *TDU* PRODUCED TABLE TO FIND
  2792. * THE CORRECT OUTPUT SEQUENCE FOR THE OUTPUT FUNCTION REQUESTED.
  2793. *
  2794. * PROC VDCTRL(ORDINAL)
  2795. *
  2796. * ENTRY ORDINAL = *TDU* ORDINAL FOR OUTPUT SEQUENCE.
  2797. *
  2798. * EXIT NUMBERBYTE = NUMBER OF BYTES OUTPUT FOR SEQUENCE.
  2799. *
  2800. * CALLS VDGNCP, VDGNOB, VDTOUT, VDSYNCH, VDTWRR$.
  2801. *
  2802. * USES NUMBERBYTE, VDCHAR, VTCOUNT, VTHOLD, VTI, VTJ.
  2803. *
  2804. * NOTES NUMBERBYTE IS USED BY VARIOUS ROUTINES AFTER VDCTRL
  2805. * IS CALLED TO DETERMINE IF THE FUNCTION IS AVAILABLE.
  2806. #
  2807.  
  2808. ITEM ORDINAL I; # ORDINAL #
  2809.  
  2810. ITEM I I; # COUNTER #
  2811. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2812. ITEM RECALL I = 1; # RECALL FOR WRITER REQUEST #
  2813. ITEM VTPOS I; # BUFFER POSITION #
  2814. CONTROL FI; # END OF IF NOT MULTI USER FSE #
  2815. CONTROL EJECT; # EMBEDDED VDCTRL PROCEDURE #
  2816.  
  2817. PROC VDGNOB;
  2818.  
  2819. # TITLE VDGNOB - GET NEXT OUTPUT BYTE. #
  2820.  
  2821. BEGIN # VDGNOB #
  2822.  
  2823. #
  2824. * VDGNOB - GET NEXT OUTPUT BYTE.
  2825. *
  2826. * THIS PROCEDURE GETS THE NEXT OUTPUT BYTE.
  2827. *
  2828. * EXIT VTCHAR = NEXT OUTPUT BYTE.
  2829. *
  2830. * USES VTCHAR, VTHOLD, VTI, VTJ.
  2831. #
  2832.  
  2833. VTCOUNT = VTCOUNT - 1;
  2834. VTI = VTHOLD / 8;
  2835. VTJ = 7 * (VTHOLD - (VTI * 8));
  2836. VTCHAR = B<VTJ+4,7>TABFULLWRD[VTI];
  2837. VTHOLD = VTHOLD + 1;
  2838.  
  2839. END # VDGNOB #
  2840. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2841. CONTROL EJECT; # EMBEDDED VDCTRL PROCEDURE #
  2842.  
  2843. PROC VDGNCP(VTCUR,VTMAX);
  2844.  
  2845. # TITLE VDGNCP - GET NEXT CURSOR POSITION. #
  2846.  
  2847. BEGIN # VDGNCP #
  2848.  
  2849. #
  2850. * VDGNCP - GET NEXT CURSOR POSITION.
  2851. *
  2852. * THIS PROCEDURE GETS THE NEXT CURSOR POSITION.
  2853. *
  2854. * ENTRY VTCUR = CURRENT CURSOR POSITION.
  2855. * VTMAX = MAXIMUM CURSOR POSITION.
  2856. *
  2857. * EXIT VTCHAR = CURSOR COORDINATE.
  2858. *
  2859. * CALLS VDGNOB.
  2860. *
  2861. * USES VTCHAR, VTHOLD, VTI, VTJ.
  2862. #
  2863.  
  2864. ITEM VTCUR I; # CURRENT CURSOR POSITION #
  2865. ITEM VTMAX I; # MAXIMUM CURSOR POSITION #
  2866.  
  2867. IF VTCOUNT NQ 0 THEN
  2868. BEGIN # IF SOMETHING TO PROCESS #
  2869. VDGNOB; # GET NEXT OUTPUT BYTE #
  2870. IF VTCHAR EQ X"7E" THEN
  2871. BEGIN # IF USING CURRENT POSITION #
  2872. VTCHAR = VTCUR;
  2873. END
  2874. ELSE
  2875. BEGIN # NOT CURRENT POSITION #
  2876. IF VTCHAR EQ X"7F" THEN
  2877. BEGIN # IF USING MAXIMUM POSITION #
  2878. VTCHAR = VTMAX;
  2879. END
  2880. END
  2881. END
  2882.  
  2883. END # VDGNCP #
  2884. CONTROL FI; # END OF IF NOT MULTI FSE #
  2885. CONTROL EJECT; # START OF MAIN CODE FOR VDCTRL #
  2886.  
  2887. VTHOLD = ORDINAL;
  2888.  
  2889. # END OF NON-REENTRANT PARAMETER USAGE #
  2890.  
  2891. NUMBERBYTE = 0; # CLEAR NUMBER OF BYTES COUNT #
  2892. IF VTHOLD GR OUT"RESERVED" AND VTHOLD LS OUT"LASTOUT" THEN
  2893. BEGIN # IF LEGAL OUTPUT ORDINAL #
  2894. VTI = VTHOLD / 5; # GET OFFSET FOR ORDINAL #
  2895. VTJ = 12 * (VTHOLD - (VTI * 5));
  2896. VTHOLD = B<VTJ,12>TABFULLWRD[VTI];
  2897. IF VTJ NQ 48 THEN
  2898. BEGIN # IF NEXT BYTE IS IN SAME WORD #
  2899. VTCOUNT = B<VTJ+12,12>TABFULLWRD[VTI];
  2900. END
  2901. ELSE
  2902. BEGIN # GET BYTE FROM NEXT WORD #
  2903. VTCOUNT = B<0,12>TABFULLWRD[VTI+1];
  2904. END
  2905. VTCOUNT = VTCOUNT - VTHOLD; # CALCULATE NUMBER OF BYTES #
  2906. NUMBERBYTE = VTCOUNT; # SAVE NUMBER OF BYTES #
  2907. IF (VTHOLD + VTCOUNT) / 8 LS O"272" THEN
  2908. BEGIN # IF WITHIN *TDU* TABLE #
  2909. FOR I = I WHILE VTCOUNT NQ 0 DO
  2910. BEGIN # WHILE NOT DONE #
  2911. VDGNOB; # GET NEXT OUTPUT BYTE #
  2912. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2913. CONTROL IFEQ QTRMV,0; # IF NOT QTRM VARIANT #
  2914. IF TABLOCKMDE[0] AND (VTCHAR EQ X"11") THEN
  2915. BEGIN # IF BLOCK MODE SBA #
  2916.  
  2917. CONTROL IFEQ EDITORVDT,0; # IF NOT EDITOR VIRTERM #
  2918. P<TTYO> = LISTFETPTR; # SET BASED ARRAY ADDRESS #
  2919. CONTROL FI; # END OF NOT EDITOR VIRTERM #
  2920.  
  2921. VTI = TTYOIN - TTYOOT;
  2922. IF VTI LS 0 THEN
  2923. BEGIN # IF *CIRCULAR* INPUT/OUTPUT #
  2924. VTI = VTI + (TTYOLM - TTYOFT);
  2925. END
  2926.  
  2927. IF VTI GR O"144" THEN
  2928. BEGIN # IF NEAR *1MI* BREAK THRESHOLD #
  2929. VDSYNCH; # FLUSH BUFFER #
  2930. *IF DEF,DEBUG
  2931. VDTDMP$; # DUMP BUFFER FOR DEBUG #
  2932. *ENDIF
  2933. VDTWRR$(TTYO,RECALL); # FLUSH BUFFER #
  2934. VTOUTDATA = O"0007 4061 4103 0000 0000";
  2935. VTOUTNEXT = 36;
  2936. END
  2937. END
  2938. CONTROL FI; # END OF NOT QTRM VIRTERM #
  2939. CONTROL FI; # END OF IF NOT MULTI FSE #
  2940. VDTOUT(VTCHAR); # OUTPUT BYTE #
  2941. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2942. IF TABLOCKMDE[0] THEN
  2943. BEGIN # IF BLOCK MODE TERMINAL #
  2944. IF VTCHAR EQ X"11" OR VTCHAR EQ X"12" OR VTCHAR EQ X"14" THEN
  2945. BEGIN # IF SBA, RA OR EUA ORDER #
  2946. VDGNCP(VTYCUR,VTYMAX+1); # GET ROW COORDINATE #
  2947. VTPOS = VTCHAR * (VTXMAX + 1);
  2948. VDGNCP(VTXCUR,VTXMAX); # GET COLUMN COORDINATE #
  2949. VTPOS = VTPOS + VTCHAR;
  2950. VDTOUT(RTA3270[B<48,6>VTPOS]); # OUTPUT BYTE 1 OF ADDRESS #
  2951. VDTOUT(RTA3270[B<54,6>VTPOS]); # OUTPUT BYTE 2 OF ADDRESS #
  2952. END
  2953. ELSE IF VTCHAR EQ X"1D" THEN
  2954. BEGIN # IF START FIELD #
  2955. VTCHAR = 0;
  2956. IF VTCOUNT NQ 0 THEN
  2957. VDGNOB; # GET NEXT OUTPUT BYTE #
  2958. IF ATTGUARDMD[0] THEN
  2959. BEGIN # IF GUARD MODE #
  2960. VTCHAR = X"3C"; # ASSUME UNPROTECTED #
  2961. END
  2962. ELSE
  2963. BEGIN # IF UNGUARDED FIELD #
  2964. IF VTCHAR EQ X"38" THEN
  2965. BEGIN # IF HIGHLIGHTED FIELD #
  2966. IF NOT ATTPROTECT[0] THEN VTCHAR = VTCHAR + X"10";
  2967. END
  2968. ELSE
  2969. BEGIN
  2970. VTCHAR = X"44"; # ASSUME UNPROTECTED AND NORMAL #
  2971. IF ATTPROTECT[0] THEN VTCHAR = VTCHAR - X"10";
  2972. END
  2973. END
  2974. VDTOUT(VTCHAR); # OUTPUT FIELD ATTRIBUTE #
  2975. END
  2976. END
  2977. CONTROL FI; # END OF IF NOT MULTI FSE #
  2978. END
  2979. END
  2980. END
  2981.  
  2982. IOEND # VDCTRL #
  2983. CONTROL EJECT;
  2984.  
  2985. CONTROL IFEQ SINGLE,1;
  2986. PROC VDGETW(WORD,STAT);
  2987.  
  2988. # TITLE VDGETW - GET WORD FROM *TDU* TABLE. #
  2989.  
  2990. BEGIN # VDGETW #
  2991.  
  2992. #
  2993. ** VDGETW - GET WORD FROM *TDU* TABLE.
  2994. *
  2995. * THIS PROCEDURE GETS THE NEXT WORD FROM THE *TDU* TABLE FOR
  2996. * EITHER A RESIDENT OR A NON-RESIDENT TABLE.
  2997. *
  2998. * PROC VDGETW(WORD,STAT)
  2999. *
  3000. * ENTRY TDUINDEX = WORD COUNT READ SO FAR OF *TDU* TABLE.
  3001. * TDURESID = RESIDENT *TDU* TABLE FLAG.
  3002. *
  3003. * EXIT WORD = THE NEXT WORD FROM THE *TDU* TABLE.
  3004. * STAT = 0, IF NO ERROR.
  3005. *
  3006. * CALLS VDTREO$.
  3007. *
  3008. * USES TDUINDEX.
  3009. #
  3010.  
  3011. ITEM STAT I; # STATUS RETURNED #
  3012. ITEM WORD U; # WORD FROM *TDU* TABLE #
  3013.  
  3014. STAT = 0;
  3015. IF TDURESID[0] THEN
  3016. BEGIN # IF RESIDENT *TDU* TABLE #
  3017. WORD = TEMPWORD[TDUINDEX[0]]; # GET WORD FROM MEMORY #
  3018. END
  3019. ELSE
  3020. BEGIN # IF NON-RESIDENT *TDU* TABLE #
  3021. VDTREO$(TDUFET,WORD,STAT); # READ WORD FROM CIO BUFFER #
  3022. END
  3023. TDUINDEX[0] = TDUINDEX[0] + 1; # UPDATE COUNT #
  3024.  
  3025. END # VDGETW #
  3026. CONTROL FI;
  3027. CONTROL EJECT;
  3028.  
  3029. PROC VDMOVE(XX,YY);
  3030.  
  3031. # TITLE VDMOVE - CURSOR MOVEMENT. #
  3032.  
  3033. IOBEGIN(VDMOVE)
  3034.  
  3035. #
  3036. ** VDMOVE - CURSOR MOVEMENT.
  3037. *
  3038. * THIS PROCEDURE PROVIDES CURSOR POSITIONING.
  3039. *
  3040. * PROC VDMOVE(XX,YY)
  3041. *
  3042. * ENTRY XX = DESIRED X COORDINATE.
  3043. * YY = DESIRED Y COORDINATE.
  3044. *
  3045. * EXIT VTXCUR = XX.
  3046. * VTYCUR = YY.
  3047. *
  3048. * CALLS VDCTRL.
  3049. *
  3050. * USES VTXCUR, VTYCUR.
  3051. #
  3052.  
  3053. ITEM XX I; # COLUMN POSITION #
  3054. ITEM YY I; # LINE POSITION #
  3055.  
  3056. SWITCH CURADDRTYP # CURSOR ADDRESSING TYPE #
  3057. NONE, # UNDEFINED #
  3058. BINARY, # BINARY #
  3059. CDC721, # CDC 721 #
  3060. ANSI, # ANSI #
  3061. IBM3270, # 3270 #
  3062. IBM3151; # 3151 #
  3063.  
  3064. VTXCUR = XX;
  3065. VTYCUR = YY;
  3066.  
  3067. # END OF NON-REENTRANT PARAMETER USAGE #
  3068.  
  3069. VDCTRL(OUT"CURSORSTR"); # ISSUE CURSOR START SEQUENCE #
  3070.  
  3071. GOTO CURADDRTYP[TABCURADDT[0]]; # PROCESS ADDRESSING BY TYPE #
  3072.  
  3073. BINARY: # BINARY TYPE ADDRESSING #
  3074.  
  3075. IF TABXFIRSTY[0] THEN
  3076. BEGIN # IF X COORDINATE FIRST #
  3077. VDTOUT(VTXCUR+TABCURBIAS[0]); # X COORDINATE #
  3078. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3079. VDTOUT(VTYCUR+TABCURBIAS[0]); # Y COORDINATE #
  3080. END
  3081. ELSE
  3082. BEGIN # Y COORDINATE FIRST #
  3083. VDTOUT(VTYCUR+TABCURBIAS[0]); # Y COORDINATE #
  3084. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3085. VDTOUT(VTXCUR+TABCURBIAS[0]); # X COORDINATE #
  3086. END
  3087. VDCTRL(OUT"CURSORTHR"); # ISSUE THIRD CURSOR SEQUENCE #
  3088.  
  3089. GOTO ENDADDRTYP;
  3090.  
  3091. CDC721: # CDC 721 TYPE ADDRESSING #
  3092.  
  3093. IF NOT TABXFIRSTY[0] THEN
  3094. VDTOUT(VTYCUR+TABCURBIAS[0]); # IF ROW FIRST, Y COORDINATE #
  3095. IF VTXCUR LS 80 THEN
  3096. BEGIN # IF CHARACTER POSITION 0 - 79 #
  3097. VDTOUT(VTXCUR+TABCURBIAS[0]); # X COORDINATE #
  3098. END
  3099. ELSE
  3100. BEGIN # IF CHARACTER POSITION PAST 79 #
  3101. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3102. VDTOUT(VTXCUR+TABCURBIAS[0]-80); # X COORDINATE #
  3103. END
  3104. IF TABXFIRSTY[0] THEN
  3105. VDTOUT(VTYCUR+TABCURBIAS[0]); # IF COLUMN FIRST, Y COORDINATE #
  3106. VDCTRL(OUT"CURSORTHR"); # ISSUE THIRD CURSOR SEQUENCE #
  3107.  
  3108. GOTO ENDADDRTYP;
  3109.  
  3110. ANSI: # ANSI TYPE ADDRESSING #
  3111.  
  3112. IF TABXFIRSTY[0] THEN
  3113. BEGIN # IF X COORDINATE FIRST #
  3114. VDNUMC(VTXCUR+TABCURBIAS[0]+1,TABXDECIML[0]); # X COORDINATE #
  3115. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3116. VDNUMC(VTYCUR+TABCURBIAS[0]+1,TABYDECIML[0]); # Y COORDINATE #
  3117. END
  3118. ELSE
  3119. BEGIN # Y COORDINATE FIRST #
  3120. VDNUMC(VTYCUR+TABCURBIAS[0]+1,TABYDECIML[0]); # Y COORDINATE #
  3121. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3122. VDNUMC(VTXCUR+TABCURBIAS[0]+1,TABXDECIML[0]); # X COORDINATE #
  3123. END
  3124. VDCTRL(OUT"CURSORTHR"); # ISSUE THIRD CURSOR SEQUENCE #
  3125.  
  3126. GOTO ENDADDRTYP;
  3127.  
  3128. IBM3270:
  3129.  
  3130. GOTO ENDADDRTYP;
  3131.  
  3132. IBM3151:
  3133.  
  3134. IF TABXFIRSTY[0] THEN
  3135. BEGIN # IF X COORDINATE FIRST #
  3136. VTHOLD = VTXCUR/32;
  3137. VDTOUT(VTHOLD+TABCURBIAS[0]); # X COORDINATE #
  3138. VDTOUT(VTXCUR-VTHOLD*32+TABCURBIAS[0]);
  3139. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3140. VTHOLD = VTYCUR/32;
  3141. VDTOUT(VTHOLD+TABCURBIAS[0]); # Y COORDINATE #
  3142. VDTOUT(VTYCUR-VTHOLD*32+TABCURBIAS[0]+32);
  3143. END
  3144. ELSE
  3145. BEGIN # Y COORDINATE FIRST #
  3146. VTHOLD = VTYCUR/32;
  3147. VDTOUT(VTHOLD+TABCURBIAS[0]); # Y COORDINATE #
  3148. VDTOUT(VTYCUR-VTHOLD*32+TABCURBIAS[0]);
  3149. VDCTRL(OUT"CURSORSEC"); # ISSUE SECOND CURSOR SEQUENCE #
  3150. VTHOLD = VTXCUR/32;
  3151. VDTOUT(VTHOLD+TABCURBIAS[0]); # X COORDINATE #
  3152. VDTOUT(VTXCUR-VTHOLD*32+TABCURBIAS[0]+32);
  3153. END
  3154. VDCTRL(OUT"CURSORTHR"); # ISSUE THIRD CURSOR SEQUENCE #
  3155.  
  3156. GOTO ENDADDRTYP;
  3157.  
  3158. NONE: # UNDEFINED #
  3159.  
  3160. ENDADDRTYP: # END OF ADDRESS TYPE PROCESSING #
  3161.  
  3162. IOEND # VDMOVE #
  3163. CONTROL EJECT;
  3164.  
  3165. PROC VDNUMC(NUM,COUNT);
  3166.  
  3167. # TITLE VDNUMC - NUMBER CONVERSION. #
  3168.  
  3169. IOBEGIN(VDNUMC)
  3170.  
  3171. #
  3172. ** VDNUMC - NUMBER CONVERSION.
  3173. *
  3174. * THIS PROCEDURE PROVIDES FOR A BINARY NUMBER TO BE CONVERTED
  3175. * TO DECIMAL AND THEN OUTPUT TO ALLOW ANSI X3.64 POSITIONING.
  3176. *
  3177. * PROC VDNUMC(NUM,COUNT)
  3178. *
  3179. * ENTRY NUM = BINARY NUMBER TO BE CONVERTED AND OUTPUT.
  3180. * COUNT = MINIMUM NUMBER OF CHARACTERS TO OUTPUT.
  3181. *
  3182. * CALLS VDTOUT.
  3183. *
  3184. * USES VTCHARS, VTCOUNT, VTHOLD, VTI.
  3185. #
  3186.  
  3187. ITEM NUM I; # BINARY SCREEN COORDINATE #
  3188. ITEM COUNT I; # MINIMUM NUMBER OF DIGITS #
  3189.  
  3190. ITEM DB I; # INDUCTION VARIABLE #
  3191.  
  3192. VTI = COUNT - 2; # MINIMUM CHARACTER COUNT #
  3193. VTCOUNT = - 1; # ACTUAL DIGIT COUNTER #
  3194. VTHOLD = NUM; # SCREEN COORDINATE #
  3195.  
  3196. # END OF NON-REENTRANT PARAMETER USAGE #
  3197.  
  3198. # START OF NON-REENTRANT CODE SEQUENCE #
  3199.  
  3200. FOR DB = DB WHILE VTHOLD GQ 10 DO
  3201. BEGIN
  3202. VTCOUNT = VTCOUNT + 1; # INCREMENT DIGIT COUNTER #
  3203. C<VTCOUNT>VTCHARS = (VTHOLD - ((VTHOLD/10) * 10));
  3204. VTHOLD = VTHOLD / 10; # REDUCE BY FACTOR OF TEN #
  3205. VTI = VTI - 1; # DECREMENT MINIMUM COUNT #
  3206. END
  3207.  
  3208. # END OF NON-REENTRANT CODE SEQUENCE #
  3209.  
  3210. FOR VTI = VTI STEP - 1 UNTIL 0 DO
  3211. BEGIN # ZERO PAD AS NECESSARY #
  3212. VDTOUT(X"30"); # OUTPUT ZERO CHARACTER #
  3213. END
  3214.  
  3215. VDTOUT(VTHOLD+X"30"); # FIRST (NON-ZERO) DIGIT #
  3216. FOR VTCOUNT = VTCOUNT STEP - 1 UNTIL 0 DO
  3217. BEGIN # OUTPUT REST OF DIGITS #
  3218. VTHOLD = C<VTCOUNT>VTCHARS;
  3219. VDTOUT(VTHOLD+X"30");
  3220. END
  3221.  
  3222. IOEND # VDNUMC #
  3223. CONTROL EJECT;
  3224.  
  3225. PROC VDNXTI;
  3226.  
  3227. # TITLE VDNXTI - FETCH NEXT INPUT BYTE FROM BUFFER/ACCUMULATOR. #
  3228.  
  3229. IOBEGIN(VDNXTI)
  3230.  
  3231. #
  3232. ** VDNXTI - FETCH NEXT INPUT BYTE FROM BUFFER/ACCUMULATOR.
  3233. *
  3234. * THIS PROCEDURE GETS THE NEXT INPUT CHARACTER.
  3235. *
  3236. * PROC VDNXTI
  3237. *
  3238. * ENTRY VTINPDATA = ONE WORD INPUT DE-ACCUMULATOR.
  3239. * VTINPNEXT = CURRENT BIT POSITION IN VTINPDATA.
  3240. *
  3241. * EXIT VTINPNEXT = INCREMENTED OR RECIRCULATED.
  3242. * VTINPDATA = POSSIBLE NEW WORD OF TEXT.
  3243. * VTCHAR = DATA BYTE FETCHED.
  3244. *
  3245. * CALLS VDTRDO.
  3246. *
  3247. * USES VTINPDATA, VTINPNEXT.
  3248. #
  3249.  
  3250. IF VTINPNEXT EQ 60 THEN
  3251. BEGIN # IF EMPTY WORD #
  3252. *IF UNDEF,QTRM
  3253. VDTRDO(VTINPDATA); # GET NEXT WORD #
  3254. *ELSE
  3255. VTINPDATA = QTRM$WD0[VTINPWORD]; # GET NEXT WORD FROM QUEUE #
  3256. VTINPWORD = VTINPWORD + 1;
  3257. *ENDIF
  3258. VTINPNEXT = 0; # RESET BIT POSITION #
  3259. END
  3260. VTCHAR = B<VTINPNEXT,12>VTINPDATA; # GET NEXT CHARACTER #
  3261. VTCHAR = B<53,7>VTCHAR; # RIGHT JUSTIFY CHARACTER #
  3262. VTINPNEXT = VTINPNEXT + 12; # INCREMENT BIT POSITION #
  3263.  
  3264. IOEND # VDNXTI #
  3265. CONTROL EJECT; # INPUT PROCESSING #
  3266.  
  3267. PROC VDTIINP;
  3268.  
  3269. # TITLE VDTIINP - IDENTIFY NEXT VIRTUAL INPUT EVENT. #
  3270.  
  3271. IOBEGIN(VDTIINP)
  3272.  
  3273. #
  3274. ** VDTIINP - IDENTIFY NEXT VIRTUAL INPUT EVENT.
  3275. *
  3276. * THIS PROCEDURE IDENTIFIES THE NEXT VIRTUAL TERMINAL INPUT
  3277. * EVENT. THIS ROUTINE IS INTERNAL AND IS CALLED DIRECTLY BY
  3278. * THE FULL SCREEN EDITOR AFTER VDTPPI HAS BEEN CALLED.
  3279. *
  3280. * PROC VDTIINP
  3281. *
  3282. * ENTRY VTINCR = RESIDUAL CURSOR INCREMENT.
  3283. * VTXMAX = NUMBER OF COLUMNS ON SCREEN.
  3284. * VTYMAX = NUMBER OF LINES ON SCREEN.
  3285. *
  3286. * EXIT VTORDN = EVENT CATEGORY.
  3287. * VTCHAR = DATA CHARACTER OR FUNCTION KEY INDEX.
  3288. * VTYCUR = Y COORDINATE OF CURSOR POSITION.
  3289. * VTXCUR = X COORDINATE OF CURSOR POSITION.
  3290. * VTOYPOS = OLD Y COORDINATE (HOME ONLY).
  3291. * VTOXPOS = OLD X COORDINATE (HOME ONLY).
  3292. * VTINCR = SETUP FOR NEXT VDTINP CALL.
  3293. *
  3294. * CALLS VDNXTI, VDCHECK.
  3295. *
  3296. * NOTES THE INP SWITCH MUST EXACTLY PARALLEL *TDU* PRODUCED
  3297. * INPUT ORDINALS. IN SOME CASES WHERE COMMON CODE IS
  3298. * USED THE SIMULATED CASE STATEMENT ALLOWS A FALL THRU
  3299. * TO FINISH THE CODE FOR A PARTICULAR FUNCTION.
  3300. #
  3301.  
  3302.  
  3303. STATUS OPCODES # *TDU* INPUT OPCODES #
  3304. FAIL, # FAIL #
  3305. LIST, # LIST #
  3306. MANY, # MANY ACTION RANGE #
  3307. SNGL, # SINGLE ACTION RANGE #
  3308. MAXOP; # HIGHER THAN ANY VALID CODE #
  3309.  
  3310. SWITCH INP:INPUTORD # INPUT ORDINALS (SEE *COMFVDT*) #
  3311.  
  3312. # START OF CDC DEFINED INPUT/OUTPUT ORDINALS #
  3313.  
  3314. BADINPUT : BADINPUT, # UNRECOGNIZED SEQUENCE #
  3315. INSERTCHAR : INSERTCHAR, # INSERT CHARACTER #
  3316. DELETECHAR : DELETECHAR, # DELETE CHARACTER #
  3317. INSERTLINE : INSERTLINE, # INSERT LINE #
  3318. INSLNECURL : INSLNECURL, # INSERT LINE, CURSOR LEFT #
  3319. DELETELINE : DELETELINE, # DELETE LINE #
  3320. DELINECURL : DELINECURL, # DELETE LINE, CURSOR LEFT #
  3321. CLRSCREEN : CLRSCREEN, # CLEAR SCREEN #
  3322. CLRSCRCURH : CLRSCRCURH, # CLEAR SCREEN, CURSOR HOME #
  3323. CLRUNPROT : CLRUNPROT, # CLEAR UNPROTECTED #
  3324. CLREOS : CLREOS, # CLEAR TO END OF SCREEN #
  3325. ERASELINE : ERASELINE, # ERASE LINE #
  3326. ERASELNECL : ERASELNECL, # ERASE LINE, CURSOR LEFT #
  3327. CLREOL : CLREOL, # CLEAR TO END OF LINE #
  3328. NOOP : CLRFIELD, # CLEAR UNPROTECTED FIELD #
  3329. NOOP : CLRFLDCBOF, # CLEAR FIELD, CURSOR LEFT #
  3330. NOOP : CLREOF, # CLEAR TO END OF FIELD #
  3331. ERASECHAR : ERASECHAR, # ERASE CHARACTER #
  3332. CURSORHOME : CURSORHOME, # CURSOR HOME #
  3333. CURSORUP : CURSORUP, # CURSOR UP #
  3334. CURSORDOWN : CURSORDOWN, # CURSOR DOWN #
  3335. CURSORLEFT : CURSORLEFT, # CURSOR LEFT #
  3336. CURSORIGHT : CURSORIGHT, # CURSOR RIGHT #
  3337. TABFORWARD : TABFORWARD, # TAB FORWARD #
  3338. TABACKWARD : TABACKWARD, # TAB BACKWARD #
  3339. RET : RET, # RETURN #
  3340. RESET : RESET, # RESET #
  3341. INSRTMDEON : INSRTMDEON, # INSERT MODE ON #
  3342. INSRTMDOFF : INSRTMDOFF, # INSERT MODE OFF #
  3343. INSRTMDTOG : INSRTMDTOG, # INSERT MODE TOGGLE #
  3344. CLRTABSTOP : CLRTABSTOP, # CLEAR TAB STOP #
  3345. CLRALLTABS : CLRALLTABS, # CLEAR ALL TAB STOPS #
  3346. SETTABSTOP : SETTABSTOP, # SET TAB STOP #
  3347. CURSORSTR : CURSORSTR, # CURSOR POSITION START #
  3348. CURSORSEC : CURSORSEC, # CURSOR POSITION SECOND #
  3349. CURSORTHR : CURSORTHR, # CURSOR POSITION THIRD #
  3350.  
  3351. # START OF CDC DEFINED INPUT ONLY ORDINALS. #
  3352.  
  3353. EOI : EOI, # END OF INFORMATION #
  3354. CHARACTER : CHARACTER, # OVERSTRIKE CHARACTER #
  3355. FKEY : F1, # FUNCTION KEY 1 #
  3356. FKEY : F2, # FUNCTION KEY 2 #
  3357. FKEY : F3, # FUNCTION KEY 3 #
  3358. FKEY : F4, # FUNCTION KEY 4 #
  3359. FKEY : F5, # FUNCTION KEY 5 #
  3360. FKEY : F6, # FUNCTION KEY 6 #
  3361. FKEY : F7, # FUNCTION KEY 7 #
  3362. FKEY : F8, # FUNCTION KEY 8 #
  3363. FKEY : F9, # FUNCTION KEY 9 #
  3364. FKEY : F10, # FUNCTION KEY 10 #
  3365. FKEY : F11, # FUNCTION KEY 11 #
  3366. FKEY : F12, # FUNCTION KEY 12 #
  3367. FKEY : F13, # FUNCTION KEY 13 #
  3368. FKEY : F14, # FUNCTION KEY 14 #
  3369. FKEY : F15, # FUNCTION KEY 15 #
  3370. FKEY : F16, # FUNCTION KEY 16 #
  3371. FKEYSHIFT : F1S, # SHIFTED FUNCTION KEY 1 #
  3372. FKEYSHIFT : F2S, # SHIFTED FUNCTION KEY 2 #
  3373. FKEYSHIFT : F3S, # SHIFTED FUNCTION KEY 3 #
  3374. FKEYSHIFT : F4S, # SHIFTED FUNCTION KEY 4 #
  3375. FKEYSHIFT : F5S, # SHIFTED FUNCTION KEY 5 #
  3376. FKEYSHIFT : F6S, # SHIFTED FUNCTION KEY 6 #
  3377. FKEYSHIFT : F7S, # SHIFTED FUNCTION KEY 7 #
  3378. FKEYSHIFT : F8S, # SHIFTED FUNCTION KEY 8 #
  3379. FKEYSHIFT : F9S, # SHIFTED FUNCTION KEY 9 #
  3380. FKEYSHIFT : F10S, # SHIFTED FUNCTION KEY 10 #
  3381. FKEYSHIFT : F11S, # SHIFTED FUNCTION KEY 11 #
  3382. FKEYSHIFT : F12S, # SHIFTED FUNCTION KEY 12 #
  3383. FKEYSHIFT : F13S, # SHIFTED FUNCTION KEY 13 #
  3384. FKEYSHIFT : F14S, # SHIFTED FUNCTION KEY 14 #
  3385. FKEYSHIFT : F15S, # SHIFTED FUNCTION KEY 15 #
  3386. FKEYSHIFT : F16S, # SHIFTED FUNCTION KEY 16 #
  3387. GKEY : NEXTKEY, # NEXT KEY #
  3388. GKEY : BACKKEY, # BACK KEY #
  3389. GKEY : HELPKEY, # HELP KEY #
  3390. GKEY : STOPKEY, # STOP KEY #
  3391. GKEY : DOWNKEY, # DOWN KEY #
  3392. GKEY : UPKEY, # UP KEY #
  3393. GKEY : FWDKEY, # FWD KEY #
  3394. GKEY : BKWKEY, # BKW KEY #
  3395. GKEY : EDITKEY, # EDIT KEY #
  3396. GKEY : DATAKEY, # DATA KEY #
  3397. GKEYSHIFT : SHFNEXT, # SHIFTED NEXT KEY #
  3398. GKEYSHIFT : SHFBACK, # SHIFTED BACK KEY #
  3399. GKEYSHIFT : SHFHELP, # SHIFTED HELP KEY #
  3400. GKEYSHIFT : SHFSTOP, # SHIFTED STOP KEY #
  3401. GKEYSHIFT : SHFDOWN, # SHIFTED DOWN KEY #
  3402. GKEYSHIFT : SHFUP, # SHIFTED UP KEY #
  3403. GKEYSHIFT : SHFFWD, # SHIFTED FWD KEY #
  3404. GKEYSHIFT : SHFBKW, # SHIFTED BKW KEY #
  3405. GKEYSHIFT : SHFEDIT, # SHIFTED EDIT KEY #
  3406. GKEYSHIFT : SHFDATA, # SHIFTED BKW KEY #
  3407. BACKSPACE : BACKSPACE, # BACK SPACE #
  3408. FKEYX : F17, # FUNCTION KEY 17 #
  3409. FKEYX : F18, # FUNCTION KEY 18 #
  3410. FKEYX : F19, # FUNCTION KEY 19 #
  3411. FKEYX : F20, # FUNCTION KEY 20 #
  3412. FKEYX : F21, # FUNCTION KEY 21 #
  3413. FKEYX : F22, # FUNCTION KEY 22 #
  3414. FKEYX : F23, # FUNCTION KEY 23 #
  3415. FKEYX : F24, # FUNCTION KEY 24 #
  3416. FKEYXS : F17S, # SHIFTED FUNCTION KEY 17 #
  3417. FKEYXS : F18S, # SHIFTED FUNCTION KEY 18 #
  3418. FKEYXS : F19S, # SHIFTED FUNCTION KEY 19 #
  3419. FKEYXS : F20S, # SHIFTED FUNCTION KEY 20 #
  3420. FKEYXS : F21S, # SHIFTED FUNCTION KEY 21 #
  3421. FKEYXS : F22S, # SHIFTED FUNCTION KEY 22 #
  3422. FKEYXS : F23S, # SHIFTED FUNCTION KEY 23 #
  3423. FKEYXS : F24S, # SHIFTED FUNCTION KEY 24 #
  3424.  
  3425. # START OF INSTALLATION INPUT ORDINALS DEFINED VIA *TDU*. #
  3426.  
  3427. BADINPUT : IINP1, # INSTALLATION INPUT SEQUENCE 1 #
  3428. BADINPUT : IINP2, # INSTALLATION INPUT SEQUENCE 2 #
  3429. BADINPUT : IINP3, # INSTALLATION INPUT SEQUENCE 3 #
  3430. BADINPUT : IINP4, # INSTALLATION INPUT SEQUENCE 4 #
  3431. BADINPUT : IINP5, # INSTALLATION INPUT SEQUENCE 5 #
  3432. BADINPUT : IINP6, # INSTALLATION INPUT SEQUENCE 6 #
  3433. BADINPUT : IINP7, # INSTALLATION INPUT SEQUENCE 7 #
  3434. BADINPUT : IINP8, # INSTALLATION INPUT SEQUENCE 8 #
  3435. BADINPUT : IINP9, # INSTALLATION INPUT SEQUENCE 9 #
  3436. BADINPUT : IINP10, # INSTALLATION INPUT SEQUENCE 10 #
  3437. BADINPUT : IINP11, # INSTALLATION INPUT SEQUENCE 11 #
  3438. BADINPUT : IINP12, # INSTALLATION INPUT SEQUENCE 12 #
  3439. BADINPUT : IINP13, # INSTALLATION INPUT SEQUENCE 13 #
  3440. BADINPUT : IINP14, # INSTALLATION INPUT SEQUENCE 14 #
  3441. BADINPUT : IINP15, # INSTALLATION INPUT SEQUENCE 15 #
  3442. BADINPUT : IINP16, # INSTALLATION INPUT SEQUENCE 16 #
  3443. BADINPUT : IINP17, # INSTALLATION INPUT SEQUENCE 17 #
  3444. BADINPUT : IINP18, # INSTALLATION INPUT SEQUENCE 18 #
  3445. BADINPUT : IINP19, # INSTALLATION INPUT SEQUENCE 19 #
  3446. BADINPUT : IINP20, # INSTALLATION INPUT SEQUENCE 20 #
  3447.  
  3448. # END OF INSTALLATION INPUT ORDINALS. #
  3449.  
  3450. BADINPUT : MAXPLUS1; # LEGAL ORDINALS MUST BE LESS #
  3451. CONTROL EJECT; # EMBEDDED VDTIINP PROCEDURE #
  3452.  
  3453. PROC VDGETS;
  3454.  
  3455. # TITLE VDGETS - GET SEPTET. #
  3456.  
  3457. BEGIN # VDGETS #
  3458.  
  3459. #
  3460. * VDGETS - GET SEPTET.
  3461. *
  3462. * THIS PROCEDURE GETS THE NEXT SEVEN BITS FROM THE INPUT TABLE.
  3463. *
  3464. * ENTRY VTCOUNT = OFFSET INTO INPUT TABLE.
  3465. *
  3466. * EXIT VTHOLD = SEPTET.
  3467. * VTCOUNT = INCREMENTED IF WITHIN TABLE.
  3468. *
  3469. * USES VTHOLD.
  3470. #
  3471.  
  3472. ITEM WORDINDEX I; # WORD INDEX INTO INPUT TABLE #
  3473. ITEM BITPINDEX I; # BIT POSITION INDEX INTO WORD #
  3474.  
  3475. WORDINDEX = VTCOUNT / 8;
  3476. IF WORDINDEX LS (TABSTRNMES[0] - TABSTRINPT[0]) THEN
  3477. BEGIN # IF WITHIN *TDU* TABLE #
  3478. BITPINDEX = 4 + (7 * ((VTCOUNT - (WORDINDEX * 8))));
  3479. VTHOLD = B<BITPINDEX,7>TABFULLWRD[WORDINDEX + TABSTRINPT[0] - 6 ];
  3480. VTCOUNT = VTCOUNT + 1; # INCREMENT POINTER #
  3481. END
  3482. ELSE # IF OUTSIDE OF *TDU* TABLE #
  3483. BEGIN
  3484. VTHOLD = -1; # RETURN FAIL INDICATION #
  3485. END
  3486.  
  3487. END # VDGETS #
  3488. CONTROL EJECT; # EMBEDDED VDTIINP PROCEDURE #
  3489.  
  3490. PROC VDLIST;
  3491.  
  3492. # TITLE VDLIST - CHECK LIST FOR CHARACTER. #
  3493.  
  3494. BEGIN # VDLIST #
  3495.  
  3496. #
  3497. * VDLIST - CHECK LIST FOR CHARACTER.
  3498. *
  3499. * THIS PROCEDURE CHECKS FOR AN INPUT CHARACTER IN A LIST.
  3500. *
  3501. * ENTRY VTCOUNT = OFFSET INTO INPUT TABLE FOR LIST SIZE.
  3502. *
  3503. * EXIT VTCOUNT = OFFSET INTO INPUT TABLE FOR ACTION,
  3504. * OR NEXT OPCODE IF NO MATCH FOUND.
  3505. * VTI = 0, IF NO CHARACTER MATCH FOUND, OR
  3506. * NONZERO IF MATCH FOUND.
  3507. *
  3508. * USES VTHOLD, VTI.
  3509. #
  3510.  
  3511. VDGETS; # GET LENGTH OF LIST #
  3512.  
  3513. FOR VTI = VTHOLD STEP -1 WHILE VTI GR 0 AND VTHOLD GQ 0 DO
  3514. BEGIN # SEARCH FOR CHARACTER #
  3515. VDGETS; # GET CHARACTER #
  3516. IF VTCHAR EQ VTHOLD THEN
  3517. BEGIN # IF MATCH FOUND #
  3518. RETURN; # RETURN - CHARACTER FOUND #
  3519. END
  3520. ELSE
  3521. BEGIN # NO MATCH #
  3522. VTCOUNT = VTCOUNT + 2; # INCREMENT OFFSET #
  3523. END
  3524. END
  3525.  
  3526. END # VDLIST #
  3527. CONTROL EJECT; # EMBEDDED VDTIINP PROCEDURE #
  3528.  
  3529. PROC VDMANY;
  3530.  
  3531. # TITLE VDMANY - CHECK MANY ACTION RANGE FOR CHARACTER. #
  3532.  
  3533. BEGIN # VDMANY #
  3534.  
  3535. #
  3536. * VDMANY - CHECK MANY ACTION RANGE FOR CHARACTER.
  3537. *
  3538. * THIS PROCEDURE CHECKS A MANY ACTION RANGE FOR A CHARACTER.
  3539. *
  3540. * ENTRY VTCOUNT = OFFSET INTO INPUT TABLE FOR RANGE PAIR.
  3541. *
  3542. * EXIT VTCOUNT = OFFSET INTO INPUT TABLE FOR ACTION,
  3543. * OR NEXT OPCODE IF NO MATCH FOUND.
  3544. * VTI = 0, IF NO CHARACTER MATCH FOUND, OR
  3545. * NONZERO IF MATCH FOUND.
  3546. *
  3547. * USES VTHOLD, VTI.
  3548. #
  3549.  
  3550. VDGETS; # GET LOWER RANGE CHARACTER #
  3551. IF VTHOLD GQ 0 THEN
  3552. BEGIN # IF GOOD TABLE ENTRY #
  3553. VTI = VTHOLD;
  3554. VDGETS; # GET UPPER RANGE CHARACTER #
  3555. IF VTHOLD GQ 0 THEN
  3556. BEGIN # IF GOOD TABLE ENTRY #
  3557. VTJ = VTHOLD;
  3558. IF VTCHAR GQ VTI AND VTCHAR LQ VTJ THEN
  3559. BEGIN # IF CHARACTER WITHIN RANGE #
  3560. VTCOUNT = VTCOUNT + ((VTCHAR - VTI) * 2); # ACTION OFFSET #
  3561. VTI = 1;
  3562. END
  3563. ELSE
  3564. BEGIN # OFFSET FOR NEXT OPCODE #
  3565. VTCOUNT = VTCOUNT + ((VTJ - VTI + 1) * 2); # OPCODE OFFSET #
  3566. VTI = 0;
  3567. END
  3568. END
  3569. END
  3570.  
  3571. END # VDMANY #
  3572. CONTROL EJECT; # EMBEDDED VDTIINP PROCEDURE #
  3573.  
  3574. PROC VDSNGL;
  3575.  
  3576. # TITLE VDSNGL - CHECK SINGLE ACTION RANGE FOR CHARACTER. #
  3577.  
  3578. BEGIN # VDSNGL #
  3579.  
  3580. #
  3581. * VDSNGL - CHECK SINGLE ACTION RANGE FOR CHARACTER.
  3582. *
  3583. * THIS PROCEDURE CHECKS A SINGLE ACTION RANGE FOR A CHARACTER.
  3584. *
  3585. * ENTRY VTCOUNT = OFFSET INTO INPUT TABLE FOR RANGE PAIR.
  3586. *
  3587. * EXIT VTCOUNT = OFFSET INTO INPUT TABLE FOR ACTION,
  3588. * OR NEXT OPCODE IF NO MATCH FOUND.
  3589. * VTI = 0, IF NO CHARACTER MATCH FOUND, OR
  3590. * NONZERO IF MATCH FOUND.
  3591. *
  3592. * USES VTHOLD, VTI.
  3593. #
  3594.  
  3595. VDGETS; # GET LOWER RANGE CHARACTER #
  3596. IF VTHOLD GQ 0 THEN
  3597. BEGIN # IF GOOD TABLE ENTRY #
  3598. VTI = VTHOLD;
  3599. VDGETS; # GET UPPER RANGE CHARACTER #
  3600. IF VTHOLD GQ 0 THEN
  3601. BEGIN # IF GOOD TABLE ENTRY #
  3602. VTJ = VTHOLD;
  3603. IF VTCHAR GQ VTI AND VTCHAR LQ VTJ THEN
  3604. BEGIN # IF CHARACTER WITHIN RANGE #
  3605. VTI = 1;
  3606. END
  3607. ELSE
  3608. BEGIN # IF NO MATCH #
  3609. VTCOUNT = VTCOUNT + 2; # OFFSET FOR NEXT OPCODE #
  3610. VTI = 0;
  3611. END
  3612. END
  3613. END
  3614.  
  3615. END # VDSNGL #
  3616. CONTROL EJECT; # EMBEDDED VDTIINP PROCEDURE #
  3617.  
  3618. PROC VDCHEK;
  3619.  
  3620. # TITLE VDCHEK - CHECK VIRTUAL TERMINAL INPUT SEQUENCE. #
  3621.  
  3622. IOBEGIN(VDCHEK) # VDCHEK #
  3623.  
  3624. #
  3625. * VDCHEK - CHECK VIRTUAL TERMINAL INPUT SEQUENCE.
  3626. *
  3627. * THIS PROCEDURE MAPS INPUT SEQUENCES TO INP ORDINALS.
  3628. *
  3629. * EXIT VTORDN = INPUT EVENT ORDINAL.
  3630. *
  3631. * CALLS VDNXTI, VDGETS, VDSNGL, VDMANY, VDLIST.
  3632. *
  3633. * USES VTCOUNT, VTHOLD, VTI, VTORDN.
  3634. *
  3635. * NOTES OPCODE SWITCH DEPENDS ON *TDU* PRODUCED VALUES.
  3636. #
  3637.  
  3638. ARRAY ACT [0:0] P(1); # DEFINED ACTION FOR SEQUENCE #
  3639. BEGIN
  3640. ITEM ACTONE U(00,46,07); # FIRST SEPTET OF ACTION #
  3641. ITEM ACTTWO U(00,53,07); # SECOND SEPTET OF ACTION #
  3642. ITEM ACTION I(00,46,14); # ACTION AS SIGNED INTEGER #
  3643. END
  3644.  
  3645. SWITCH OPCODE:OPCODES # BASED ON *TDU* INPUT OPCODES #
  3646. FAIL:FAIL, # FAIL #
  3647. LIST:LIST, # LIST #
  3648. MANY:MANY, # MANY ACTION RANGE #
  3649. SNGL:SNGL; # SINGLE ACTION RANGE #
  3650.  
  3651. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  3652. IF VTRESINP NQ 0 THEN
  3653. BEGIN # IF ONLY SBA ALLOWED #
  3654. VDNXTI; # GET NEXT INPUT CHARACTER #
  3655. IF VTCHAR EQ X"11" THEN
  3656. BEGIN # IF SBA #
  3657. VTORDN = 33; # CURSORSTR #
  3658. END
  3659. ELSE
  3660. BEGIN # NOT SBA #
  3661. IF VTCHAR EQ X"00" THEN
  3662. BEGIN # IF EOI #
  3663. VTORDN = 36; # EOI #
  3664. END
  3665. ELSE
  3666. BEGIN # CHARACTER #
  3667. VTORDN = 37;
  3668. END
  3669. END
  3670. IORET
  3671. END
  3672. CONTROL FI; # END OF IF NOT MULTI FSE #
  3673.  
  3674. VTCOUNT = 0; # SEARCH ENTIRE TABLE #
  3675. VTI = 0; # NO MATCH FOUND YET #
  3676.  
  3677. VDNXTI; # GET INPUT #
  3678.  
  3679. IF TABVTFKLSM[0] EQ 0 AND NOT TABLOCKMDE[0] THEN
  3680. BEGIN # IF A CHAR IS A CHAR IS A CHAR #
  3681. IF VTCHAR GQ X"20" AND VTCHAR LQ X"7E" THEN
  3682. BEGIN # IF VALID CHARACTER #
  3683. VTORDN = 37;
  3684. IORET # RETURN #
  3685. END
  3686. END
  3687.  
  3688. PARSE:
  3689. VDGETS; # GET OPCODE #
  3690. IF VTHOLD GQ 0 AND VTHOLD LS OPCODES"MAXOP" THEN
  3691. GOTO OPCODE[VTHOLD]; # IF OPCODE WITHIN RANGE #
  3692.  
  3693. FAIL: # FAIL #
  3694. VTORDN = 0; # UNRECOGNIZED SEQUENCE #
  3695. IORET # RETURN #
  3696.  
  3697. LIST: # LIST #
  3698. VDLIST;
  3699. GOTO ENDCASE;
  3700.  
  3701. MANY: # MANY ACTION RANGE #
  3702. VDMANY;
  3703. GOTO ENDCASE;
  3704.  
  3705. SNGL: # SINGLE ACTION RANGE #
  3706. VDSNGL;
  3707.  
  3708. ENDCASE:
  3709. IF VTHOLD LS 0 THEN GOTO FAIL; # IF TABLE SEARCH FAILED #
  3710. IF VTI EQ 0 THEN GOTO PARSE; # IF NO MATCH FOUND YET #
  3711.  
  3712. # START OF NON-REENTRANT CODE SEQUENCE #
  3713.  
  3714. VDGETS; # PUT ACTION INTO VTHOLD #
  3715. IF VTHOLD LS 0 THEN GOTO FAIL; # IF TABLE SEARCH FAILED #
  3716. ACTONE = VTHOLD;
  3717. VDGETS;
  3718. IF VTHOLD LS 0 THEN GOTO FAIL; # IF TABLE SEARCH FAILED #
  3719. ACTTWO = VTHOLD;
  3720. VTHOLD = ACTION;
  3721.  
  3722. # END OF NON-REENTRANT CODE SEQUENCE #
  3723.  
  3724. IF VTHOLD GQ 0 THEN
  3725. BEGIN # IF ACTION IS AN OFFSET #
  3726. VTCOUNT = VTHOLD; # CONTINUE WITH PARSING #
  3727. VDNXTI; # GET NEXT INPUT BYTE #
  3728. GOTO PARSE; # CONTINUE SEQUENCE #
  3729. END
  3730. ELSE
  3731. BEGIN
  3732. VTORDN = ABS(VTHOLD); # RETURN INP ORDINAL #
  3733. END
  3734.  
  3735. IOEND # VDCHEK #
  3736. CONTROL EJECT; # START OF MAIN CODE FOR VDTIINP #
  3737.  
  3738. IF VTINCR NQ 0 THEN
  3739. BEGIN # IF POSITION NEEDS UPDATING #
  3740. VTINCR = 0;
  3741. VTXCUR = VTXCUR + 1; # INCREMENT X POSITION #
  3742. IF VTXCUR GR VTXMAX THEN
  3743. BEGIN # IF PAST COLUMN BOUNDARY #
  3744. IF TABRGHTCHR[0] GQ CURSORMOVE"SPIRAL" THEN
  3745. BEGIN # IF WRAP OR SPIRAL #
  3746. VTXCUR = 0; # CLEAR X POSITION #
  3747. IF TABRGHTCHR[0] EQ CURSORMOVE"SPIRAL" THEN
  3748. BEGIN # IF SPIRAL #
  3749. VTYCUR = VTYCUR + 1; # INCREMENT Y POSITION #
  3750. IF VTYCUR GR VTYMAX THEN
  3751. BEGIN # IF PAST LINE BOUNDARY #
  3752. IF TABLASTPOS[0] EQ CURSORMOVE"SPIRAL" THEN
  3753. BEGIN # IF SPIRAL #
  3754. VTYCUR = 0; # CLEAR Y POSITION #
  3755. END
  3756. ELSE # STOP, WRAP OR SCROLL #
  3757. BEGIN
  3758. VTYCUR = VTYMAX; # SET Y TO LAST LINE #
  3759. IF TABLASTPOS[0] EQ CURSORMOVE"SCROLL" THEN
  3760. BEGIN # IF SCROLL #
  3761. VTORDN = SCREENST"CLRPAG";
  3762. IORET # RETURN SOFT CLEAR PAGE #
  3763. END
  3764. END
  3765. END
  3766. END
  3767. END
  3768. ELSE
  3769. BEGIN # IF STOP #
  3770. VTXCUR = VTXMAX; # SET X TO LAST COLUMN #
  3771. END
  3772. END
  3773. END
  3774.  
  3775. VDCHEK; # CHECK INPUT SEQUENCE #
  3776.  
  3777. IF VTORDN LS INPUTORD"MAXPLUS1" THEN GOTO INP[VTORDN];
  3778.  
  3779. # FALL THROUGH TO FAIL CASE #
  3780.  
  3781. BADINPUT: # UNRECOGNIZED SEQUENCE #
  3782. IF VTCHAR EQ X"14" THEN
  3783. BEGIN # IF CONTROL-T #
  3784. VTORDN = SCREENST"GKEY"; # RETURN GENERIC STOP #
  3785. VTCHAR = 4;
  3786. END
  3787. ELSE
  3788. BEGIN # NOT CONTROL-T #
  3789. VTORDN = SCREENST"BAD"; # BAD INPUT #
  3790. END
  3791. IORET # RETURN #
  3792. CONTROL EJECT;
  3793.  
  3794. NOOP: # CURRENTLY NON OPERATIONAL #
  3795. VTORDN = SCREENST"NOOP";
  3796. IORET # RETURN #
  3797.  
  3798. INSERTCHAR: # INSERT CHARACTER #
  3799. VTCHAR = X"20"; # BLANK #
  3800. VTORDN = SCREENST"INSC";
  3801. IORET # RETURN #
  3802.  
  3803. DELETECHAR: # DELETE CHARACTER #
  3804. VTORDN = SCREENST"DELC";
  3805. IORET # RETURN #
  3806.  
  3807. INSLNECURL: # INSERT LINE, CURSOR LEFT #
  3808. VTXCUR = 0; # FALL THROUGH TO COMMON CODE #
  3809.  
  3810. INSERTLINE: # INSERT LINE #
  3811. VTORDN = SCREENST"INSL";
  3812. IORET # RETURN #
  3813.  
  3814. DELINECURL: # DELETE LINE, CURSOR LEFT #
  3815. VTXCUR = 0; # FALL THROUGH TO COMMON CODE #
  3816.  
  3817. DELETELINE: # DELETE LINE #
  3818. VTORDN = SCREENST"DELL";
  3819. IORET
  3820.  
  3821. CLRSCRCURH: # CLEAR SCREEN, CURSOR HOME #
  3822. VTOXPOS = VTXCUR; # SAVE CURSOR POSITION #
  3823. VTOYPOS = VTYCUR;
  3824. IF TABVTHOMEU[0] THEN VTYCUR = 0; ELSE VTYCUR = VTYMAX;
  3825. VTXCUR = 0; # FALL THROUGH TO COMMON CODE #
  3826.  
  3827. CLRSCREEN: # CLEAR SCREEN #
  3828. VTORDN = SCREENST"CLRPAG";
  3829. IORET # RETURN #
  3830.  
  3831. CLRUNPROT: # CLEAR UNPROTECTED #
  3832. VTORDN = SCREENST"CLRUNP";
  3833. IORET # RETURN #
  3834.  
  3835. CLREOS: # CLEAR TO END OF SCREEN #
  3836. VTORDN = SCREENST"CLREOP";
  3837. IORET # RETURN #
  3838.  
  3839. ERASELNECL: # ERASE LINE, CURSOR LEFT #
  3840. VTXCUR = 0; # FALL THROUGH TO COMMON CODE #
  3841.  
  3842. ERASELINE: # ERASE LINE #
  3843. VTORDN = SCREENST"ERAL";
  3844. IORET # RETURN #
  3845.  
  3846. CLREOL: # CLEAR TO END OF LINE #
  3847. VTORDN = SCREENST"CLREOL";
  3848. IORET # RETURN #
  3849.  
  3850. ERASECHAR: # ERASE CHARACTER #
  3851. VTDELT = 6; # CURSOR MOVEMENT ORDINAL #
  3852. VTXCUR = VTXCUR - 1;
  3853. VTORDN = SCREENST"ERAC";
  3854. IF VTXCUR LS 0 THEN
  3855. BEGIN # IF OFF LEFT SIDE OF SCREEN #
  3856. IF TABLEFTCHR[0] GQ CURSORMOVE"SPIRAL" THEN
  3857. BEGIN # IF WRAP OR SPIRAL #
  3858. VTXCUR = VTXMAX; # CURSOR IS IN LAST COLUMN #
  3859. IF TABLEFTCHR[0] EQ CURSORMOVE"SPIRAL" THEN
  3860. BEGIN # IF CURSOR IS ON PREVIOUS LINE #
  3861. VTYCUR = VTYCUR - 1; # DECREMENT AND CHECK BOUNDARY #
  3862. IF VTYCUR LS 0 THEN VTYCUR = VTYMAX;
  3863. END
  3864. END
  3865. ELSE
  3866. BEGIN # CURSOR HAS STOPPED AT LEFT #
  3867. VTXCUR = 0; # CURSOR IS IN FIRST COLUMN #
  3868. END
  3869. END
  3870. IORET # RETURN #
  3871.  
  3872. CURSORHOME: # CURSOR HOME #
  3873. VTOXPOS = VTXCUR; # SAVE CURSOR POSITION #
  3874. VTOYPOS = VTYCUR;
  3875. VTXCUR = 0; # SET POSITION TO HOME #
  3876. IF TABVTHOMEU[0] THEN VTYCUR = 0; ELSE VTYCUR = VTYMAX;
  3877. VTORDN = SCREENST"HOME";
  3878. IORET # RETURN #
  3879.  
  3880. CURSORUP: # CURSOR UP #
  3881. VTDELT = 4; # CURSOR MOVEMENT ORDINAL #
  3882. VTYCUR = VTYCUR - 1;
  3883. VTORDN = SCREENST"UP";
  3884. IF VTYCUR LS 0 THEN
  3885. BEGIN # IF OFF TOP OF SCREEN #
  3886. IF TABUPCURSR[0] GQ CURSORMOVE"SPIRAL" THEN
  3887. BEGIN # IF WRAP OR SPIRAL #
  3888. VTYCUR = VTYMAX; # CURSOR IS ON LAST LINE #
  3889. IF TABUPCURSR[0] EQ CURSORMOVE"SPIRAL" THEN
  3890. BEGIN # IF CURSOR IN PREVIOUS COLUMN #
  3891. VTXCUR = VTXCUR - 1; # DECREMENT AND CHECK BOUNDARY #
  3892. IF VTXCUR LS 0 THEN VTXCUR = VTXMAX;
  3893. END
  3894. END
  3895. ELSE
  3896. BEGIN # CURSOR HAS STOPPED AT TOP #
  3897. VTYCUR = 0; # CURSOR IS ON FIRST LINE #
  3898. END
  3899. END
  3900. IORET # RETURN #
  3901.  
  3902. CURSORDOWN: # CURSOR DOWN #
  3903. VTDELT = 2; # CURSOR MOVEMENT ORDINAL #
  3904. VTYCUR = VTYCUR + 1;
  3905. VTORDN = SCREENST"DOWN";
  3906. IF VTYCUR GR VTYMAX THEN
  3907. BEGIN # IF OFF BOTTOM TOP OF SCREEN #
  3908. IF TABDWNCRSR[0] GQ CURSORMOVE"SPIRAL" THEN
  3909. BEGIN # IF WRAP OR SPIRAL #
  3910. VTYCUR = 0; # CURSOR IS ON FIRST LINE #
  3911. IF TABDWNCRSR[0] EQ CURSORMOVE"SPIRAL" THEN
  3912. BEGIN # IF CURSOR IS IN NEXT COLUMN #
  3913. VTXCUR = VTXCUR + 1; # INCREMENT AND CHECK BOUNDARY #
  3914. IF VTXCUR GR VTXMAX THEN VTXCUR = 0;
  3915. END
  3916. END
  3917. ELSE
  3918. BEGIN # SCROLL OR STOP #
  3919. IF TABDWNCRSR[0] EQ CURSORMOVE"SCROLL" THEN
  3920. BEGIN # TERMINAL HAS SCROLLED #
  3921. VTORDN = SCREENST"CLRPAG"; # RETURN SOFT CLEAR PAGE #
  3922. END
  3923. ELSE
  3924. BEGIN # CURSOR HAS STOPPED AT BOTTOM #
  3925. VTYCUR = VTYMAX; # CURSOR IS ON LAST LINE #
  3926. END
  3927. END
  3928. END
  3929. IORET # RETURN #
  3930.  
  3931. CURSORLEFT: # CURSOR LEFT #
  3932. VTDELT = 1; # CURSOR MOVEMENT ORDINAL #
  3933. VTXCUR = VTXCUR - 1;
  3934. VTORDN = SCREENST"LEFT";
  3935. IF VTXCUR LS 0 THEN
  3936. BEGIN # IF OFF LEFT SIDE OF SCREEN #
  3937. IF TABLEFTCUR[0] GQ CURSORMOVE"SPIRAL" THEN
  3938. BEGIN # IF WRAP OR SPIRAL #
  3939. VTXCUR = VTXMAX; # CURSOR IS IN LAST COLUMN #
  3940. IF TABLEFTCUR[0] EQ CURSORMOVE"SPIRAL" THEN
  3941. BEGIN # IF CURSOR IN PREVIOUS ROW #
  3942. VTYCUR = VTYCUR - 1; # DECREMENT AND CHECK BOUNDARY #
  3943. IF VTYCUR LS 0 THEN
  3944. BEGIN # IF BACKWARD WRAP FROM TOP LINE #
  3945. IF NOT TABPTDWBPG[0] THEN VTYCUR = VTYMAX;
  3946. ELSE
  3947. BEGIN # IF CANNOT PAGE WRAP BACKWARD #
  3948. VTXCUR = 0;
  3949. VTYCUR = 0;
  3950. END
  3951. END
  3952. END
  3953. END
  3954. ELSE
  3955. BEGIN # CURSOR HAS STOPPED AT LEFT #
  3956. VTXCUR = 0; # CURSOR IS IN FIRST COLUMN #
  3957. END
  3958. END
  3959. IORET # RETURN #
  3960.  
  3961. CURSORIGHT: # CURSOR RIGHT #
  3962. VTDELT = 3; # CURSOR MOVEMENT ORDINAL #
  3963. VTXCUR = VTXCUR + 1;
  3964. VTORDN = SCREENST"RIGHT";
  3965. IF VTXCUR GR VTXMAX THEN
  3966. BEGIN # IF OFF RIGHT SIDE OF SCREEN #
  3967. IF TABRGHTCUR[0] GQ CURSORMOVE"SPIRAL" THEN
  3968. BEGIN # IF WRAP OR SPIRAL #
  3969. VTXCUR = 0; # CURSOR IS IN FIRST COLUMN #
  3970. IF TABRGHTCUR[0] EQ CURSORMOVE"SPIRAL" THEN
  3971. BEGIN # IF CURSOR IS IN NEXT ROW #
  3972. VTYCUR = VTYCUR + 1; # INCREMENT AND CHECK BOUNDARY #
  3973. IF VTYCUR GR VTYMAX THEN VTYCUR = 0;
  3974. END
  3975. END
  3976. ELSE
  3977. BEGIN # CURSOR HAS STOPPED AT RIGHT #
  3978. VTXCUR = VTXMAX; # CURSOR IS IN LAST COLUMN #
  3979. END
  3980. END
  3981. IORET # RETURN #
  3982.  
  3983. TABFORWARD: # TAB FORWARD #
  3984. VTORDN = SCREENST"FTAB";
  3985. IORET # RETURN #
  3986.  
  3987. TABACKWARD: # TAB BACKWARD #
  3988. VTORDN = SCREENST"BTAB";
  3989. IORET # RETURN #
  3990.  
  3991. RET: # RETURN FUNCTION #
  3992. VTORDN = SCREENST"RET";
  3993. IORET # RETURN #
  3994.  
  3995. RESET: # RESET FUNCTION #
  3996. VTORDN = SCREENST"RESET";
  3997. IORET # RETURN #
  3998.  
  3999. INSRTMDEON: # INSERT MODE ON #
  4000. VTINSMODE[0] = TRUE;
  4001. VTORDN = SCREENST"NOOP";
  4002. IORET # RETURN #
  4003.  
  4004. INSRTMDOFF: # INSERT MODE OFF #
  4005. VTINSMODE[0] = FALSE;
  4006. VTORDN = SCREENST"NOOP";
  4007. IORET # RETURN #
  4008.  
  4009. INSRTMDTOG: # INSERT MODE TOGGLE #
  4010. VTINSMODE[0] = NOT VTINSMODE[0];
  4011. VTORDN = SCREENST"NOOP";
  4012. IORET # RETURN #
  4013.  
  4014. CLRTABSTOP: # CLEAR TAB STOP #
  4015. VTORDN = SCREENST"CLRTAB";
  4016. IORET # RETURN #
  4017.  
  4018. CLRALLTABS: # CLEAR ALL TABS #
  4019. VTORDN = SCREENST"CLRALL";
  4020. IORET # RETURN #
  4021.  
  4022. SETTABSTOP: # SET TAB STOP #
  4023. VTORDN = SCREENST"SETTAB";
  4024. IORET # RETURN #
  4025.  
  4026. CURSORSTR: # CURSOR POSITION START #
  4027. IF TABCURADDT[0] EQ 2 THEN
  4028. BEGIN # IF CDC 721 #
  4029. VDNXTI; # GET TOUCH PANEL POSITION #
  4030. IF VTCHAR EQ X"7E" THEN
  4031. BEGIN # 132 COLUMN TOUCH PANEL INPUT #
  4032. VDNXTI;
  4033. IF VTCHAR NQ TABCURBIAS[0] THEN
  4034. BEGIN # IF PAST COLUMN 80 #
  4035. VDNXTI;
  4036. VTXCUR = VTCHAR - TABCURBIAS[0] + 80;
  4037. VDNXTI;
  4038. VTYCUR = VTCHAR - TABCURBIAS[0];
  4039. VTCHAR = GENERICST"GPOS"; # RETURN GENERIC TYPE #
  4040. VTORDN = SCREENST"GKEY"; # RETURN ORDINAL #
  4041. IORET # RETURN #
  4042. END
  4043. ELSE
  4044. BEGIN # NOT PAST COLUMN 80 #
  4045. VDNXTI;
  4046. END
  4047. END
  4048. VTXCUR = VTCHAR - TABCURBIAS[0];
  4049. VDNXTI;
  4050. VTYCUR = VTCHAR - TABCURBIAS[0];
  4051. VTCHAR = GENERICST"GPOS"; # RETURN GENERIC TYPE #
  4052. VTORDN = SCREENST"GKEY"; # RETURN ORDINAL #
  4053. END
  4054. ELSE
  4055. BEGIN # IF NOT CDC 721 TOUCH PANEL #
  4056. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  4057. IF TABLOCKMDE[0] THEN
  4058. BEGIN # IF BLOCK MODE TERMINAL #
  4059. VDNXTI; # GET BUFFER ADDRESS #
  4060. VTHOLD = ATR3270[VTCHAR] * 64;
  4061. VDNXTI; # CALCULATE COORDINATES #
  4062. VTHOLD = VTHOLD + ATR3270[VTCHAR];
  4063. VTYCUR = VTHOLD / (VTXMAX + 1);
  4064. VTXCUR = VTHOLD - (VTYCUR * (VTXMAX + 1));
  4065. IF VTRESINP NQ 0 THEN
  4066. BEGIN # IF NOT JUST RESIDUAL INPUT #
  4067. VTORDN = SCREENST"STRTFLD";
  4068. END
  4069. ELSE
  4070. BEGIN # REFLECT FINAL CURSOR POSITION #
  4071. VTORDN = SCREENST"NOOP";
  4072. END
  4073. END
  4074. ELSE
  4075. BEGIN # NOT 721 TOUCH PANEL #
  4076. CONTROL FI; # END OF IF NOT MULTI FSE #
  4077. VTORDN = SCREENST"NOOP"; # CURRENTLY UNSUPPORTED #
  4078. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  4079. END
  4080. CONTROL FI; # END OF IF NOT MULTI FSE #
  4081. END
  4082. IORET # RETURN #
  4083.  
  4084. CURSORSEC: # CURSOR POSITION SECOND #
  4085. CURSORTHR: # CURSOR POSITION THIRD #
  4086. VTORDN = SCREENST"NOOP"; # CURRENTLY UNSUPPORTED #
  4087. IORET # RETURN #
  4088.  
  4089. EOI: # END OF INFORMATION #
  4090. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  4091. IF VTRESINP NQ 0 THEN
  4092. BEGIN # IF RESIDUAL INPUT TO PROCESS #
  4093. VTINPDATA = VTRESINP;
  4094. VTINPNEXT = 0;
  4095. VTRESINP = 0;
  4096. GOTO CURSORSTR; # PROCESS FINAL CURSOR POSITION #
  4097. END
  4098. CONTROL FI; # END OF IF NOT MULTI FSE #
  4099. VTORDN = SCREENST"EOI";
  4100. IORET # RETURN #
  4101.  
  4102. CHARACTER: # OVERSTRIKE CHARACTER #
  4103. IF VTCHAR GQ X"20" AND VTCHAR LQ X"7E" THEN
  4104. BEGIN # IF VALID CHARACTER #
  4105. VTINCR = 1;
  4106. VTORDN = SCREENST"CHAR";
  4107. IF VTINSMODE[0] THEN VTORDN = SCREENST"INSC";
  4108. END
  4109. ELSE
  4110. BEGIN # NOT VALID CHARACTER #
  4111. IF VTCHAR EQ X"14" THEN
  4112. BEGIN # IF CONTROL-T #
  4113. VTORDN = SCREENST"GKEY"; # RETURN GENERIC STOP #
  4114. VTCHAR = 4;
  4115. END
  4116. ELSE
  4117. BEGIN # NOT CONTROL-T #
  4118. VTORDN = SCREENST"BAD"; # BAD INPUT #
  4119. END
  4120. END
  4121. IORET # RETURN #
  4122.  
  4123. FKEYX: # FUNCTION KEY 17 THROUGH 24 #
  4124. VTORDN = VTORDN - INPUTORD"BACKSPACE" + INPUTORD"F16";
  4125.  
  4126. FKEY: # FUNCTION KEY 1 THROUGH 16 #
  4127. IF TABVTFKLSM[0] NQ 0 THEN VTINCR = TABVTFKLSM[0];
  4128. VTCHAR = VTORDN - INPUTORD"CHARACTER";
  4129. VTORDN = SCREENST"FKEY"; # RETURN ORDINAL #
  4130. IORET # RETURN #
  4131.  
  4132. FKEYXS: # SHIFTED KEY 17 THROUGH 24 #
  4133. VTORDN = VTORDN - INPUTORD"F24" + INPUTORD"F16S";
  4134.  
  4135. FKEYSHIFT: # SHIFTED KEY 1 THROUGH 16 #
  4136. IF TABVTFKLSM[0] NQ 0 THEN VTINCR = TABVTFKLSM[0];
  4137. VTCHAR = VTORDN - INPUTORD"F16";
  4138. VTCHAR = -VTCHAR; # RETURN NEGATIVE VALUE #
  4139. VTORDN = SCREENST"FKEY"; # RETURN ORDINAL #
  4140. IORET # RETURN #
  4141.  
  4142. GKEY: # GENERIC FUNCTION KEYS #
  4143. IF TABVTFKLSM[0] NQ 0 THEN VTINCR = TABVTFKLSM[0];
  4144. VTCHAR = VTORDN - INPUTORD"F16S";
  4145. VTORDN = SCREENST"GKEY"; # RETURN ORDINAL #
  4146. IORET # RETURN #
  4147.  
  4148. GKEYSHIFT: # SHIFTED GENERIC KEYS #
  4149. IF TABVTFKLSM[0] NQ 0 THEN VTINCR = TABVTFKLSM[0];
  4150. VTCHAR = VTORDN - INPUTORD"DATAKEY";
  4151. VTCHAR = -VTCHAR; # RETURN NEGATIVE VALUE #
  4152. VTORDN = SCREENST"GKEY"; # RETURN ORDINAL #
  4153. IORET # RETURN #
  4154.  
  4155. BACKSPACE: # BACK SPACE #
  4156. VTDELT = 5; # CURSOR MOVEMENT ORDINAL #
  4157. VTXCUR = VTXCUR - 1;
  4158. VTORDN = SCREENST"LEFT";
  4159. IF VTXCUR LS 0 THEN
  4160. BEGIN # IF OFF LEFT SIDE OF SCREEN #
  4161. IF TABLEFTCHR[0] GQ CURSORMOVE"SPIRAL" THEN
  4162. BEGIN # IF WRAP OR SPIRAL #
  4163. VTXCUR = VTXMAX; # CURSOR IS IN LAST COLUMN #
  4164. IF TABLEFTCHR[0] EQ CURSORMOVE"SPIRAL" THEN
  4165. BEGIN # IF CURSOR IS ON PREVIOUS LINE #
  4166. VTYCUR = VTYCUR - 1; # DECREMENT AND CHECK BOUNDARY #
  4167. IF VTYCUR LS 0 THEN
  4168. BEGIN # IF BACKWARD WRAP FROM TOP LINE #
  4169. IF NOT TABPTDWBPG[0] THEN VTYCUR = VTYMAX;
  4170. ELSE
  4171. BEGIN # IF CANNOT PAGE WRAP BACKWARD #
  4172. VTXCUR = 0;
  4173. VTYCUR = 0;
  4174. END
  4175. END
  4176. END
  4177. END
  4178. ELSE
  4179. BEGIN # CURSOR HAS STOPPED AT LEFT #
  4180. VTXCUR = 0; # CURSOR IS IN FIRST COLUMN #
  4181. END
  4182. END
  4183. IORET # RETURN #
  4184.  
  4185. IOEND # VDTIINP #
  4186.  
  4187. END # VIRTERM # TERM