Table of Contents

SCREX

Table Of Contents

  • [00001] PRGM SCREX
  • [00002] SCREX - SCREEN/LINE EXECUTIVE PROGRAM.
  • [00007] SCREEN/LINE EXECUTIVE PROGRAM.
  • [00031] PROC PF
  • [00032] PROC SCRCCK
  • [00033] PROC SCRCIS
  • [00034] PROC SCRCZF
  • [00035] PROC SCRFST
  • [00036] PROC SCRGIS
  • [00037] PROC SCRISR
  • [00038] PROC SCRLCP
  • [00039] PROC SCRPKP
  • [00040] PROC SCRRET
  • [00041] PROC SCRRTA
  • [00042] PROC SCRRZF
  • [00043] PROC SCRUGD
  • [00044] PROC VDTABT$
  • [00045] PROC VDTCLO
  • [00046] PROC VDTGSL
  • [00047] PROC VDTGTA
  • [00048] PROC VDTGTN
  • [00049] PROC VDTGTO
  • [00050] PROC VDTMSG$
  • [00051] PROC VDTOPN
  • [00052] PROC VDTSSL
  • [00053] PROC VDTWTC
  • [00097] PROC SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP)
  • [00166] PROC SCROUT(SCRLCA,SCRMOD)

Source Code

