Table of Contents

HFM

Table Of Contents

  • [00007] HFM - HARDWARE FUNCTION MANAGER.
  • [00009] HARDWARE FUNCTION MANAGER.
  • [00043] DIRECT LOCATION ASSIGNMENTS.
  • [00073] TFCN - TABLE OF FUNCTION CODE PROCESSORS.
  • [00090] ERR - ERROR PROCESSOR.
  • [00310] CCH - CHANGE CHANNEL.
  • [00342] CEB - CHECK FOR CHANNEL 36 ERROR BIT.
  • [00371] CLL - CLEAR LOCK OUT.
  • [00388] CLO - CHECK MTR LOCK OUT.
  • [00410] CTY - CHECK TYPE OF REGISTER.
  • [00431] SFC - SEND FUNCTION TO S/C REGISTER.
  • [00455] PRS - PRESET.

Source Code

HFM.txt
  1. IDENT HFM,HFM
  2. PERIPH
  3. BASE MIXED
  4. SST
  5. *COMMENT HFM - HARDWARE FUNCTION MANAGER.
  6. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  7. TITLE HFM - HARDWARE FUNCTION MANAGER.
  8. SPACE 4
  9. *** HFM - HARDWARE FUNCTION MANAGER.
  10. * A. J. BEEKMAN. 74/06/13.
  11. SPACE 4
  12. *** *HFM* PROCESSES FUNCTIONS FOR CPU PROGRAMS THAT OPERATE ON
  13. * THE STATUS AND CONTROL REGISTERS OF THE CYBER 170 OR THE
  14. * INTERLOCK REGISTER OF THE CYBER 70.
  15. *
  16. * ALL *HFM* FUNCTIONS REQUIRE THAT THE JOB IS SYSTEM ORIGIN
  17. * OR THE USER HAS SYSTEM ORIGIN PRIVILEDGES WITH DEBUG MODE
  18. * ON, THAT THE CALLING PROGRAM HAS AN SSJ= ENTRY POINT,
  19. * AND THAT AUTO RECALL IS SET. ERRORS ENCOUNTERED BY *HFM*
  20. * CAUSE THE REQUEST TO BE DROPPED AND ABORT THE JOB.
  21. SPACE 4
  22. *** CALL.
  23. *
  24. *T IR 24/ *HFMP*,12/ CODE,6/ 0,18/ ADDR
  25. * CODE - FUNCTION CODE.
  26. * ADDR - ADDRESS OF PARAMETER WORD.
  27. SPACE 4
  28. *** DAYFILE MESSAGES.
  29. *
  30. * * CHANNEL 36 NOT ACTIVE.* - INCORRECT REQUEST FOR CHANNEL 36.
  31. *
  32. * * HFM ARGUMENT ERROR.* - INCORRECT FUNCTION CODE OR PARAMETER
  33. * WORD ADDRESS OUT OF RANGE.
  34. *
  35. * * HFM INCORRECT REQUEST.* - NOT SSJ= CALLER, AUTO RECALL NOT
  36. * SET, OR NOT SYSTEM ORIGIN WITH USER NOT VALIDATED FOR
  37. * SYSTEM PRIVILEDGES, OR NOT CYBER 70 OR CYBER 170 MAINFRAME.
  38. SPACE 4
  39. *CALL COMPMAC
  40. *CALL COMSPIM
  41. *CALL COMSSCR
  42. *CALL COMSSSJ
  43. TITLE DIRECT LOCATION ASSIGNMENTS.
  44. **** DIRECT LOCATION ASSIGNMENTS.
  45.  
  46.  
  47. CM EQU 10 - 14 CM WORD BUFFER
  48. CN EQU 20 - 24 CM WORD BUFFER
  49. PW EQU 30 - 34 PARAMETER WORD BUFFER
  50. NB EQU 35 NUMBER OF BITS IN REGISTER
  51. MT EQU 36 MACHINE TYPE FLAG
  52.  
  53.  
  54. * CONSTANTS.
  55.  
  56. CH EQU CHSC STATUS/CONTROL REGISTER CHANNEL
  57. ****
  58. HFM TITLE MAIN PROGRAM.
  59. * HFM - MAIN PROGRAM.
  60.  
  61. ORG PPFW
  62. HFM RJM PRS PRESET
  63. LDM TFCN,IR+2 SET FUNCTION PROCESSOR
  64. STM HFMA
  65. LJM * PROCESS REQUEST
  66. HFMA EQU *-1
  67.  
  68. * RETURN FROM FUNCTION.
  69.  
  70. HFM1 MONITOR DPPM DROP PP
  71. LJM PPR EXIT TO PP RESIDENT
  72. SPACE 4
  73. ** TFCN - TABLE OF FUNCTION CODE PROCESSORS.
  74. * ENTRY = 1 WORD.
  75. * INDEXED BY FUNCTION CODE.
  76. *
  77. *T 12/ ADDR
  78. * ADDR ADDRESS OF FUNCTION PROCESSOR.
  79.  
  80.  
  81. TFCN BSS 0
  82. LOC 0
  83.  
  84. CON TDB TRANSFER DATA BLOCK
  85. CON PRF PROCESS REGISTER FUNCTION
  86.  
  87. LOC *O
  88. TFCNL EQU *-TFCN
  89. ERR TITLE SUBROUTINES.
  90. ** ERR - ERROR PROCESSOR.
  91. *
  92. * ENTRY (A) = ADDRESS OF MESSAGE.
  93. *
  94. * EXIT TO PPR (JOB HAS BEEN ABORTED).
  95. *
  96. * CALLS DFM.
  97. *
  98. * MACROS MONITOR.
  99.  
  100.  
  101. ERR RJM DFM ISSUE DAYFILE MESSAGE
  102. MONITOR ABTM ABORT JOB
  103. LJM PPR EXIT TO PP RESIDENT
  104. TDB TITLE FUNCTION PROCESSORS.
  105. *** TDB - TRANSFER DATA BLOCK (FUNCTION 0).
  106. *
  107. * TRANSFER DATA BLOCK BIT BY BIT TO THE STATUS AND CONTROL
  108. * REGISTER, OR 128 BITS TO THE INTERLOCK REGISTER ON A CYBER
  109. * 70. SET OR CLEAR THE CORRESPONDING BITS IN THE REGISTER
  110. * AS IN THE DATA BLOCK. THIS ALLOWS THE USER TO SET ERROR
  111. * OR CONTROL BITS MANUALLY.
  112. *
  113. * CALLING FORMAT:
  114. *
  115. *T ADDR 2/F,58/ 0
  116. *T,DB+0 60/ REGISTER BITS 59 - 0
  117. *T,DB+1 60/ REGISTER BITS 119 - 60
  118. *T,DB+2 60/ REGISTER BITS 179 - 120
  119. *T,DB+3 60/ REGISTER BITS 239 - 180
  120. *
  121. * ADDR PARAMETER WORD ADDRESS.
  122. * DB DATA BLOCK ADDRESS (ADDR+1).
  123. * F CHANNEL 36 REGISTER FLAG (BIT 59).
  124. *
  125. *
  126. * ENTRY (PW) = PARAMETER WORD.
  127. * PARAMETER WORD BIT 59 SET - CHANNEL 36 REGISTER.
  128. * DATA BLOCK WORD 0 - BITS 59 - 0.
  129. * WORD 1 - BITS 119 - 60.
  130. * WORD 2 - BITS 179 - 120.
  131. * WORD 3 - BITS 239 - 180.
  132. *
  133. * EXIT DATA BLOCK TRANSFERRED TO CORRECT REGISTER.
  134. *
  135. * USES T2 - T4.
  136. *
  137. * CALLS CLO, CTY, CCH, SFC, CLL.
  138.  
  139.  
  140. TDB BSS 0
  141. RJM CLO CHECK LOCK OUT
  142. RJM CTY CHECK TYPE OF REGISTER
  143. LDD PW PARAMETER WORD
  144. SHN 21-13
  145. PJN TDB1 IF CHANNEL 16
  146. RJM CCH CHANGE CHANNEL
  147.  
  148. * READ DATA BLOCK.
  149.  
  150. TDB1 LDD IR+3 READ DATA BLOCK
  151. LPN 77
  152. SHN 6
  153. ADD RA
  154. SHN 6
  155. ADD IR+4
  156. ADN 1
  157. CRM SCRB+17,ON WORD 0
  158. CRM SCRB+12,ON WORD 1
  159. CRM SCRB+5,ON WORD 2
  160. CRM SCRB,ON WORD 3
  161. LDC SCRB+23 S/C WORD TO READ
  162. STD T3
  163. LDN 0 FIRST BIT NUMBER
  164. STD T4
  165.  
  166. * TRANSFER DATA BLOCK TO HARDWARE REGISTER.
  167.  
  168. TDB2 LDN 14 NUMBER OF BITS PER WORD
  169. STD T2
  170. TDB3 LDI T3
  171. SHN 21-0 GET NEXT BIT
  172. STI T3
  173. MJN TDB4 IF BIT TO BE SET
  174. LDC FCCL CLEAR BIT
  175. UJN TDB5
  176.  
  177. TDB4 LDC FCSB SET BIT
  178. TDB5 LMC 0 ADD BIT NUMBER
  179. TDBA EQU *-1
  180. RJM SFC SEND FUNCTION
  181. AOD T4 INCREMENT BIT NUMBER
  182. STM TDBA
  183. SBD NB
  184. ZJN TDB6 IF ALL BITS TRANSFERRED
  185. SOD T2 DECREMENT BITS PER WORD
  186. NJN TDB3 IF ENTIRE WORD NOT TRANSFERRED
  187. SOD T3 SET NEXT WORD ADDRESS
  188. UJN TDB2 LOOP FOR ALL BITS
  189.  
  190. TDB6 RJM CLL CLEAR LOCK BIT
  191. LJM HFM1 RETURN
  192. PRF EJECT
  193. *** PRF - PROCESS REGISTER FUNCTION (FUNCTION 1).
  194. *
  195. * PROCESS STATUS AND CONTROL REGISTER FUNCTION. SEND THE
  196. * SPECIFIED FUNCTION TO THE REGISTER AND RETURN THE REPLY.
  197. * IF CYCLE IS REQUESTED, SEND THE FUNCTION THE NUMBER OF
  198. * TIMES AND AT THE TIME INTERVAL GIVEN IN THE PARAMETER WORD,
  199. * AND RETURN THE REPLY AFTER THE FINAL CYCLE.
  200. *
  201. * CALLING FORMAT:
  202. *
  203. *T ADDR 2/F,10/ 0,12/ LENGTH,12/ NUMBER,12/ FUNCTION,12/ REPLY
  204. *
  205. * ADDR PARAMETER WORD ADDRESS.
  206. * F CHANNEL 36 REGISTER FLAG (BIT 59).
  207. * CYCLE FLAG (BIT 58).
  208. * LENGTH NUMBER OF PERIODS PER CYCLE (PERIOD = 20B MS.).
  209. * NUMBER NUMBER OF CYCLES.
  210. * FUNCTION REGISTER FUNCTION.
  211. * 0YYY READ BYTE YYY.
  212. * 1XXX TEST BIT XXX.
  213. * 2XXX CLEAR BIT XXX.
  214. * 3XXX TEST/CLEAR BIT XXX.
  215. * 4XXX SET BIT XXX.
  216. * 5XXX TEST/SET BIT XXX.
  217. * 6000 CLEAR ALL BITS.
  218. * 7000 TEST ERROR BITS.
  219. * REPLY FUNCTION REPLY.
  220. *
  221. *
  222. * ENTRY (PW - PW+4) = PARAMETER WORD CONTENTS.
  223. * PARAMETER WORD BIT 59 SET - CHANNEL 36.
  224. * BITS 12 - 23 - S/C INSTRUCTION.
  225. * BIT 58 SET - PROCESS CYCLE.
  226. * BITS 24 - 35 - NUMBER OF CYCLES.
  227. * BITS 36 - 47 - CYCLE TIME.
  228. *
  229. * EXIT S/C INSTRUCTION PROCESSED.
  230. * REPLY IN BITS 0 - 11 OF PARAMETER WORD.
  231. *
  232. * USES CM - CM+4, CN - CN+4, PW - PW+4.
  233. *
  234. * CALLS CCH, CEB, CTY, SFC.
  235. *
  236. * MACROS MONITOR, PAUSE.
  237.  
  238.  
  239. PRF BSS 0
  240. RJM CTY CHECK TYPE OF REGISTER
  241. LDD PW PARAMETER WORD
  242. SHN 21-13
  243. PJN PRF1 IF CHANNEL 16
  244. RJM CCH CHANGE CHANNEL
  245. PRF1 RJM CEB CHECK FOR CHANNEL 36 ERROR BIT
  246. LDD PW
  247. SHN 21-12
  248. PJN PRF3 IF PROCESS CYCLE BIT NOT SET
  249.  
  250. * ON CYCLE, READ REAL TIME CLOCK.
  251.  
  252. MONITOR RCPM REQUEST CPU
  253. PRF2 LDC RTCL READ REAL TIME CLOCK
  254. CRD CN
  255.  
  256. * SEND FUNCTION AND RETURN REPLY.
  257.  
  258. PRF3 LDD PW+3
  259. RJM SFC SEND FUNCTION
  260. STD PW+4 SAVE SCR DATA
  261. LDD T4 CHECK CHANNEL 36 ERROR BIT FLAG
  262. ZJN PRF4 IF NOT ERROR BIT
  263. LDC FCSB+EISP SET ERROR IN SECOND PPS BIT
  264. OAN 16
  265. IAN 16+40
  266. PRF4 LDD PW
  267. SHN 21-12
  268. MJN PRF5 IF CYCLE BIT SET
  269. LDD IR+3 COPY DATA TO CALLING PROGRAM
  270. SHN 6
  271. ADD RA
  272. SHN 6
  273. ADD IR+4
  274. CWD PW
  275. LJM HFM1 RETURN
  276.  
  277. * CHECK CYCLE TIMING.
  278.  
  279. PRF5 LDC RTCL READ REAL TIME CLOCK
  280. CRD CM
  281. LDD CM+4
  282. SBD CN+4
  283. SHN -4 NUMBER OF CYCLES SINCE LAST INSTRUCTION
  284. SBD PW+1 CYCLE TIME
  285. PJN PRF6 IF TIME TO SEND INSTRUCTION
  286. PAUSE
  287. UJN PRF5 LOOP FOR CYCLE TIME
  288.  
  289. * CHECK FOR END OF CYCLE.
  290.  
  291. PRF6 SOD PW+2 NUMBER OF CYCLES
  292. SBN 1
  293. ZJN PRF7 IF TIME UP
  294. LDD IR+3 READ PARAMETER WORD
  295. LPN 77
  296. SHN 6
  297. ADD RA
  298. SHN 6
  299. ADD IR+4
  300. CRD CN
  301. LDD CN CHECK FOR END OF CYCLE
  302. SHN 21-12
  303. PJN PRF7 IF STOP CYCLE SIGNAL
  304. LJM PRF2 LOOP FOR NEXT INSTRUCTION
  305.  
  306. PRF7 LDN 0 CLEAR CYCLE BIT
  307. STD PW
  308. LJM PRF3 LOOP FOR LAST INSTRUCTION
  309. CCH TITLE SECONDARY SUBROUTINES.
  310. ** CCH - CHANGE CHANNEL.
  311. *
  312. * EXIT IF CHANNEL 36 AVAILABLE, INSTRUCTIONS IN *SFC* ARE
  313. * SET TO CHANNEL 36.
  314. * IF NOT AVAILABLE, ERROR MESSAGE ISSUED.
  315. *
  316. * USES CM - CM+4.
  317. *
  318. * CALLS ERR, CLL.
  319.  
  320.  
  321. CCH SUBR ENTRY/EXIT
  322. LDD MT CHECK MACHINE TYPE
  323. ZJN CCH1 IF NOT CYBER 170
  324. LDN PPUL READ PP CONFIGURATION
  325. CRD CM
  326. LDD CM+2 CHECK NUMBER OF PP-S
  327. SBN 13
  328. MJN CCH1 IF 10 PP-S
  329. LDC OANI+36 SET CHANNEL 36
  330. STM SFCA
  331. LDC IANI+36+40 SET CHANNEL 36
  332. STM SFCB
  333. UJN CCHX RETURN
  334.  
  335. CCH1 LDD IR+2
  336. SBN 1
  337. PJN CCH2 IF NOT FUNCTION 0
  338. RJM CLL CLEAR LOCK BIT
  339. CCH2 LDC =C* CHANNEL 36 NOT ACTIVE.*
  340. LJM ERR ISSUE MESSAGE AND ABORT
  341. CEB SPACE 4,10
  342. ** CEB - CHECK FOR CHANNEL 36 ERROR BIT.
  343. *
  344. * ENTRY (PW) = CHANNEL 36 FLAG.
  345. * (PW+3) = REGISTER FUNCTION.
  346. *
  347. * EXIT (T4) NONZERO IF CHANNEL 36 ERROR BIT TO BE SET.
  348. *
  349. * USES T4.
  350.  
  351.  
  352. CEB SUBR ENTRY/EXIT
  353. LDN 0 CLEAR FLAG
  354. STD T4
  355. LDD PW
  356. SHN 21-13
  357. PJN CEBX IF CHANNEL 16
  358. LDD PW+3 CHECK FOR SET BIT FUNCTIONS
  359. SHN -11
  360. SBN 4
  361. MJN CEBX IF FUNCTIONS 0-3
  362. SBN 2
  363. PJN CEBX IF NOT SET OR TEST/SET FUNCTIONS
  364. LDD PW+3 CHECK BIT NUMBER
  365. LPC 777
  366. SBN NTEB NUMBER OF TEST ERROR BITS
  367. PJN CEBX IF NOT ERROR BIT
  368. AOD T4 SET FLAG
  369. UJN CEBX RETURN
  370. CLL SPACE 4,5
  371. ** CLL - CLEAR LOCK OUT.
  372. *
  373. * EXIT LOCK OUT BIT CLEARED.
  374. *
  375. * USES CM - CM+4.
  376.  
  377.  
  378. CLL SUBR ENTRY/EXIT
  379. LDC SCRL CLEAR LOCK OUT BIT
  380. CRD CM
  381. LDD CM
  382. LPC 3777
  383. STD CM
  384. LDC SCRL
  385. CWD CM
  386. UJN CLLX RETURN
  387. CLO SPACE 4,5
  388. ** CLO - CHECK MTR LOCK OUT.
  389. *
  390. * EXIT LOCK OUT BIT SET.
  391. *
  392. * USES CM - CM+4.
  393.  
  394.  
  395. CLO SUBR ENTRY/EXIT
  396. CLO1 LDC SCRL CHECK MTR LOCK BIT
  397. CRD CM
  398. LDD CM
  399. SHN 6
  400. PJN CLO2 IF LOCK OUT BIT NOT SET
  401. PAUSE
  402. UJN CLO1 LOOP UNTIL CLEAR
  403.  
  404. CLO2 LDC 4000 SET BIT
  405. RAD CM
  406. LDC SCRL
  407. CWD CM
  408. UJN CLOX RETURN
  409. CTY SPACE 4,7
  410. ** CTY - CHECK TYPE OF REGISTER.
  411. *
  412. * EXIT IF NOT CYBER 170, INSTRUCTIONS IN *SFC* SET TO
  413. * CHANNEL 15.
  414. * (NB) = NUMBER OF BITS IN REGISTER.
  415. *
  416. * USES CM - CM+4, NB.
  417.  
  418.  
  419. CTY1 LDC NBIT SET NUMBER OF BITS IN S/C REGISTER
  420. STD NB
  421.  
  422. CTY SUBR ENTRY/EXIT
  423. LDD MT CHECK MACHINE TYPE
  424. NJN CTY1 IF CYBER 170
  425. LDC 200 SET NUMBER OF BITS
  426. STD NB
  427. SOM SFCA SET CHANNEL 15
  428. SOM SFCB
  429. UJN CTYX RETURN
  430. SFC SPACE 4,5
  431. ** SFC - SEND FUNCTION TO S/C REGISTER.
  432. *
  433. * ENTRY (A) = S/C REGISTER FUNCTION.
  434. *
  435. * EXIT (A) = FUNCTION REPLY.
  436.  
  437.  
  438. SFC SUBR ENTRY/EXIT
  439. SFCA OAN CH+40 SEND FUNCTION
  440. * OAN CH+40+20 (IF CHANNEL 36 CALL)
  441. * OAN 15 (IF CYBER 70 CALL)
  442. SFCB IAN CH+40
  443. * IAN CH+40+20 (IF CHANNEL 36 CALL)
  444. * IAN 15+40 (IF CYBER 70 CALL)
  445. UJN SFCX RETURN
  446. SPACE 4
  447. USE LITERALS
  448.  
  449.  
  450. * BUFFERS.
  451.  
  452.  
  453. SCRB EQU * S/C REGISTER BUFFER
  454. PRS TITLE PRESET.
  455. ** PRS - PRESET.
  456. *
  457. * EXIT (PW - PW+4) = PARAMETER WORD CONTENTS.
  458. * TO ERR, IF ANY ERROR ENCOUNTERED.
  459. *
  460. * USES MT, CM - CM+4, PW - PW+4.
  461. *
  462. * CALLS CRS, CUA, ERR.
  463.  
  464.  
  465. PRS SUBR ENTRY/EXIT
  466.  
  467. * CHECK PARAMETER WORD ADDRESS.
  468.  
  469. LDD IR+3 CHECK ADDRESS
  470. LPN 77
  471. SHN 14
  472. MJN PRS2 IF OUT OF RANGE
  473. ADD IR+4
  474. ADN 5
  475. SHN -6
  476. SBD FL
  477. PJN PRS2 IF .GT. FL - 5
  478. LDD IR+3 SET ADDRESS - 2
  479. LPN 77
  480. SHN 14
  481. ADD IR+4
  482. SBN 2
  483. PJN PRS3 IF .GT. RA + 1
  484. PRS2 LDC =C* HFM ARGUMENT ERROR.*
  485. UJN PRS4.2 ISSUE MESSAGE AND ABORT
  486.  
  487. PRS3 ADN 2 READ PARAMETER WORD
  488. SHN 14
  489. ADD RA
  490. SHN 6
  491. CRD PW
  492.  
  493. * CHECK FUNCTION CODE.
  494.  
  495. LDD IR+2 CHECK CODE
  496. SBN TFCNL
  497. PJN PRS2 IF INCORRECT CODE
  498.  
  499. * CHECK FOR LEGAL ACCESS.
  500.  
  501. LDD CP CHECK SSJ= BIT
  502. ADC SEPW
  503. CRD CM
  504. LDD CM
  505. SHN 21-2
  506. PJN PRS4 IF NOT SSJ= JOB
  507. RJM CUA CHECK USER ACCESS
  508. NJN PRS4.1 IF *DEBUG* NOT TURNED ON
  509. RJM CRS CHECK RECALL STATUS
  510. NJN PRS5 IF AUTO RECALL SET
  511. PRS4 LDC =C* HFM INCORRECT REQUEST.*
  512. UJN PRS4.2 ISSUE MESSAGE AND ABORT
  513.  
  514. PRS4.1 LDC =C* DEBUG NOT TURNED ON.*
  515. PRS4.2 LJM ERR ISSUE MESSAGE AND ABORT
  516.  
  517. PRS5 LDK MABL CHECK MAINFRAME TYPE
  518. CRD CM
  519. LDD CM+1
  520. SHN -6
  521. LPN 43
  522. LMN 3
  523. ZJN PRS4 IF CYBER 170-815/825/835/855
  524. LMN 40
  525. ZJN PRS4 IF NOT CYBER 170 OR CYBER 70 MAINFRAME
  526. LMN 2
  527. STD MT 0 = CYBER 70, NONZERO = CYBER 170
  528. LJM PRSX RETURN
  529. SPACE 4
  530. * COMMON DECKS.
  531.  
  532. *CALL COMPCRS
  533. SSJ$ EQU 1 SET SSJ CHECKING FOR *COMPCUA*
  534. *CALL COMPCUA
  535.  
  536.  
  537. END