User Tools

Site Tools


cdc:nos2.source:opl871:m86serv

M86SERV

Table Of Contents

  • [00001] PROC BZFILL(CHAR,(TYP),(NUM))
  • [00002] BZFILL - BLANK OR ZERO FILLS A CHARACTER ITEM.
  • [00007] BZFILL - BLANK OR ZERO FILLS A CHARACTER ITEM.
  • [00078] PROC LOFPROC1)
  • [00079] LOFPROC - LIST OF FILES PROCESSOR.
  • [00084] LOFPROC - LIST OF FILES PROCESSOR.
  • [00107] PROC BZFILL
  • [00108] PROC RETERN
  • [00109] PROC ZSETFET
  • [00161] PROC MSG2)
  • [00162] MSG - DISPLAY DAYFILE MESSAGE.
  • [00167] MSG - DISPLAY DAYFILE MESSAGE.
  • [00193] PROC MESSAGE
  • [00234] PROC RESTPFP3)
  • [00235] RESTPFP - RESTORE USER *PFP* AND ABORT OR RETURN.
  • [00240] RESTPFP - RESTORE USER *PFP* AND ABORT OR RETURN.
  • [00274] PROC ABORT
  • [00275] PROC LOFPROC
  • [00276] PROC MESSAGE
  • [00277] PROC SETPFP
  • [00339] PROC ZFILL(ZBUF,(WDLEN))
  • [00340] ZFILL - ZERO FILLS A BUFFER.
  • [00345] ZFILL - ZERO FILLS A BUFFER.
  • [00382] PROC ZSETFET4)
  • [00383] ZSETFET - INITIALIZES A *FET*.
  • [00388] ZSETFET - INITIALIZES A FILE ENVIRONMENT TABLE.
  • [00424] PROC BZFILL
  • [00425] PROC ZFILL

Source Code