SCREX.txt
  1. PRGM SCREX;
  2. # TITLE SCREX - SCREEN/LINE EXECUTIVE PROGRAM. #
  3.  
  4. BEGIN # SCREX #
  5.  
  6. #
  7. *** SCREX - SCREEN/LINE EXECUTIVE PROGRAM.
  8. *
  9. * *SCREX* MANAGES THE SCREEN AND LINE COMMANDS
  10. * AND ALLOWS THE USER TO SPECIFY THE MODE OF
  11. * OPERATION, AND OPTIONALLY THE TERMINAL MODEL
  12. * BEING USED. *SCREX* INVOKES A CALL TO THE
  13. * LOADER TO LOCATE A TERMINAL-DEFINITION CAPSULE,
  14. * WHICH IT COPIES ONTO THE FILE *ZZZZTRM*. IT
  15. * THEN WRITES OUT THE TERMINAL INITIALIZATION
  16. * SEQUENCE FOUND IN THE LOADED CAPSULE.
  17. *
  18. * PRGM SCREX
  19. *
  20. * ENTRY *SCREX* HAS TWO ENTRY POINTS, *SCREEN* AND *LINE*.
  21. *
  22. * EXIT OBJECT ROUTINE EXECUTED.
  23. *
  24. * NOTES *SCREX* USES BOTH *SYMPL* AND *COMPASS* ROUTINES.
  25. *
  26. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  27. #
  28.  
  29. XREF
  30. BEGIN
  31. PROC PF; # GET *TERMLIB* FILE #
  32. PROC SCRCCK; # CHECK CAPSULE, GET LENGTH #
  33. PROC SCRCIS; # CHECK INTERACTIVE STATUS #
  34. PROC SCRCZF; # CREATE *ZZZZTRM* FILE #
  35. PROC SCRFST; # FILE STATUS CHECK #
  36. PROC SCRGIS; # GET INIT. SEQUENCE #
  37. PROC SCRISR; # ISSUE SYSTEM REQUEST #
  38. PROC SCRLCP; # LOAD TERMINAL CAPSULE #
  39. PROC SCRPKP; # PROCESS PARAMETERS #
  40. PROC SCRRET; # RETURN *TERMLIB* FILE #
  41. PROC SCRRTA; # RESIDENT TERMCAP ADDRESS #
  42. PROC SCRRZF; # READ *ZZZZTRM* FILE #
  43. PROC SCRUGD; # UNLOAD GROUP DIRECTORY #
  44. PROC VDTABT$; # TERMINATE ABNORMALLY #
  45. PROC VDTCLO; # CLOSE THE OUTPUT FET #
  46. PROC VDTGSL; # GET SCREEN/LINE MODE #
  47. PROC VDTGTA; # GET TERMCAP ADDRESS #
  48. PROC VDTGTN; # GET TERMINAL MNEMONIC #
  49. PROC VDTGTO; # GET TERMINAL ORDINAL #
  50. PROC VDTMSG$; # ISSUE ERROR MESSAGE #
  51. PROC VDTOPN; # OPEN THE OUTPUT FET #
  52. PROC VDTSSL; # SET SCREEN/LINE MODE #
  53. PROC VDTWTC; # WRITE THE INIT. SEQ. #
  54. END
  55.  
  56. XDEF
  57. BEGIN
  58. LABEL LINE; # LINE DIRECTIVE #
  59. LABEL SCREEN; # SCREEN DIRECTIVE #
  60. END
  61.  
  62. ITEM ERR1 C(32) = "TERMINAL MODEL NOT YET SPECIFIED";
  63. # ERROR MESSAGE #
  64. ITEM ERR1T I = 0; # END OF ERROR MESSAGE #
  65. ITEM ERR2 C(29) = "TERMINAL DEFINITION NOT FOUND";
  66. # ERROR MESSGE #
  67. ITEM ERR2T I = 0; # END OF ERROR MESSAGE #
  68. ITEM ERR3 C(25) = "DEFINITION FILE NOT FOUND";
  69. # ERROR MESSGE #
  70. ITEM ERR3T I = 0; # END OF ERROR MESSAGE #
  71. ITEM I I; # INTEGER VARIABLE #
  72. ITEM MODE I; # DIRECTIVE MODE VARIABLE #
  73. ITEM SCRIST B; # INTERACTIVE STATUS FLAG #
  74. ITEM SCRLCA I; # LOADED CAPSULE ADDRESS #
  75. ITEM SCRMDL I; # MODEL ORDINAL(0 IF UNREC.)#
  76. ITEM SCRMOD I; # MODE(LINE = 0,SCREEN = 1)#
  77. ITEM SCRPFF I; # PERMANENT FILE FOUND #
  78. ITEM SCRPFN C(7) = "TERMLIB"; # *PFM* PARAMETER #
  79. ITEM SCRRCA I; # RESIDENT CAPSULE ADDRESS #
  80. ITEM SCRSTS B; # *TERMLIB* STATUS FLAG #
  81. ITEM SCRTCF B; # TERMCAP FOUND #
  82. ITEM SCRTFL B; # *TERMLIB* FILE LOCAL #
  83. ITEM SCRTRM C(7) = "Z Z Z Z"; # USER-SUPPLIED MNEMONIC #
  84. ITEM SCRTRP B; # *TERMLIB* RETRIEVED BY *PF* #
  85. ITEM SCRUSN C(7) = "LIBRARY"; # ALTERNATE USER NUMBER #
  86. ITEM SCRZBA I; # *ZZZZTRM* BUFFER ADDRESS #
  87. ITEM SCRZFE B; # *ZZZZTRM* FILE EXISTS FLAG #
  88. ITEM SCRZTM C(7); # Z-PREFIXED TERM-MNEMONIC #
  89. ITEM UNLOAD B; # UNLOAD GROUP DIRECTORY #
  90. ARRAY NONESTR[0:0] S(1);
  91. BEGIN
  92. ITEM NONEKEY C(00,00,04) = ["NONE"]; # NONE OPTION STRING #
  93. ITEM ZEROES I(00,24,18) = [ 0 ]; # ZERO-FILL #
  94. ITEM NONE C(00,00,07); # ZERO-FILLED STRING #
  95. END
  96.  
  97. PROC SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP);
  98. # TITLE SCRGTC - GET TERMINAL CAPSULE. #
  99.  
  100. BEGIN # SCRGTC #
  101.  
  102. #
  103.   *** SCRGTC - GET TERMINAL CAPSULE.
  104.   *
  105.   * *SCRGTC* CALLS *SCRLCP* TO LOAD A CAPSULE GIVEN THE
  106.   * CAPSULE NAME, WHICH RETURNS THE ADDRESS OF THE CAPSULE
  107.   * IF SUCCESSFULLY LOADED. IF SO, THE ROUTINE *SCRCZF*
  108.   * CREATES A FILE NAMED *ZZZZTRM* AND COPIES THIS CAPSULE
  109.   * RECORD INTO IT. *SCRCZF* THEN MARKS THE *ZZZZTRM* FILE
  110.   * NON-RETURNABLE BY GLOBAL CLEAR.
  111.   *
  112.   * PROC SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP)
  113.   *
  114.   * SCRZTM = Z-PREFIXED TERMINAL MNEMONIC.
  115.   * SCRTCF = TERMCAP FOUND FLAG RETURNED.
  116.   * SCRSTS = *TERMLIB* STATUS FLAG.
  117.   * SCRTRP = *TERMLIB* RETRIEVED BY *PF*.
  118.   *
  119.   * ENTRY OBJECT ROUTINE CALLED WITH TERMINAL MNEMONIC,
  120.   * *TERMLIB* STATUS FLAG, AND FLAG TO RETURN *TERMLIB*.
  121.   *
  122.   * EXIT COMPLETION FLAG RETURNED TO CALLING ROUTINE.
  123.   *
  124.   * NOTES THE *SCRGTC* ROUTINES ARE COMPASS MACROS.
  125.   *
  126.   * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  127.   #
  128.  
  129.  
  130. ITEM SCRCLS I; # CAPSULE LOADED SUCCESSFULLY #
  131. ITEM SCRLCA I; # LOADED CAPSULE ADDRESS #
  132. ITEM SCRSTS B; # *TERMLIB* STATUS FLAG #
  133. ITEM SCRTCF B; # TERMCAP FOUND #
  134. ITEM SCRTCL I; # TERMINAL CAPSULE LENGTH #
  135. ITEM SCRTCV B; # TERMINAL CAPSULE VALID #
  136. ITEM SCRTRP B; # *TERMLIB* RETRIEVED BY *PF* #
  137. ITEM SCRZTM C(7); # TERMINAL MNEMONIC #
  138.  
  139.  
  140. SCRTCF = FALSE; # INITIALIZE FOUND FLAG #
  141. SCRLCP(SCRZTM,SCRLCA,SCRCLS); # LOAD TERMINAL CAPSULE #
  142. IF SCRCLS EQ 0 THEN # CAPSULE LOADED SUCCESSFULLY #
  143. BEGIN
  144. SCRTCV = FALSE; # INITIALIZE AS INVALID #
  145. SCRCCK(SCRLCA,SCRZTM,SCRTCV,SCRTCL,SCRSTS); # VALIDATE TERMCAP #
  146. IF SCRTCV THEN # IF VALID *TDU* TERMCAP #
  147. BEGIN
  148. SCRRET("ZZZZTRM"); # RETURN *ZZZZTRM* FILE #
  149. SCRCZF(SCRLCA,SCRTCL); # CREATE *ZZZZTRM* FILE #
  150. SCRMDL = 1; # USER DEFINED MODEL #
  151. SCRMOD = MODE; # DIRECTIVE SPECIFIED MODE #
  152. VDTSSL(SCRMDL,SCRMOD); # SET MODEL, MODE #
  153. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  154. SCROUT(SCRLCA,SCRMOD); # PRINT INIT. SEQUENCE #
  155. SCRTCF = TRUE; # TERMINAL CAPSULE FOUND #
  156. SCRRET("ZZZZZOU"); # RETURN *ZZZZZOU* FILE #
  157. END
  158. END
  159. IF SCRTRP THEN
  160. BEGIN # IF *PF* RETRIEVED *TERMLIB* #
  161. SCRRET(SCRPFN); # RETURN LOCAL FILE #
  162. END
  163.  
  164. END # SCRGTC #
  165.  
  166. PROC SCROUT(SCRLCA,SCRMOD);
  167. # TITLE SCROUT - OUTPUT TERMINAL INITIALIZATION SEQUENCE #
  168.  
  169. BEGIN # SCROUT #
  170.  
  171. #
  172.   *** SCROUT - OUTPUT TERMINAL INIT. SEQUENCE *
  173.   *
  174.   * *SCROUT* CALLS *VDTOPN* TO OPEN AND INITIALIZE THE
  175.   * OUTPUT FET. *SCRGIS* IS THEN CALLED TO GET THE
  176.   * TERMINAL INITIALIZATION SEQUENCE FROM THE LOADED
  177.   * CAPSULE, CONVERTING THE SEQUENCE FROM 7-BIT BYTES
  178.   * TO 12-BIT TRANSPARENT BYTES. THE SEQUENCE IS LEFT
  179.   * IN THE *SCRISB* BUFFER, WHICH IS WRITTEN BY *VDTWTC*
  180.   * TO THE OUTPUT FET, AND *VDTCLO* CLOSES THIS FET.
  181.   *
  182.   * PROC SCROUT(ADDRESS,MODE)
  183.   *
  184.   * ADDRESS = LOADED CAPSULE OR FILE BUFFER ADDRESS.
  185.   * MODE = MODE SPECIFIED BY USER.
  186.   *
  187.   * ENTRY ADDRESS = LOADED CAPSULE OR FILE BUFFER ADD RESS.
  188.   * MODE = 0, IF LINE MODE,
  189.   * = 1, IF SCREEN MODE.
  190.   *
  191.   * EXIT OBJECT ROUTINE EXECUTED.
  192.   *
  193.   * NOTES THE *SCROUT* ROUTINES ARE COMPASS ROUTINES.
  194.   *
  195.   * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  196.   #
  197.  
  198. BASED ARRAY PARM [0:0] P(1);;
  199.  
  200. ITEM SCRISB I; # SEQUENCE BUFFER #
  201. ITEM SCRLCA I; # LOADED CAPSULE ADDRESS #
  202. ITEM SCRMOD I; # TERMINAL MODE #
  203. ITEM SCRREC I; # RECALL PARAMETER #
  204.  
  205. SCRREC = 1; # SET AUTO RECALL #
  206. SCRGIS(SCRLCA,SCRMOD,SCRISB); # GET SEQUENCE #
  207. IF SCRISB NQ 0 THEN
  208. BEGIN # IF NOT EMPTY SEQUENCE #
  209. VDTOPN; # OPEN THE OUTPUT FET #
  210. P<PARM> = SCRISB;
  211. VDTWTC(PARM); # WRITE SEQUENCE #
  212. VDTCLO(SCRREC); # CLOSE THE OUTPUT FET #
  213. END
  214.  
  215. END # SCROUT #
  216.  
  217.  
  218. SCREEN: # SCREEN ENTRY POINT #
  219.  
  220. MODE = 1; # INITIALIZE MODE TO SCREEN #
  221. GOTO SCRMAIN; # JUMP TO MAIN BODY OF *SCREX* #
  222.  
  223. LINE: # LINE ENTRY POINT #
  224.  
  225. MODE = 0; # INITIALIZE MODE TO LINE #
  226. GOTO SCRMAIN; # JUMP TO MAIN BODY OF *SCREX* #
  227.  
  228.  
  229. SCRMAIN:
  230.  
  231. SCRCIS(SCRIST); # CHECK INTERACTIVE STATUS #
  232. IF NOT(SCRIST) THEN # IF NOT INTERACTIVE #
  233. STOP; # HALT PROGRAM EXECUTION #
  234. SCRPKP(SCRTRM); # PROCESS PARAMETERS #
  235. IF (SCRTRM EQ NONE[0]) THEN # NONE OPTION SPECIFIED #
  236. BEGIN # NONE OPTION #
  237. SCRMDL = 0; # SET CURRENT MODEL TO NONE #
  238. SCRMOD = 0; # SET CURRENT MODE TO LINE #
  239. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  240. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  241. RETURN;
  242. END
  243. IF SCRTRM EQ "Z Z Z Z" THEN # IF MODEL NOT SPECIFIED #
  244. BEGIN
  245. VDTGSL(SCRMDL,SCRMOD); # GET CURRENT MODEL, MODE #
  246. IF SCRMDL NQ 0 THEN # IF PREVIOUS MODEL SPECIFIED #
  247. BEGIN
  248. IF SCRMDL NQ 1 THEN # IF RESIDENT MODEL SPECIFIED #
  249. BEGIN
  250. SCRMOD = MODE; # SET CURRENT MODE #
  251. VDTGTA(SCRMDL,SCRRCA); # GIVEN MODEL, RETURN ADDRESS #
  252. SCROUT(SCRRCA,SCRMOD); # SEND INITIALIZATION SEQUENCE #
  253. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  254. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  255. END
  256. ELSE # NON-RESIDENT MODEL SPECIFIED #
  257. BEGIN
  258. SCRZFE = FALSE;
  259. SCRPFN = "ZZZZTRM";
  260. SCRFST(SCRPFN,SCRZFE); # CHECK FOR LOCAL *ZZZZTRM* #
  261. IF SCRZFE THEN # IF LOCAL *ZZZZTRM* EXISTS #
  262. BEGIN
  263. SCRMOD = MODE; # USER SPECIFIED MODE #
  264. SCRRZF(SCRPFN,SCRZBA); # READ INTO BUFFER #
  265. SCROUT(SCRZBA,SCRMOD); # SEND INITIALIZATION SEQUENCE #
  266. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  267. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  268. END
  269. ELSE # NO LOCAL *ZZZZTRM* #
  270. BEGIN
  271. VDTMSG$(ERR3,0,1); # ERROR MESSAGE #
  272. VDTABT$; # TERMINATE ABNORMALLY #
  273. END
  274. END
  275. END
  276. ELSE # NO PREVIOUS MODEL SPECIFIED #
  277. BEGIN
  278. IF MODE EQ 0 THEN # LINE MODE SPECIFIED #
  279. BEGIN # LINE DIRECTIVE #
  280. SCRMDL = 0; # SET CURRENT MODEL TO NONE #
  281. SCRMOD = 0; # SET CURRENT MODE TO LINE #
  282. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  283. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  284. END
  285. ELSE
  286. BEGIN # SCREEN DIRECTIVE #
  287. VDTMSG$(ERR1,0,1); # ERROR MESSAGE #
  288. VDTABT$; # TERMINATE ABNORMALLY #
  289. END
  290. END
  291. END # MODEL NOT SPECIFIED #
  292. ELSE # MODEL WAS SPECIFIED #
  293. BEGIN
  294. C<0>SCRZTM = "Z"; # PREFIX MNEMONIC WITH "Z" #
  295. FOR I = 1 STEP 1 UNTIL 6 DO
  296. C<I>SCRZTM = C<I-1>SCRTRM; # CONCAT *SCRTRM* TO *SCTZTM* #
  297. VDTGTO(SCRMDL,SCRTRM); # GET TERMINAL ORDINAL #
  298. IF SCRMDL NQ 0 THEN # IF TERMINAL TABLE RESIDENT #
  299. BEGIN
  300. SCRMOD = MODE; # SET DIRECTIVE MODE #
  301. SCRRTA(SCRTRM,SCRLCA); # GET TERMCAP ADDRESS #
  302. SCROUT(SCRLCA,SCRMOD); # PRINT INIT. SEQUENCE #
  303. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  304. SCRISR(MODE); # ISSUE SYSTEM REQUEST #
  305. END
  306. ELSE # TERMINAL TABLE NOT RESIDENT #
  307. BEGIN
  308. UNLOAD = FALSE; # GROUP DIRECTORY UNLOAD FLAG #
  309. SCRTRP = FALSE;
  310. SCRSTS = FALSE; # INITIALIZE *TERMLIB* STATUS #
  311. SCRTFL = FALSE;
  312. SCRTCF = FALSE;
  313. SCRFST(SCRPFN,SCRTFL); # CHECK IF *TERMLIB* IS LOCAL #
  314. IF SCRTFL THEN
  315. BEGIN # IF LOCAL *TERMLIB* FOUND #
  316. SCRSTS = TRUE;
  317. SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP); # GET LOCAL CAPSULE #
  318. UNLOAD = TRUE;
  319. END
  320. IF NOT SCRTCF THEN # IF TERMINAL CAPSULE NOT FOUND #
  321. BEGIN
  322. PF("GET",SCRPFN,SCRPFN,"RC",SCRPFF,0); # GET *SCRPFN* FILE #
  323. IF SCRPFF NQ 0 THEN
  324. BEGIN # IF GET FAILS, ATTACH #
  325. PF("ATTACH",SCRPFN,SCRPFN,"RC",SCRPFF,"NA",0,0);
  326. END
  327. IF SCRPFF EQ 0 THEN # IF FILE WAS FOUND #
  328. BEGIN
  329. SCRSTS = TRUE;
  330. SCRTRP = TRUE; # *TERMLIB* RETRIEVED BY *PF* #
  331. IF UNLOAD THEN # IF LOADER CALLED BEFORE #
  332. BEGIN
  333. SCRUGD; # UNLOAD GROUP DIRECTORY #
  334. UNLOAD = FALSE; # GROUP DIRECTORY UNLOADED #
  335. END
  336. SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP); # GET CAPSULE #
  337. UNLOAD = TRUE;
  338. END
  339. IF NOT SCRTCF THEN # IF TERMCAP NOT FOUND #
  340. BEGIN
  341. PF("GET",SCRPFN,SCRPFN,"RC",SCRPFF,"UN",SCRUSN,"PN","0",0);
  342. # GET *TERMLIB* FROM UN=LIBRARY #
  343. IF SCRPFF NQ 0 THEN
  344. BEGIN # IF GET FAILS, ATTACH #
  345. PF("ATTACH",SCRPFN,SCRPFN,"RC",SCRPFF,
  346. "UN",SCRUSN,"PN","0","NA",0,0);
  347. END
  348. IF SCRPFF EQ 0 THEN # IF FILE WAS FOUND #
  349. BEGIN
  350. SCRSTS = FALSE; # SET STATUS TO SYSTEM #
  351. SCRTRP = TRUE; # *TERMLIB* RETRIEVED BY *PF* #
  352. IF UNLOAD THEN # IF LOADER CALLED BEFORE #
  353. BEGIN
  354. SCRUGD; # UNLOAD GROUP DIRECTORY #
  355. END
  356. SCRGTC(SCRZTM,SCRTCF,SCRSTS,SCRTRP); # GET CAPSULE #
  357. END
  358. IF NOT SCRTCF THEN # IF TERMCAP NOT FOUND #
  359. BEGIN
  360. SCRMOD = 0; # LINE MODE #
  361. SCRMDL = 0; # UNDEFINED ORDINAL #
  362. VDTSSL(SCRMDL,SCRMOD); # SET MODE, MODEL #
  363. SCRISR(SCRMOD); # ISSUE SYSTEM REQUEST #
  364. VDTMSG$(ERR2,0,1); # SEND MESSAGE TO USER #
  365. VDTABT$; # TERMINATE ABNORMALLY #
  366. END
  367. END # TERMCAP NOT FOUND #
  368. END # TERMCAP NOT FOUND #
  369. END # TERMINAL TABLE NOT RESIDENT #
  370. END # MODEL WAS SPECIFIED #
  371.  
  372. END # SCREX # # END OF *SCREX* PROGRAM #
  373.  
  374. TERM