PNT TITLE 'DMSPNT (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* MODULE NAME: 00004000
* 00005000
* DMSPNT (POINT) 00006000
* 00007000
* FUNCTION: 00008000
* 00009000
* TO PLACE A FILE STATUS TABLE ENTRY IN THE ACTIVE FILE 00010000
* TABLE (IF NECESSARY), AND TO SET THE READ POINTER 00011000
* AND/OR WRITE POINTER FOR THAT FILE TO A GIVEN ITEM 00012000
* NUMBER. 00013000
* 00014000
* ATTRIBUTES: 00015000
* 00016000
* NUCLEUS RESIDENT, REENTRANT 00017000
* 00018000
* ENTRY POINTS: 00019000
* 00020000
* DMSPNT 00021000
* 00022000
* ENTRY CONDITIONS: 00023000
* 00024000
* LA R1,PLIST R1 MUST POINT TO P-LIST AS USUAL 00025000
* 00026000
* THEN EITHER 00027000
* 00028000
* SVC X'CA' CALL POINT VIA SVC 00029000
* DC AL4(ERROR) ERROR-RETURN 00030000
* 00031000
* OR 00032000
* 00033000
* L R15,APOINT WHERE APOINT=V(DMSPNT) 00034000
* BALR R14,R15 CALLS POINT VIA BALR 00035000
* (WITHIN NUCLEUS) 00036000
* BNZ ERROR TRANSFER IF ERROR 00037000
* 00038000
* R1 MUST POINT TO POINT PARAMETER LIST: 00039000
* DS 0F 00040000
* PLIST DC CL8'POINT' (NOTE - IMMATERIAL IF CALLED BY BALR) 00041000
* DC CL8' ' FILENAME 00042000
* DC CL8' ' FILETYPE 00043000
* DC CL2' ' FILEMODE 00044000
* DC H' ' WRITE POINTER 00045000
* DC H' ' READ POINTER 00046000
* 00047000
* EXIT CONDITIONS: 00048000
* 00049000
* NORMAL RETURN 00050000
* R15=0 (AND CONDITION-CODE=0) 00051000
* 00052000
* FILE NOT FOUND 00053000
* R15=1 (AND CONDITION-CODE=2) 00054000
* 00055000
* PARAMETER LIST ERROR 00056000
* R15=2 (AND CONDITION-CODE=2) 00057000
* 00058000
* CALLS TO OTHER ROUTINES: 00059000
* 00060000
* DMSLAFFE, DMSLAF, DMSLFS 00061000
* 00062000
* EXTERNAL REFERENCES: 00063000
* 00064000
* AFTSECT, FVSECT 00065000
* 00066000
* TABLES/WORKAREAS 00067000
* 00068000
* NONE 00069000
* 00070000
* REGISTER USAGE: 00071000
* 00072000
* R13, FVSECT 00073000
* R12, BASE 00074000
* R1, AFTSECT 00075000
* REST WORK 00076000
* 00077000
* OPERATION: 00078000
* 00079000
* DMSPNT CHECKS FOR POSSIBLE PARAMETER LIST ERRORS 00080000
* AND EXITS WITH ERROR 2 IF PARAMETER LIST IF FAULTY. 00081000
* 00082000
* IF NOT, DMSPNT CALLS DMSLAF TO DETERMINE IF THE FST 00083000
* ENTRY FOR THE GIVEN FILE 00084000
* IS ALREADY IN THE ACTIVE FILE TABLE. IF YES, THE 00085000
* READ AND/OR WRITE POINTERS ARE SET AS DESCRIBED 00086000
* BELOW. 00087000
* 00088000
* IF NOT FOUND BY DMSLAF, THEN DMSPNT CALLS DMSLFS TO 00089000
* FIND THE FILE. IF IT IS NOT FOUND, ERROR 1 IS 00090000
* RETURNED TO THE CALLER. IF FOUND, THEN DMSLAFFE IS 00091000
* CALLED TO 00092000
* PLACE THE GIVEN FILE IN THE ACTIVE FILE TABLE. 00093000
* 00094000
* DMSPNT THEN CHECKS THE READ POINTER PROVIDED BY THE 00095000
* CALLER; IF IT IS 00096000
* ZERO, NO ACTION IS TAKEN. BUT IF NONZERO, THEN ITS 00097000
* VALUE IS STORED IN THE READ POINTER (AFTRP) IN THE 00098000
* ACTIVE FILE TABLE. 00099000
* 00100000
* NEXT, DMSPNT CHECKS THE WRITE POINTER PROVIDED BY THE 00101000
* CALLER; IF IT IS ZERO 00102000
* NO ACTION IS TAKEN. IF THE WRITE POINTER IS A 00103000
* HALFWORD OF ALL ONES (THAT IS,=65535), THEN THE WRITE 00104000
* POINTER AFTWP IS SET TO THE NUMBER OF ITEMS (AFTIC) 00105000
* PLUS ONE. IF THE WRITE POINTER IS NEITHER 0 NOR 00106000
* 65535, THEN ITS VALUE IS STORED IN THE WRITE POINTER 00107000
* (AFTWP) IN THE ACTIVE FILE TABLE. 00108000
* 00109000
* WHEN THROUGH, POINT RETURNS TO THE CALLER AS SHOWN IN 00110000
* THE EXIT CONDITIONS ABOVE. 00111000
* 00112000
*. 00113000
EJECT 00114000
POINT START 0 00115000
USING NUCON,R0 00116000
FSENTR REGSAV3 ENTER 'POINT', SAVE REGISTERS 00117000
LA R6,BACK (FOR BCR'S TO SAVE SPACE) 00118000
* BEWARE OF POSSIBLE INVALID PARAMETER-LIST 00119000
* (E.G. IF CALLED FROM TERMINAL) 00120000
LA R15,2 ERROR 2 IF THIS SHOULD HAPPEN ... 00121000
LA R1,0(,R1) MAKE SURE THE REGISTER IS PRESENTABLE. 00122000
CLC PMODE(10,R1),FENCE WATCH OUT FOR MODE ETC = JUST A FENCE 00123000
BCR 8,R6 ERROR 2 IF IT IS. 00124000
CLC PMODE+2(16,R1),BLNKFEN ALSO WATCH OUT FOR BLANKS & FENCE 00125000
BCR 8,R6 ERROR 2 IF IT IS. 00126000
* IF NEITHER OF THESE, PARAMETER-LIST PRESUMED TO BE OK ... 00127000
* (ALLOW ANY MODE - E.G. P, T, S, BLANK, 00, X'FF', OR *) 00128000
* 00129000
LH R4,WPTR(,R1) PICK UP BOTH POINTERS FROM USER LIST 00130000
LH R5,RPTR(,R1) (WHILE R1 STILL AVAILABLE) 00131000
LR R11,R1 SAVE R1 IN R11 (NEEDED BY 'ACTFREE') 00132000
* 00133000
SR R0,R0 INITIALIZE R0 AND 00134000
L R15,AACTLKP CALL 'ACTLKP' TO SEE 00135000
BALR R14,R15 IF FILE IS IN ACTIVE-FILE-TABLE 00136000
BZ FOUND BZ IF YES, FOUND THEREIN. 00137000
* 00138000
L R15,=V(DMSLFS) IF NOT, GO SEE IF THE FILE EXISTS 00139000
BALR R14,R15 00140000
BCR 7,R6 GO TO 'BACK' IF ERROR & RETURN FSTLKP ERROR-CODE 00141000
* 00142000
L R15,AACTFREE CALL 'ACTFREE' TO INSERT FST-ENTRY 00143000
BALR R14,R15 IN ACTIVE FILE TABLE. 00144000
* 00145000
USING AFTSECT,R1 ... 00146000
FOUND L R2,F65535 65535 INTO R2 00147000
* (NOTE - READ-POINTER FROM P-LIST IN R5, WRITE-PTR IN R4) 00148000
NR R5,R2 MAKE SURE READ-POINTER NO MORE THAN 65535 00149000
BZ TSTWPT AND CHECK IT, BZ IF = 0. 00150000
* 00151000
STH R5,AFTRP STORE NEW READ POINTER IN FST 00152000
* 00153000
TSTWPT NR R4,R2 MAKE SURE WRITE-POINTER NO MORE THAN 65535 00154000
BZ RETURN AND CHECK IT, BZ IF = 0. 00155000
CR R4,R2 IS NEW WRITE-POINTER 'ALL ONES' ? 00156000
BL SETWPT BL IF NOT, STORE NEW POINTER. 00157000
LH R4,AFTIC IF YES, GET NO. OF ITEMS IN FILE, 00158000
NR R4,R2 ... 00159000
AH R4,H1 ADD 1 AND ... 00160000
* 00161000
SETWPT STH R4,AFTWP STORE NEW WRITE-POINTER IN FST-ENTRY 00162000
* 00163000
RETURN SR R15,R15 CLEAR GPR 15 00164000
BACK LM R0,R14,REGSAV3 RESTORE REGISTERS, 00165000
LTR R15,R15 SET CONDITION-CODE FOR CONVENIENCE OF CALLER 00166000
BR R14 AND RETURN. 00167000
* 00168000
H1 DC H'1' 00169000
EJECT 00170000
* DISPLACEMENTS AND CONSTANTS 00171000
* 00172000
* DISPLACEMENTS FROM CALLER'S PARAMETER-LIST ... 00173000
PMODE EQU 24 00174000
WPTR EQU 26 00175000
RPTR EQU 28 00176000
* 00177000
BLNKFEN DC 6C' ',10X'FF' WATCH OUT FOR BLANKS-FENCE OR FENCE 00178000
FENCE EQU BLNKFEN+6 ... 00179000
* 00180000
LTORG 00180100
EJECT 00181000
NUCON 00182000
AFT 00183000
EJECT 00184000
FVS 00185000
EJECT 00186000
REGEQU 00187000
END 00188000