M86SERV.txt
  1. PROC BZFILL(CHAR,(TYP),(NUM));
  2. # TITLE BZFILL - BLANK OR ZERO FILLS A CHARACTER ITEM. #
  3.  
  4. BEGIN # BZFILL #
  5.  
  6. #
  7. ** BZFILL - BLANK OR ZERO FILLS A CHARACTER ITEM.
  8. *
  9. * PROC BZFILL(CHAR,(TYP),(NUM))
  10. *
  11. * ENTRY (TYP) = TYPE OF FILLING REQUIRED.
  12. * = S"BFILL", BLANK FILLING.
  13. * = S"ZFILL", ZERO FILLING.
  14. * (NUM) = LENGTH OF CHARACTER ITEM IN NUMBER
  15. * OF CHARACTERS.
  16. *
  17. * EXIT (CHAR) = BLANK OR ZERO FILLED CHARACTER.
  18. *
  19. * NOTES DEPENDING ON THE TYPE OF CONVERSION, ZEROES
  20. * ARE REPLACED BY BLANKS OR BLANKS BY ZEROES.
  21. #
  22.  
  23. ITEM CHAR C(240); # ITEM TO BE BLANK/ZERO FILLED #
  24. ITEM TYP U; # TYPE OF FILLING REQUIRED #
  25. ITEM NUM I; # LENGTH OF *CHAR* IN NUMBER OF
  26.   CHARACTERS #
  27.  
  28. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  29. *CALL COMBFAS
  30. *CALL COMBBZF
  31.  
  32. ITEM I I; # LOOP INDUCTION VARIABLE #
  33.  
  34. CONTROL EJECT;
  35.  
  36. #
  37. * START OF EXECUTABLE CODE.
  38. #
  39.  
  40. IF TYP EQ TYPFILL"BFILL"
  41. THEN
  42. BEGIN # BLANK FILL #
  43. FASTFOR I = 0 STEP 1 UNTIL NUM-1
  44. DO
  45. BEGIN
  46. IF C<I,1>CHAR EQ 0 # REPLACE ZEROES BY BLANKS #
  47. THEN
  48. BEGIN
  49. C<I,1>CHAR = " ";
  50. END
  51.  
  52. END
  53.  
  54. RETURN;
  55. END # BLANK FILL #
  56.  
  57. IF TYP EQ TYPFILL"ZFILL"
  58. THEN
  59. BEGIN # ZERO FILL #
  60. FASTFOR I = 0 STEP 1 UNTIL NUM-1
  61. DO
  62. BEGIN
  63. IF B<I*6,6>CHAR EQ O"55" # REPLACE BLANKS BY ZEROES #
  64. THEN
  65. BEGIN
  66. B<I*6,6>CHAR = 0;
  67. END
  68.  
  69. END
  70.  
  71. RETURN;
  72.  
  73. END # ZERO FILL #
  74.  
  75. END # BZFILL #
  76.  
  77. TERM
  78. PROC LOFPROC((LFN));
  79. # TITLE LOFPROC - LIST OF FILES PROCESSOR. #
  80.  
  81. BEGIN # LOFPROC #
  82.  
  83. #
  84. ** LOFPROC - LIST OF FILES PROCESSOR.
  85. *
  86. * *LOFPROC* IS USED TO CREATE A LIST OF LOCAL FILE NAMES, AND ALSO
  87. * TO RETURN THE FILES NAMED IN THIS LIST.
  88. *
  89. * PROC LOFPROC((LFN))
  90. *
  91. * ENTRY (LFN) = NONZERO, LOCAL FILE NAME TO BE ADDED TO THE
  92. * LIST OF FILES.
  93. * = 0, ALL FILES IN THE LIST ARE TO BE RETURNED.
  94. *
  95. * EXIT THE SPECIFIED FILE HAS BEEN ADDED TO THE LIST, OR ALL
  96. * FILES IN THE LIST HAVE BEEN RETURNED.
  97. #
  98.  
  99. ITEM LFN I; # FILE NAME TO BE ADDED TO LIST #
  100.  
  101. #
  102. **** PROC LOFPROC - XREF LIST BEGIN.
  103. #
  104.  
  105. XREF
  106. BEGIN
  107. PROC BZFILL; # BLANK OR ZERO FILL ITEM #
  108. PROC RETERN; # RETURN FILE #
  109. PROC ZSETFET; # INITIALIZE FET #
  110. END
  111.  
  112. #
  113. **** PROC LOFPROC - XREF LIST END.
  114. #
  115.  
  116. DEF LOFMAX #15#; # MAXIMUM LENGTH OF FILE LIST #
  117.  
  118. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  119. *CALL COMBFAS
  120. *CALL COMBFET
  121.  
  122. ITEM I I; # INDUCTION VARIABLE #
  123. ITEM ORD U = 0; # CURRENT TABLE ORDINAL #
  124.  
  125. ARRAY LFET [0:0] S(SFETL); ; # FET USED FOR *RETURN* REQUEST #
  126. ARRAY LOF [0:LOFMAX] S(1); # LIST OF FILES TABLE #
  127. BEGIN
  128. ITEM LOF$WRD U(00,00,60); # FULL WORD DEFINITION #
  129. ITEM LOF$LFN C(00,00,07); # LOCAL FILE NAME #
  130. END
  131.  
  132. CONTROL EJECT;
  133.  
  134. IF LFN NQ 0 AND ORD LQ LOFMAX
  135. THEN # ADD LFN TO LIST OF FILES #
  136. BEGIN
  137. BZFILL(LFN,1,7);
  138. LOF$WRD[ORD] = LFN;
  139. ORD = ORD + 1;
  140. RETURN;
  141. END
  142.  
  143. IF LFN EQ 0
  144. THEN # RETURN ALL FILES LISTED #
  145. BEGIN # RETURN FILES #
  146. ZSETFET(LOC(LFET[0]),"",0,0,SFETL);
  147.  
  148. SLOWFOR I = 0 STEP 1 WHILE I LS ORD
  149. DO
  150. BEGIN
  151. FET$LFN[0] = LOF$LFN[I];
  152. RETERN(LFET[0],RCL);
  153. END
  154.  
  155. END # RETURN FILES #
  156.  
  157. RETURN;
  158. END # LOFPROC #
  159.  
  160. TERM
  161. PROC MSG((DFMSG),(OP));
  162. # TITLE MSG - DISPLAY DAYFILE MESSAGE. #
  163.  
  164. BEGIN # MSG #
  165.  
  166. #
  167. ** MSG - DISPLAY DAYFILE MESSAGE.
  168. *
  169. * *MSG* SEARCHES A MESSAGE FOR A TERMINATING CHARACTER AND
  170. * ZERO FILLS THE MESSAGE FROM THE TERMINATOR TO THE END
  171. * OF THE MESSAGE.
  172. *
  173. * PROC MSG((DFMSG),(OP))
  174. *
  175. * ENTRY (DFMSG) - MESSAGE TO BE DISPLAYED, 80 CHARACTER
  176. * MAXIMUM.
  177. * (OP) - MESSAGE ROUTING OPTION.
  178. * (VALUES DEFINED IN *COMBFAS*)
  179. *
  180. * EXIT THE MESSAGE HAS BEEN DISPLAYED AT THE LOCATION
  181. * SPECIFIED BY (OP).
  182. #
  183.  
  184. ITEM DFMSG C(80); # MESSAGE TEXT #
  185. ITEM OP I; # MESSAGE ROUTING OPTION #
  186.  
  187. #
  188. **** PROC MSG - XREF LIST BEGIN.
  189. #
  190.  
  191. XREF
  192. BEGIN
  193. PROC MESSAGE; # ISSUE MESSAGE #
  194. END
  195.  
  196. #
  197. **** PROC MSG - XREF LIST END.
  198. #
  199.  
  200. DEF BLANK #" "#; # BLANK CHARACTER #
  201. DEF TERMCHAR #";"#; # TERMINATOR CHARACTER #
  202.  
  203. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  204. *CALL COMBFAS
  205.  
  206. ITEM I I; # LOOP COUNTER #
  207. ITEM CP I; # CHARACTER POSITION #
  208.  
  209. CONTROL EJECT;
  210.  
  211. CP = 0;
  212. FASTFOR I = 0 STEP 1 WHILE I LS 80 AND CP EQ 0
  213. DO # FIND TERMINATOR #
  214. BEGIN
  215. IF C<I,1>DFMSG EQ TERMCHAR
  216. THEN
  217. BEGIN
  218. CP = I;
  219. END
  220.  
  221. END
  222.  
  223. IF CP NQ 0
  224. THEN # ZERO FILL END OF MESSAGE #
  225. BEGIN
  226. B<CP*6,(80-CP)*6>DFMSG = 0;
  227. END
  228.  
  229. MESSAGE(DFMSG,OP); # ISSUE MESSAGE #
  230. RETURN;
  231. END # MSG #
  232.  
  233. TERM
  234. PROC RESTPFP((OPTION));
  235. # TITLE RESTPFP - RESTORE USER *PFP* AND ABORT OR RETURN. #
  236.  
  237. BEGIN # RESTPFP #
  238.  
  239. #
  240. ** RESTPFP - RESTORE USER *PFP* AND ABORT OR RETURN.
  241. *
  242. * *RESTPFP* RESTORES THE USER-S FAMILY AND USER INDEX, AND
  243. * OPTIONALLY CALLS *LOFPROC* TO RETURN ANY LISTED FILES.
  244. *
  245. * PROC RESTPFP((OPTION))
  246. *
  247. * ENTRY (OPTION) - PROCESSING OPTION (VALUES DEFINED IN
  248. * *COMBFAS*).
  249. * = *PFP$ABORT*, RESTORE *PFP*, RETURN ANY
  250. * LISTED FILES, AND ABORT PROCESSING.
  251. * = *PFP$END*, RESTORE *PFP*, RETURN ANY LISTED
  252. * FILES, AND RETURN TO CALLING PROGRAM.
  253. * = *PFP$RESUME*, RESTORE *PFP* AND RETURN TO
  254. * CALLING PROGRAM (NO FILES RETURNED).
  255. * (USER$FAM) = USER-S CURRENT FAMILY (IN *APFPCOM*).
  256. * (USER$UI) = USER-S CURRENT USER INDEX (IN *APFPCOM*).
  257. *
  258. * EXIT THE USER INDEX AND FAMILY OF THE USER HAVE BEEN
  259. * RESTORED. DEPENDING ON THE VALUE OF *OPTION*,
  260. * LISTED FILES MAY HAVE BEEN RETURNED, AND/OR
  261. * PROCESSING MAY HAVE BEEN ABORTED.
  262. *
  263. * MESSAGE * PROGRAM ABNORMAL, RESTPFP.*.
  264. #
  265.  
  266. ITEM OPTION I; # PROCESSING OPTION #
  267.  
  268. #
  269. **** PROC RESTPFP - XREF LIST BEGIN.
  270. #
  271.  
  272. XREF
  273. BEGIN
  274. PROC ABORT; # ISSUE ABORT #
  275. PROC LOFPROC; # LIST OF FILES PROCESSOR #
  276. PROC MESSAGE; # ISSUE MESSAGE #
  277. PROC SETPFP; # SET FAMILY AND USER INDEX #
  278. END
  279.  
  280. #
  281. **** PROC RESTPFP - XREF LIST BEGIN.
  282. #
  283.  
  284. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  285.  
  286. *CALL COMBFAS
  287. *CALL COMBPFP
  288.  
  289. ARRAY PFPMSG [0:0] S(3); # ABNORMAL CONDITION MESSAGE #
  290. BEGIN
  291. ITEM PFPLINE C(00,00,28) =[ # MESSAGE LINE #
  292. " PROGRAM ABNORMAL, RESTPFP."];
  293. ITEM PFPZERO U(02,48,12)=[0]; # ZERO BYTE TERMINATOR #
  294. END
  295.  
  296. CONTROL EJECT;
  297.  
  298. #
  299. * RESTORE FAMILY AND USER INDEX TO USER VALUES.
  300. #
  301.  
  302. PFP$WRD0[0] = 0;
  303. PFP$FAM[0] = USER$FAM[0];
  304. PFP$UI[0] = USER$UI[0];
  305. PFP$FG1[0] = TRUE;
  306. PFP$FG4[0] = TRUE;
  307. SETPFP(PFP[0]);
  308. IF PFP$STAT[0] NQ OK
  309. THEN
  310. BEGIN
  311. MESSAGE(PFPMSG[0],UDFL1);
  312. ABORT;
  313. END
  314.  
  315. #
  316. * OPTIONALLY RETURN LISTED FILES.
  317. #
  318.  
  319. IF OPTION NQ PFP$RESUME
  320. THEN
  321. BEGIN
  322. LOFPROC(0);
  323. END
  324.  
  325. #
  326. * OPTIONALLY ABORT PROCESSING.
  327. #
  328.  
  329. IF OPTION EQ PFP$ABORT
  330. THEN # ABORT REQUESTED #
  331. BEGIN
  332. ABORT;
  333. END
  334.  
  335. RETURN;
  336. END # RESTPFP #
  337.  
  338. TERM
  339. PROC ZFILL(ZBUF,(WDLEN));
  340. # TITLE ZFILL - ZERO FILLS A BUFFER. #
  341.  
  342. BEGIN # ZFILL #
  343.  
  344. #
  345. ** ZFILL - ZERO FILLS A BUFFER.
  346. *
  347. * PROC ZFILL(ZBUF,(WDLEN))
  348. *
  349. * ENTRY (WDLEN) = NUMBER OF WORDS TO BE ZERO FILLED.
  350. *
  351. * EXIT (ZBUF) = ZERO FILLED BUFFER.
  352. #
  353.  
  354. ARRAY ZBUF [0:0] ; # ARRAY TO BE ZERO FILLED #
  355. BEGIN
  356. ITEM ZWORD U(00,00,60);
  357. END
  358.  
  359. ITEM WDLEN I; # NUMBER OF WORDS TO BE ZEROED #
  360.  
  361. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  362. *CALL COMBFAS
  363.  
  364. ITEM I I; # LOOP INDUCTION VARIABLE #
  365.  
  366. CONTROL EJECT;
  367.  
  368. #
  369. * ZERO FILL THE SPECIFIED NUMBER OF
  370. * WORDS IN THE BUFFER.
  371. #
  372.  
  373. FASTFOR I = 0 STEP 1 UNTIL WDLEN-1
  374. DO
  375. BEGIN
  376. ZWORD[I] = 0;
  377. END
  378.  
  379. END # ZFILL #
  380.  
  381. TERM
  382. PROC ZSETFET((ADDR),(LFN),(FWA),(LEN),(FETL));
  383. # TITLE ZSETFET - INITIALIZES A *FET*. #
  384.  
  385. BEGIN # ZSETFET #
  386.  
  387. #
  388. ** ZSETFET - INITIALIZES A FILE ENVIRONMENT TABLE.
  389. *
  390. * THIS PROCEDURE CREATES A *FET* AT THE SPECIFIED
  391. * ADDRESS AND SETS STANDARD FIELDS. OTHER FIELDS MUST BE SET
  392. * BY THE USER.
  393. *
  394. * PROC ZSETFET((ADDR),(LFN),(FWA),(LEN),(FETL)).
  395. *
  396. * ENTRY (ADDR) - ADDRESS *FET* IS TO START AT.
  397. * (LFN) - NAME OF FILE TO BE ACCESSED.
  398. * (FWA) - FIRST WORD ADDRESS OF *CIO* BUFFER.
  399. * (LEN) - LENGTH OF THE *CIO* BUFFER.
  400. * (FETL) - LENGTH OF THE *FET*.
  401. *
  402. * EXIT *FET* IS INITIALIZED (I.E. *FIRST*, *IN*, *OUT*, AND
  403. * *LIMIT* POINTERS , AND *FET* LENGTH FIELDS ARE SET
  404. * AND THE *LFN* FIELD IS ZERO FILLED).
  405. *
  406. * NOTES VALUES SPECIFIED BY PARAMETERS ARE PLACED IN THE
  407. * APPROPRIATE ARRAY FIELDS, AND THE POINTER OF BASED
  408. * ARRAY *FETSET* IS SET TO *ADDR*.
  409. #
  410.  
  411.  
  412. ITEM ADDR U; # ADDRESS OF *FET* #
  413. ITEM LFN C(7); # FILE NAME #
  414. ITEM FWA U; # *FWA* OF *CIO* BUFFER #
  415. ITEM LEN U; # LENGTH OF *CIO* BUFFER #
  416. ITEM FETL U; # LENGTH OF *FET* #
  417.  
  418. #
  419. **** PROC ZSETFET - XREF LIST BEGIN.
  420. #
  421.  
  422. XREF
  423. BEGIN
  424. PROC BZFILL; # ZERO OR BLANK FILLS ITEM #
  425. PROC ZFILL; # ZERO FILLS AN ARRAY #
  426. END
  427.  
  428. #
  429. **** PROC ZSETFET - XREF LIST END.
  430. #
  431.  
  432. DEF MINFETL #5#; # MINIMUM *FET* LENGTH #
  433.  
  434. DEF LISTCON #0#; # CONTROLS LISTING OF COMDECKS #
  435.  
  436. *CALL COMBFAS
  437. *CALL COMBBZF
  438. *CALL COMBFET
  439. CONTROL EJECT;
  440.  
  441. #
  442. * ZERO FILL *FET* AND SET STANDARD FIELDS.
  443. #
  444.  
  445. P<FETSET> = ADDR;
  446. ZFILL(FETSET[0],FETL);
  447. BZFILL(LFN,TYPFILL"ZFILL",7); # ZERO-FILL FILE NAME #
  448. FET$LFN[0] = LFN;
  449. FET$LOCK[0] = TRUE;
  450. FET$FRST[0] = FWA;
  451. FET$IN[0] = FWA;
  452. FET$OUT[0] = FWA;
  453. FET$LIM[0] = FWA + LEN;
  454. FET$L[0] = FETL - MINFETL; # SET LENGTH OF *FET* #
  455. RETURN;
  456. END # ZSETFET #
  457.  
  458. TERM
1)
LFN
2)
DFMSG),(OP
3)
OPTION
4)
ADDR),(LFN),(FWA),(LEN),(FETL
cdc/nos2.source/opl871/m86serv.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator