IDENT HFM,HFM
PERIPH
BASE MIXED
SST
*COMMENT HFM - HARDWARE FUNCTION MANAGER.
COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
TITLE HFM - HARDWARE FUNCTION MANAGER.
SPACE 4
*** HFM - HARDWARE FUNCTION MANAGER.
* A. J. BEEKMAN. 74/06/13.
SPACE 4
*** *HFM* PROCESSES FUNCTIONS FOR CPU PROGRAMS THAT OPERATE ON
* THE STATUS AND CONTROL REGISTERS OF THE CYBER 170 OR THE
* INTERLOCK REGISTER OF THE CYBER 70.
*
* ALL *HFM* FUNCTIONS REQUIRE THAT THE JOB IS SYSTEM ORIGIN
* OR THE USER HAS SYSTEM ORIGIN PRIVILEDGES WITH DEBUG MODE
* ON, THAT THE CALLING PROGRAM HAS AN SSJ= ENTRY POINT,
* AND THAT AUTO RECALL IS SET. ERRORS ENCOUNTERED BY *HFM*
* CAUSE THE REQUEST TO BE DROPPED AND ABORT THE JOB.
SPACE 4
*** CALL.
*
*T IR 24/ *HFMP*,12/ CODE,6/ 0,18/ ADDR
* CODE - FUNCTION CODE.
* ADDR - ADDRESS OF PARAMETER WORD.
SPACE 4
*** DAYFILE MESSAGES.
*
* * CHANNEL 36 NOT ACTIVE.* - INCORRECT REQUEST FOR CHANNEL 36.
*
* * HFM ARGUMENT ERROR.* - INCORRECT FUNCTION CODE OR PARAMETER
* WORD ADDRESS OUT OF RANGE.
*
* * HFM INCORRECT REQUEST.* - NOT SSJ= CALLER, AUTO RECALL NOT
* SET, OR NOT SYSTEM ORIGIN WITH USER NOT VALIDATED FOR
* SYSTEM PRIVILEDGES, OR NOT CYBER 70 OR CYBER 170 MAINFRAME.
SPACE 4
*CALL COMPMAC
*CALL COMSPIM
*CALL COMSSCR
*CALL COMSSSJ
TITLE DIRECT LOCATION ASSIGNMENTS.
**** DIRECT LOCATION ASSIGNMENTS.
CM EQU 10 - 14 CM WORD BUFFER
CN EQU 20 - 24 CM WORD BUFFER
PW EQU 30 - 34 PARAMETER WORD BUFFER
NB EQU 35 NUMBER OF BITS IN REGISTER
MT EQU 36 MACHINE TYPE FLAG
* CONSTANTS.
CH EQU CHSC STATUS/CONTROL REGISTER CHANNEL
****
HFM TITLE MAIN PROGRAM.
* HFM - MAIN PROGRAM.
ORG PPFW
HFM RJM PRS PRESET
LDM TFCN,IR+2 SET FUNCTION PROCESSOR
STM HFMA
LJM * PROCESS REQUEST
HFMA EQU *-1
* RETURN FROM FUNCTION.
HFM1 MONITOR DPPM DROP PP
LJM PPR EXIT TO PP RESIDENT
SPACE 4
** TFCN - TABLE OF FUNCTION CODE PROCESSORS.
* ENTRY = 1 WORD.
* INDEXED BY FUNCTION CODE.
*
*T 12/ ADDR
* ADDR ADDRESS OF FUNCTION PROCESSOR.
TFCN BSS 0
LOC 0
CON TDB TRANSFER DATA BLOCK
CON PRF PROCESS REGISTER FUNCTION
LOC *O
TFCNL EQU *-TFCN
ERR TITLE SUBROUTINES.
** ERR - ERROR PROCESSOR.
*
* ENTRY (A) = ADDRESS OF MESSAGE.
*
* EXIT TO PPR (JOB HAS BEEN ABORTED).
*
* CALLS DFM.
*
* MACROS MONITOR.
ERR RJM DFM ISSUE DAYFILE MESSAGE
MONITOR ABTM ABORT JOB
LJM PPR EXIT TO PP RESIDENT
TDB TITLE FUNCTION PROCESSORS.
*** TDB - TRANSFER DATA BLOCK (FUNCTION 0).
*
* TRANSFER DATA BLOCK BIT BY BIT TO THE STATUS AND CONTROL
* REGISTER, OR 128 BITS TO THE INTERLOCK REGISTER ON A CYBER
* 70. SET OR CLEAR THE CORRESPONDING BITS IN THE REGISTER
* AS IN THE DATA BLOCK. THIS ALLOWS THE USER TO SET ERROR
* OR CONTROL BITS MANUALLY.
*
* CALLING FORMAT:
*
*T ADDR 2/F,58/ 0
*T,DB+0 60/ REGISTER BITS 59 - 0
*T,DB+1 60/ REGISTER BITS 119 - 60
*T,DB+2 60/ REGISTER BITS 179 - 120
*T,DB+3 60/ REGISTER BITS 239 - 180
*
* ADDR PARAMETER WORD ADDRESS.
* DB DATA BLOCK ADDRESS (ADDR+1).
* F CHANNEL 36 REGISTER FLAG (BIT 59).
*
*
* ENTRY (PW) = PARAMETER WORD.
* PARAMETER WORD BIT 59 SET - CHANNEL 36 REGISTER.
* DATA BLOCK WORD 0 - BITS 59 - 0.
* WORD 1 - BITS 119 - 60.
* WORD 2 - BITS 179 - 120.
* WORD 3 - BITS 239 - 180.
*
* EXIT DATA BLOCK TRANSFERRED TO CORRECT REGISTER.
*
* USES T2 - T4.
*
* CALLS CLO, CTY, CCH, SFC, CLL.
TDB BSS 0
RJM CLO CHECK LOCK OUT
RJM CTY CHECK TYPE OF REGISTER
LDD PW PARAMETER WORD
SHN 21-13
PJN TDB1 IF CHANNEL 16
RJM CCH CHANGE CHANNEL
* READ DATA BLOCK.
TDB1 LDD IR+3 READ DATA BLOCK
LPN 77
SHN 6
ADD RA
SHN 6
ADD IR+4
ADN 1
CRM SCRB+17,ON WORD 0
CRM SCRB+12,ON WORD 1
CRM SCRB+5,ON WORD 2
CRM SCRB,ON WORD 3
LDC SCRB+23 S/C WORD TO READ
STD T3
LDN 0 FIRST BIT NUMBER
STD T4
* TRANSFER DATA BLOCK TO HARDWARE REGISTER.
TDB2 LDN 14 NUMBER OF BITS PER WORD
STD T2
TDB3 LDI T3
SHN 21-0 GET NEXT BIT
STI T3
MJN TDB4 IF BIT TO BE SET
LDC FCCL CLEAR BIT
UJN TDB5
TDB4 LDC FCSB SET BIT
TDB5 LMC 0 ADD BIT NUMBER
TDBA EQU *-1
RJM SFC SEND FUNCTION
AOD T4 INCREMENT BIT NUMBER
STM TDBA
SBD NB
ZJN TDB6 IF ALL BITS TRANSFERRED
SOD T2 DECREMENT BITS PER WORD
NJN TDB3 IF ENTIRE WORD NOT TRANSFERRED
SOD T3 SET NEXT WORD ADDRESS
UJN TDB2 LOOP FOR ALL BITS
TDB6 RJM CLL CLEAR LOCK BIT
LJM HFM1 RETURN
PRF EJECT
*** PRF - PROCESS REGISTER FUNCTION (FUNCTION 1).
*
* PROCESS STATUS AND CONTROL REGISTER FUNCTION. SEND THE
* SPECIFIED FUNCTION TO THE REGISTER AND RETURN THE REPLY.
* IF CYCLE IS REQUESTED, SEND THE FUNCTION THE NUMBER OF
* TIMES AND AT THE TIME INTERVAL GIVEN IN THE PARAMETER WORD,
* AND RETURN THE REPLY AFTER THE FINAL CYCLE.
*
* CALLING FORMAT:
*
*T ADDR 2/F,10/ 0,12/ LENGTH,12/ NUMBER,12/ FUNCTION,12/ REPLY
*
* ADDR PARAMETER WORD ADDRESS.
* F CHANNEL 36 REGISTER FLAG (BIT 59).
* CYCLE FLAG (BIT 58).
* LENGTH NUMBER OF PERIODS PER CYCLE (PERIOD = 20B MS.).
* NUMBER NUMBER OF CYCLES.
* FUNCTION REGISTER FUNCTION.
* 0YYY READ BYTE YYY.
* 1XXX TEST BIT XXX.
* 2XXX CLEAR BIT XXX.
* 3XXX TEST/CLEAR BIT XXX.
* 4XXX SET BIT XXX.
* 5XXX TEST/SET BIT XXX.
* 6000 CLEAR ALL BITS.
* 7000 TEST ERROR BITS.
* REPLY FUNCTION REPLY.
*
*
* ENTRY (PW - PW+4) = PARAMETER WORD CONTENTS.
* PARAMETER WORD BIT 59 SET - CHANNEL 36.
* BITS 12 - 23 - S/C INSTRUCTION.
* BIT 58 SET - PROCESS CYCLE.
* BITS 24 - 35 - NUMBER OF CYCLES.
* BITS 36 - 47 - CYCLE TIME.
*
* EXIT S/C INSTRUCTION PROCESSED.
* REPLY IN BITS 0 - 11 OF PARAMETER WORD.
*
* USES CM - CM+4, CN - CN+4, PW - PW+4.
*
* CALLS CCH, CEB, CTY, SFC.
*
* MACROS MONITOR, PAUSE.
PRF BSS 0
RJM CTY CHECK TYPE OF REGISTER
LDD PW PARAMETER WORD
SHN 21-13
PJN PRF1 IF CHANNEL 16
RJM CCH CHANGE CHANNEL
PRF1 RJM CEB CHECK FOR CHANNEL 36 ERROR BIT
LDD PW
SHN 21-12
PJN PRF3 IF PROCESS CYCLE BIT NOT SET
* ON CYCLE, READ REAL TIME CLOCK.
MONITOR RCPM REQUEST CPU
PRF2 LDC RTCL READ REAL TIME CLOCK
CRD CN
* SEND FUNCTION AND RETURN REPLY.
PRF3 LDD PW+3
RJM SFC SEND FUNCTION
STD PW+4 SAVE SCR DATA
LDD T4 CHECK CHANNEL 36 ERROR BIT FLAG
ZJN PRF4 IF NOT ERROR BIT
LDC FCSB+EISP SET ERROR IN SECOND PPS BIT
OAN 16
IAN 16+40
PRF4 LDD PW
SHN 21-12
MJN PRF5 IF CYCLE BIT SET
LDD IR+3 COPY DATA TO CALLING PROGRAM
SHN 6
ADD RA
SHN 6
ADD IR+4
CWD PW
LJM HFM1 RETURN
* CHECK CYCLE TIMING.
PRF5 LDC RTCL READ REAL TIME CLOCK
CRD CM
LDD CM+4
SBD CN+4
SHN -4 NUMBER OF CYCLES SINCE LAST INSTRUCTION
SBD PW+1 CYCLE TIME
PJN PRF6 IF TIME TO SEND INSTRUCTION
PAUSE
UJN PRF5 LOOP FOR CYCLE TIME
* CHECK FOR END OF CYCLE.
PRF6 SOD PW+2 NUMBER OF CYCLES
SBN 1
ZJN PRF7 IF TIME UP
LDD IR+3 READ PARAMETER WORD
LPN 77
SHN 6
ADD RA
SHN 6
ADD IR+4
CRD CN
LDD CN CHECK FOR END OF CYCLE
SHN 21-12
PJN PRF7 IF STOP CYCLE SIGNAL
LJM PRF2 LOOP FOR NEXT INSTRUCTION
PRF7 LDN 0 CLEAR CYCLE BIT
STD PW
LJM PRF3 LOOP FOR LAST INSTRUCTION
CCH TITLE SECONDARY SUBROUTINES.
** CCH - CHANGE CHANNEL.
*
* EXIT IF CHANNEL 36 AVAILABLE, INSTRUCTIONS IN *SFC* ARE
* SET TO CHANNEL 36.
* IF NOT AVAILABLE, ERROR MESSAGE ISSUED.
*
* USES CM - CM+4.
*
* CALLS ERR, CLL.
CCH SUBR ENTRY/EXIT
LDD MT CHECK MACHINE TYPE
ZJN CCH1 IF NOT CYBER 170
LDN PPUL READ PP CONFIGURATION
CRD CM
LDD CM+2 CHECK NUMBER OF PP-S
SBN 13
MJN CCH1 IF 10 PP-S
LDC OANI+36 SET CHANNEL 36
STM SFCA
LDC IANI+36+40 SET CHANNEL 36
STM SFCB
UJN CCHX RETURN
CCH1 LDD IR+2
SBN 1
PJN CCH2 IF NOT FUNCTION 0
RJM CLL CLEAR LOCK BIT
CCH2 LDC =C* CHANNEL 36 NOT ACTIVE.*
LJM ERR ISSUE MESSAGE AND ABORT
CEB SPACE 4,10
** CEB - CHECK FOR CHANNEL 36 ERROR BIT.
*
* ENTRY (PW) = CHANNEL 36 FLAG.
* (PW+3) = REGISTER FUNCTION.
*
* EXIT (T4) NONZERO IF CHANNEL 36 ERROR BIT TO BE SET.
*
* USES T4.
CEB SUBR ENTRY/EXIT
LDN 0 CLEAR FLAG
STD T4
LDD PW
SHN 21-13
PJN CEBX IF CHANNEL 16
LDD PW+3 CHECK FOR SET BIT FUNCTIONS
SHN -11
SBN 4
MJN CEBX IF FUNCTIONS 0-3
SBN 2
PJN CEBX IF NOT SET OR TEST/SET FUNCTIONS
LDD PW+3 CHECK BIT NUMBER
LPC 777
SBN NTEB NUMBER OF TEST ERROR BITS
PJN CEBX IF NOT ERROR BIT
AOD T4 SET FLAG
UJN CEBX RETURN
CLL SPACE 4,5
** CLL - CLEAR LOCK OUT.
*
* EXIT LOCK OUT BIT CLEARED.
*
* USES CM - CM+4.
CLL SUBR ENTRY/EXIT
LDC SCRL CLEAR LOCK OUT BIT
CRD CM
LDD CM
LPC 3777
STD CM
LDC SCRL
CWD CM
UJN CLLX RETURN
CLO SPACE 4,5
** CLO - CHECK MTR LOCK OUT.
*
* EXIT LOCK OUT BIT SET.
*
* USES CM - CM+4.
CLO SUBR ENTRY/EXIT
CLO1 LDC SCRL CHECK MTR LOCK BIT
CRD CM
LDD CM
SHN 6
PJN CLO2 IF LOCK OUT BIT NOT SET
PAUSE
UJN CLO1 LOOP UNTIL CLEAR
CLO2 LDC 4000 SET BIT
RAD CM
LDC SCRL
CWD CM
UJN CLOX RETURN
CTY SPACE 4,7
** CTY - CHECK TYPE OF REGISTER.
*
* EXIT IF NOT CYBER 170, INSTRUCTIONS IN *SFC* SET TO
* CHANNEL 15.
* (NB) = NUMBER OF BITS IN REGISTER.
*
* USES CM - CM+4, NB.
CTY1 LDC NBIT SET NUMBER OF BITS IN S/C REGISTER
STD NB
CTY SUBR ENTRY/EXIT
LDD MT CHECK MACHINE TYPE
NJN CTY1 IF CYBER 170
LDC 200 SET NUMBER OF BITS
STD NB
SOM SFCA SET CHANNEL 15
SOM SFCB
UJN CTYX RETURN
SFC SPACE 4,5
** SFC - SEND FUNCTION TO S/C REGISTER.
*
* ENTRY (A) = S/C REGISTER FUNCTION.
*
* EXIT (A) = FUNCTION REPLY.
SFC SUBR ENTRY/EXIT
SFCA OAN CH+40 SEND FUNCTION
* OAN CH+40+20 (IF CHANNEL 36 CALL)
* OAN 15 (IF CYBER 70 CALL)
SFCB IAN CH+40
* IAN CH+40+20 (IF CHANNEL 36 CALL)
* IAN 15+40 (IF CYBER 70 CALL)
UJN SFCX RETURN
SPACE 4
USE LITERALS
* BUFFERS.
SCRB EQU * S/C REGISTER BUFFER
PRS TITLE PRESET.
** PRS - PRESET.
*
* EXIT (PW - PW+4) = PARAMETER WORD CONTENTS.
* TO ERR, IF ANY ERROR ENCOUNTERED.
*
* USES MT, CM - CM+4, PW - PW+4.
*
* CALLS CRS, CUA, ERR.
PRS SUBR ENTRY/EXIT
* CHECK PARAMETER WORD ADDRESS.
LDD IR+3 CHECK ADDRESS
LPN 77
SHN 14
MJN PRS2 IF OUT OF RANGE
ADD IR+4
ADN 5
SHN -6
SBD FL
PJN PRS2 IF .GT. FL - 5
LDD IR+3 SET ADDRESS - 2
LPN 77
SHN 14
ADD IR+4
SBN 2
PJN PRS3 IF .GT. RA + 1
PRS2 LDC =C* HFM ARGUMENT ERROR.*
UJN PRS4.2 ISSUE MESSAGE AND ABORT
PRS3 ADN 2 READ PARAMETER WORD
SHN 14
ADD RA
SHN 6
CRD PW
* CHECK FUNCTION CODE.
LDD IR+2 CHECK CODE
SBN TFCNL
PJN PRS2 IF INCORRECT CODE
* CHECK FOR LEGAL ACCESS.
LDD CP CHECK SSJ= BIT
ADC SEPW
CRD CM
LDD CM
SHN 21-2
PJN PRS4 IF NOT SSJ= JOB
RJM CUA CHECK USER ACCESS
NJN PRS4.1 IF *DEBUG* NOT TURNED ON
RJM CRS CHECK RECALL STATUS
NJN PRS5 IF AUTO RECALL SET
PRS4 LDC =C* HFM INCORRECT REQUEST.*
UJN PRS4.2 ISSUE MESSAGE AND ABORT
PRS4.1 LDC =C* DEBUG NOT TURNED ON.*
PRS4.2 LJM ERR ISSUE MESSAGE AND ABORT
PRS5 LDK MABL CHECK MAINFRAME TYPE
CRD CM
LDD CM+1
SHN -6
LPN 43
LMN 3
ZJN PRS4 IF CYBER 170-815/825/835/855
LMN 40
ZJN PRS4 IF NOT CYBER 170 OR CYBER 70 MAINFRAME
LMN 2
STD MT 0 = CYBER 70, NONZERO = CYBER 170
LJM PRSX RETURN
SPACE 4
* COMMON DECKS.
*CALL COMPCRS
SSJ$ EQU 1 SET SSJ CHECKING FOR *COMPCUA*
*CALL COMPCUA
END