User Tools

Site Tools


cdc:nos2.source:opl871:hstcopy

HSTCOPY

Table Of Contents

  • [00288] SYS - ISSUE SYSTEM REQUEST.
  • [00314] SYS - ISSUE SYSTEM REQUEST.

Source Code

HSTCOPY.txt
  1. (*$L'HOSTCOPY UTILITY.',S-,U+ *)
  2. (*$V+ DISPLAY CM RECORD MAP. *)
  3. (*$E+ USE EXTERNAL ENTRY POINTS. *)
  4. PROGRAM HSTCOPY(INPUT,OUTPUT,FTS);
  5. (***
  6. * HSTCOPY - HOSTCOPY UTILITY.
  7. *
  8. * L. M. BURGHER/S. V. PRESTON 84/09/22.
  9. * S. V. PRESTON 86/03/14.
  10. * MODIFIED TO SUPPORT V10 SST FORMAT.
  11. *
  12. * OVERVIEW
  13. *
  14. * HSTCOPY READS A FILE AND TRANSFERS IT TO A 5870 OR 5970
  15. * NON-IMPACT PRINTER. HSTCOPY CALLS THE PP PROGRAM XHC TO
  16. * TRANSFER THE DATA TO THE NON-IMPACT PRINTER.
  17. *
  18. * HSTCOPY READS THE FOLLOWING TYPES OF FILES:
  19. *
  20. * 1) RECORDS CONSISTING OF MULTIPLES OF 128 8-BIT BYTES,
  21. * WITHOUT ZERO-BYTE TERMINATORS, UP TO A MAXIMUM
  22. * OF 8192 8-BIT BYTES.
  23. *
  24. * 2) 80-BYTE EBCDIC CARD IMAGE RECORDS WITHOUT ZERO-BYTE
  25. * TERMINATORS.
  26. *
  27. * CONTROL STATEMENT CALL
  28. *
  29. * HSTCOPY(INPUT,OUTPUT,FTS)
  30. *
  31. * HSTCOPY - HOSTCOPY CONTROL STATEMENT.
  32. * INPUT - INPUT FILE CONTAINING INPUT DIRECTIVES.
  33. * OUTPUT - OUTPUT FILE CONTAINING STATUS OF HOSTCOPY.
  34. * FTS - INPUT FILE TO TRANSFER TO NIP.
  35. *)
  36.  
  37. CONST
  38.  
  39. (* DEFINE BUFFER LENGTHS. *)
  40.  
  41. CML = 1093; (* NUMBER OF CM WORDS *)
  42. CMLS = 69;
  43. BIT4L = 16384; (* NUMBER OF BIT4S *)
  44. RECL = 64; (* NUMBER OF 128-BYTE RECS *)
  45.  
  46. (* DEFINE RECORD LENGTH. *)
  47.  
  48. RECRDL = 256; (* NUMBER OF BIT4S PER RECRD *)
  49. RECRDPL = 2; (* NUM OF RECRD POINTERS *)
  50.  
  51. TYPE
  52.  
  53. (*$T- TURN RUNTIME TESTING OFF. *)
  54. PCNTRL = ^CONTROL; (* CONTROL RECORD POINTER *)
  55. PRECRD = ^RECRD; (* DATA RECORD POINTER *)
  56. (*$T= RESTORE RUNTIME TESTING. *)
  57.  
  58. (* DEFINE BIT FIELD WIDTHS. *)
  59.  
  60. BIT1 = 0..1B;
  61. BIT3 = 0..7B;
  62. BIT4 = 0..17B;
  63. BIT6 = 0..77B;
  64. BIT9 = 0..777B;
  65. BIT11 = 0..3777B;
  66. BIT12 = 0..7777B;
  67. BIT42 = 0..77777777777777B;
  68.  
  69. (* DEFINE PACKED CHARACTER STRINGS. *)
  70.  
  71. CHAR3 = PACKED ARRAY[1..3] OF CHAR;
  72. CHAR10 = PACKED ARRAY[1..10] OF CHAR;
  73. CHAR40 = PACKED ARRAY[1..40] OF CHAR;
  74.  
  75. BUFTAG = 1..2;
  76. BUFFER = RECORD CASE TAG : BUFTAG OF
  77. 1 : (W : ARRAY[1..CML] OF INTEGER);
  78. 2 : (B4 : PACKED ARRAY[1..BIT4L] OF BIT4);
  79. END; (* BUFFER *)
  80.  
  81. RECRD = PACKED ARRAY[1..RECRDL] OF BIT4;
  82. (* DATA RECORD *)
  83.  
  84. CONTROL = PACKED RECORD (* XHC CONTROL TABLE *)
  85. FILL1 : BIT3;
  86. EQ : BIT9; (* EST ORDINAL *)
  87. FILL2 : BIT11;
  88. TERM : BOOLEAN; (* TERMINATE XHC *)
  89. FILL3 : BIT11;
  90. CARDIMG : BOOLEAN; (* CARD IMAGE *)
  91. FILL4 : BIT11;
  92. COMP : BOOLEAN; (* REQUEST COMPLETE *)
  93. FILL5 : BIT42;
  94. RESV1 : BIT1;
  95. RECRDP : PRECRD; (* RECRD POINTER *)
  96. END; (* CONTROL *)
  97.  
  98. SYSREQ = PACKED RECORD
  99. (* SYSTEM REQUEST FORMAT *)
  100. PPNAME : CHAR3; (* PP PROGRAM NAME *)
  101. RESV1 : BIT1;
  102. RECALL : BOOLEAN; (* RECALL OPTION *)
  103. FILL1 : BIT4;
  104. FILL2 : BIT12;
  105. FILL3 : BIT6;
  106. RESV2 : BIT1; (* CONTROL POINTER *)
  107. CNTRLP : PCNTRL;
  108. END; (* SYSREQ *)
  109.  
  110. VAR
  111.  
  112. CNTRLP : PCNTRL; (* XHC CONTROL POINTER *)
  113. INITOK : BOOLEAN; (* INITIALIZE OK *)
  114. RCL, XHC : SYSREQ; (* SYSTEM REQUEST *)
  115. FTS : SEGMENTED FILE OF INTEGER;
  116. (* SYSTEM SOFTWARE FILE *)
  117.  
  118. (* DEFINE DAYFILE MESSAGE VARIABLES. *)
  119.  
  120. EFMSG : CHAR40; (* EMPTY FILE *)
  121. EQMSG : CHAR40; (* INCORRECT EQUIPMENT *)
  122. LDMSG : CHAR40; (* EQUIPMENT LOADED *)
  123.  
  124. (* DEFINE BUFFER VARIABLES. *)
  125.  
  126. BUFF : BUFFER; (* DATA BUFFER *)
  127. CMI : 0..CML; (* CM INDEX *)
  128. BIT4I : 0..BIT4L; (* BIT4 INDEX *)
  129. RECI : 0..RECL; (* RECRD INDEX *)
  130. RECNUM : 1..RECL; (* NUM RECRDS PER BUFFER *)
  131.  
  132. (* DEFINE RECORD VARIABLES. *)
  133.  
  134. RECRDP : ARRAY[1..RECRDPL] OF PRECRD;
  135. (* DATA RECORD POINTERS *)
  136. RECRDPI : 1..RECRDPL; (* RECORD POINTER INDEX *)
  137. RECRDI : 0..RECRDL; (* RECORD INDEX *)
  138.  
  139. VALUE
  140.  
  141. INITOK = FALSE;
  142. RCL = ('RCL', 0, TRUE, 0, 0, 0, 0, NIL);
  143. XHC = ('XHC', 0, FALSE, 0, 0, 0, 0, NIL);
  144.  
  145. (* DAYFILE MESSAGES. *)
  146.  
  147. EFMSG = ' SYSTEM SOFTWARE FILE EMPTY. ';
  148. EQMSG = ' EQXXX, INCORRECT EQUIPMENT NUMBER. ';
  149. LDMSG = ' EQXXX, HOSTCOPY TRANSFER COMPLETE. ';
  150. (*$L'EXTERNAL FUNCTIONS AND PROCEDURES.'*)
  151. FUNCTION XDXB( STR : CHAR10; TYP : INTEGER;
  152. VAR NUM : INTEGER) : INTEGER; FORTRAN;
  153. (**
  154. * CHARACTER TO INTEGER CONVERSION.
  155. *
  156. * LOADED FROM SRVLIB.
  157. *)
  158.  
  159. PROCEDURE SYS(VAR REQ : SYSREQ); EXTERN;
  160. (**
  161. * ISSUE SYSTEM REQUEST.
  162. *
  163. * LOADED FROM UTILLIB.
  164. *)
  165. (*$L'INIT - INITIALIZE.'*)
  166. PROCEDURE INIT;
  167. (**
  168. *
  169. * INITIALIZE HOST COPY.
  170. *
  171. * EXIT
  172. * INITOK = TRUE, IF INITIALIZED PROPERLY.
  173. * THE PP XHC HAS BEEN STARTED.
  174. * LDMSG HAS BEEN SET WITH EQUIPMENT NUMBER.
  175. *
  176. * CALLS
  177. * SYS, XDXB.
  178. *
  179. * NESTED FROM HSTCOPY.
  180. *)
  181.  
  182. VAR
  183.  
  184. CARDIMG : ALFA; (* CARD IMAGE *)
  185. EQ : ALFA; (* EST ORDINAL *)
  186. I, J : INTEGER;
  187. VALIDEQ : INTEGER; (* VALID EQUIPMENT *)
  188.  
  189. BEGIN (* INIT *)
  190. RESET(FTS); (* INITIALIZE FTS FILE *)
  191. IF NOT EOS(FTS) THEN
  192. BEGIN (* FILE OK *)
  193. EQ := ' '; (* EQ NUMBER *)
  194. FOR I := 1 TO 3 DO
  195. READ(EQ[I]);
  196. READLN;
  197. READLN(CARDIMG[1]); (* CARD IMAGE *)
  198. VALIDEQ := XDXB(EQ, 0, I); (* CONVERT EQ TO INTEGER *)
  199. IF (VALIDEQ = 0) AND (I <= 777B) THEN
  200. BEGIN (* VALID EQ *)
  201. NEW(CNTRLP); (* INITIALIZE POINTERS *)
  202. FOR J := 1 TO RECRDPL DO
  203. BEGIN
  204. RECRDPI := J;
  205. NEW(RECRDP[RECRDPI]);
  206. END;
  207. CNTRLP^.EQ := I; (* SETUP XHC CONTROL RECORD *)
  208. CNTRLP^.TERM := FALSE;
  209. IF CARDIMG[1] = 'T' THEN
  210. CNTRLP^.CARDIMG := TRUE
  211. ELSE
  212. CNTRLP^.CARDIMG := FALSE;
  213. CNTRLP^.COMP := FALSE;
  214. CNTRLP^.RECRDP := NIL;
  215. XHC.CNTRLP := CNTRLP;
  216. RCL.CNTRLP := CNTRLP;
  217. SYS(XHC); (* INITIATE XHC *)
  218. INITOK := TRUE; (* INITIALIZE OK *)
  219. FOR I := 1 TO 3 DO (* SET EQ IN LOAD MESSAGE *)
  220. LDMSG[I+3] := EQ[I];
  221. END (* VALID EQ *)
  222. ELSE
  223. BEGIN (* INCORRECT EQ *)
  224. FOR I := 1 TO 3 DO (* SET EQ IN MESSAGE *)
  225. EQMSG[I+3] := EQ[I];
  226. MESSAGE(EQMSG);
  227. WRITELN(EQMSG);
  228. END; (* IF *) (* INCORRECT EQ *)
  229. END (* FILE OK *)
  230. ELSE
  231. BEGIN (* EMPTY FILE *)
  232. MESSAGE(EFMSG);
  233. WRITELN(EFMSG);
  234. END; (* IF *) (* EMPTY FILE *)
  235. END; (* INIT *)
  236. (*$L'MAIN PROGRAM.'*)
  237. BEGIN (* HSTCOPY *)
  238. INIT; (* INITIALIZE HOST COPY *)
  239. IF INITOK THEN
  240. BEGIN (* INIT OK *)
  241. WHILE NOT EOF(FTS) DO
  242. BEGIN (* PROCESS FTS RECORD *)
  243. CMI := 0; (* READ FTS RECORD *)
  244. WHILE (NOT EOS(FTS) AND NOT EOF(FTS)) AND
  245. (CMI < CML) DO
  246. BEGIN
  247. CMI := CMI+1;
  248. READ(FTS,BUFF.W[CMI]);
  249. END; (* WHILE *)
  250. GETSEG(FTS); (* GET NEXT RECORD *)
  251. IF CMI = CML THEN (* ESTABLISH RECORD SIZE *)
  252. RECNUM := 64 (* 8192-BYTES *)
  253. ELSE
  254. BEGIN
  255. IF CMI = CMLS THEN
  256. RECNUM := 4 (* 512-BYTES *)
  257. ELSE
  258. RECNUM := 1; (* 128-BYTES *)
  259. END;
  260. BIT4I := 0; (* XFER FTS RECORD TO NIP *)
  261. FOR RECI := 1 TO RECNUM DO
  262. BEGIN
  263. IF RECRDPI < RECRDPL THEN
  264. RECRDPI := RECRDPI + 1
  265. ELSE
  266. RECRDPI := 1;
  267. FOR RECRDI := 1 TO RECRDL DO (* MOVE ONE 128-BYTE RECORD *)
  268. BEGIN
  269. BIT4I := BIT4I+1;
  270. RECRDP[RECRDPI]^[RECRDI] := BUFF.B4[BIT4I];
  271. END; (* FOR *)
  272. SYS(RCL); (* WAIT FOR REQUEST DONE *)
  273. CNTRLP^.RECRDP := RECRDP[RECRDPI];
  274. (* REQUEST XHC TO XFER RECRD *)
  275. CNTRLP^.COMP := FALSE;
  276. END; (* FOR *)
  277. END; (* WHILE *) (* PROCESS FTS RECORD *)
  278. SYS(RCL); (* WAIT FOR REQUEST DONE *)
  279. CNTRLP^.TERM := TRUE; (* TERMINATE XHC *)
  280. CNTRLP^.COMP := FALSE;
  281. SYS(RCL); (* WAIT FOR TERMINATION *)
  282. MESSAGE(LDMSG); (* HOSTCOPY COMPLETE *)
  283. WRITELN(LDMSG);
  284. END; (* IF *) (* INIT OK *)
  285. END. (* HSTCOPY *)
  286. *WEOR
  287. TTL SYS - ISSUE SYSTEM REQUEST.
  288. TITLE SYS - ISSUE SYSTEM REQUEST.
  289. IDENT SYS
  290. ENTRY SYS
  291. SST
  292. SYSCOM B1
  293. *COMMENT SYS - ISSUE SYSTEM REQUEST.
  294. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  295. SYS SPACE 4,10
  296. *** SYS - ISSUE SYSTEM REQUEST.
  297. *
  298. * SYS ALLOWS DIRECT SYSTEM CALLS TO THE OPERATING
  299. * SYSTEM. THE REQUEST, IN THE FORM OF AN RA+1 REQUEST,
  300. * IS PASSED TO SYS, WHICH IN TURN CALLS SYS=. THIS
  301. * IS REQUIRED BECAUSE OF REGISTER DIFFERENCES.
  302. *
  303. * PASCAL DECLARATION:
  304. *
  305. * PROCEDURE SYS(VAR REQ : SYSREQ); EXTERN;
  306. *
  307. * REQ RA+1 REQUEST.
  308. SPACE 4,10
  309. *** COMMON DECKS.
  310.  
  311.  
  312. *CALL COMCMAC
  313. SPACE 4,10
  314. ** SYS - ISSUE SYSTEM REQUEST.
  315. *
  316. * ENTRY (X0) = ADDRESS OF THE REQUEST.
  317. *
  318. * EXIT REQUEST ISSUED.
  319. *
  320. * USES A - 4.
  321. * X - 4, 6.
  322. * B - NONE.
  323. *
  324. * CALLS SYS=.
  325.  
  326.  
  327. SYS PS ENTRY/EXIT
  328. SA4 X0 GET REQUEST
  329. BX6 X4
  330. RJ =XSYS=
  331. EQ SYS RETURN
  332.  
  333.  
  334. END
  335. *WEOR
cdc/nos2.source/opl871/hstcopy.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator