VSP TITLE 'DMKVSP (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000 MACRO 00003000 &NAME RELOC 00004000 ENTRY &NAME 00005000 &NAME DS 0H 00006000 DROP R10 00007000 USING *,R12 00008000 ENTER 00009000 SL R12,=A(&NAME-&SYSECT) 00010000 USING &SYSECT,R12 00011000 USING &SYSECT+4096,R10 00012000 MEND 00013000 *. 00014000 * MODULE NAME - 00015000 * 00016000 * DMKVSP 00017000 * 00018000 * FUNCTION - 00019000 * 00020000 * TO HANDLE THE SIMULATION OF ALL USER SIO'S TO A VIRTUAL UNIT 00021000 * RECORD DEVICE (CARD READER, PUNCH, PRINTER, OR PSEUDO 00022000 * TIMER) THAT IS SPOOLED RATHER THAN DEDICATED. ALSO, TO 00023000 * HANDLE CONTROL PROGRAM REQUESTS THAT WISH TO PRINT ON THE 00024000 * USERS VIRTUAL PRINTER 00025000 * 00026000 * ATTRIBUTES - 00027000 * 00028000 * REENTRANT, RESIDENT, ENTERED VIA GOTO FROM DMKVIOEX 00029000 * 00030000 * ENTRY POINTS - 00031000 * 00032000 * DMKVSPEX - TO SIMULATE A SIO TO A SPOOLED UNIT RECORD DEVICE 00033000 * DMKVSPRT - TO PLACE A LINE GENERATED BY THE CONTROL PRO- 00034000 * GRAM ON THE USER'S SPOOLED PRINTER 00035000 * DMKVSPCR - TO STOP PROCESSING THE FILE CURRENTLY IN THE SPOOL- 00036000 * ED CARD READER, AND TO CLEAR ALL PENDING STATUS 00037000 * FROM THE DEVICE 00038000 * DMKVSPCO - TO PERFORM SIMILAR CLOSE FUNCTIONS FOR 00039000 * THE SPOOLED PRINTERS AND PUNCHES 00040000 * 00041000 * DMKVSPCP - CALLED FROM WITHIN DMKVSP TO WRITE CONSOLE 00042000 * HARDCOPY PRINT LINE 00043000 * DMKVSPTO - CALLED FROM DMKVIO AS A SUBROUTINE TO CHECK IF 00044000 * THE VIRL READER IS EMPTY 00045000 * NON-EXECUTABLE ENTRY POINTS - 00046000 * 00047000 * DMKVSPWA - INDEX WORK AREA FOR 3211 00048000 * 00049000 * ENTRY CONDITIONS - 00050000 * 00051000 * GPR2 = CONTENTS OF THE USER'S CAW (VIRTUAL ADDRESS) 00052000 * GPR8 = ADDRESS OF THE VDEVBLOK FOR ADDRESSED VIRTUAL DEVICE 00053000 * GPR9 = DEVICE ADDRESS (CCU IN BINARY) 00054000 * GPR11 = ADDRESS OF USER'S VMBLOK 00055000 * GPR12 = ADDRESS OF DMKVSP 00056000 * 00057000 * NOTE THAT WHEN DMKVSPEX IS ENTERED FROM DMKVIO, GPR13 DOES 00058000 * NOT POINT TO A SAVEAREA, AND THE ENTER AND EXIT MACROS MAY NOT 00059000 * BE USED. INSTEAD EXIT IS MADE DIRECTLY TO DMKDSPCH VIA A 00060000 * GOTO. HOWEVER, IF ANY OF THE OTHER ENTRY POINTS ARE CALLED, 00061000 * THE RETURN MUST BE MADE IN THE NORMAL MANNER 00062000 * 00063000 * EXIT CONDITIONS - 00064000 * 00065000 * NORMAL - 00066000 * EXIT IS MADE DIRECTLY TO DMKDSPCH, WITH THE CORRECT PENDING 00067000 * STATUS PLACED IN ALL VIRTUAL IO BLOKS AND THE USER'S 00068000 * CHANNEL PROGRAM COMPLETELY INTERPRETED. NOTE THAT THE 00069000 * USER HAS REMAINED IN EXWAIT DURING THE ENTIRE PROCESS, IN CON- 00070000 * TRAST TO SELECTOR CHANNEL IO 00071000 * 00072000 EJECT 00073000 * 00074000 * CALLS TO OTHER ROUTINES - 00075000 * 00076000 * DMKPGTSG - TO OBTAIN DASD PAGE BUFFER SPACE 00077000 * DMKRPAGT - TO READ A PAGE BUFFER INTO VIRTUAL MEMORY 00078000 * DMKRPAPT - WRITE A BUFFER FROM VIRTUAL MEMORY TO DASD 00079000 * DMKSCNVD - TO GET FULL VIRTUAL DEVICE ADDRESS 00080000 * DMKSCNVU - TO LOCATE THE VCUBLOK AND VCHBLOK IN ORDER TO POST 00081000 * ANY PENDING INTERRUPT AFTER INTERPRETATION IS COM- 00082000 * PLETED 00083000 * DMKSPLOV - TO OPEN A NEW DASD OUTPUT SPOOL FILE 00084000 * DMKSPLCV - TO CLOSE A NEW DASD OUTPUT SPOOL FILE 00085000 * DMKSPLDL - TO PURGE A PARTIALLY COMPLETE FILE 00086000 * DMKSTKCP - TO QUEUE A CP EXEC BLOK 00087000 * DMKCVTBH - CONVERT DEVICE ADDRESS FOR ERROR MESSAGES 00090000 * DMKTMRPT - TO GET USER'S TOTAL PROBLEM TIME USED 00091000 * DMKERMSG - TO WRITE ERROR MESSAGES 00092000 * DMKPGTVR - TO RELEASE VIRTUAL BUFFER 00093000 * DMKPGTVG - TO GET A VIRTUAL BUFFER 00094000 * DMKPSASC - CHECK IF CCW'S ARE WRITTING INTO A SHARED PAGE 00096000 * DMKPSACC - TO TEST IF A SHARED PAGE WAS CHANGED BY RUNUSER 00097000 * DMKVMAPS - TO UNSHARE A NAMED SYSTEM FROM RUNUSER 00098000 * DMKFREE, DMKFRET, DMKQCNWT, AND DMKCVTDT FOR THE USUAL REASONS 00099000 * DMKCKSPL - CHECKPOINT THE SFBLOK 00100000 * 00101000 * EXTERNAL REFERENCES - 00102000 * 00103000 * DMKVIOMK - A TABLE OF BIT FLAGS INDEXABLE BY DEVICE ADDRESS, 00104000 * USED TO SET AND CLEAR PENDING FLAGS IN VIRTUAL 00105000 * DEVICE, CONTROL UNIT AND CHANNEL BLOKS 00106000 * 00108000 * TABLES / WORKAREAS - 00109000 * 00110000 * 00111000 * REGISTER USAGE - 00112000 * 00113000 * GPR2 = REAL ADDRESS OF THE PAGED SPOOL BUFFER 00114000 * GPR3 = REAL ADDRESS OF THE USER'S DATA AREA 00115000 * GPR4,5 - WORK REGISTERS 00116000 * GPR5 = BASE REG FOR VFCBBLOK (PARTIME) 00117000 * GPR6 = INTERNAL SUBROUTINE LINKAGE 00118000 * GPR7 = ADDRESS OF SFBLOK FOR ACTIVE FILE 00119000 * GPR8 = ADDRESS OF VDEVBLOK FOR ACTIVE VIRTUAL DEVICE 00120000 * GPR9 = ADDRESS OF VSPLCTL WORKAREA 00121000 * GPR10 = DMKVSP BASE ADDRESS NUMBER TWO 00122000 * GPR11 = ADDRESS OF THE USER'S VMBLOK 00123000 * GPR12 = DMKVSP BASE ADDRESS 00124000 * GPR13 = INDEX TO DATA IN SPOOLING BUFFER 00125000 * GPR13 = DEVICE ADDRESS, OR SAVEAREA IF ONE OF THE VIRTUAL 00126000 * CLOSE ROUTINES WAS CALLED 00127000 * GPR14,15 - BALR LINKAGE FOR DMKFREE/DMKFRET 00128000 * 00129000 EJECT 00130000 * NOTES - 00131000 * 00132000 * OPERATION - 00133000 * 00134000 * 1. IF THE DEVICE IS CP BUSY (VDEVSVC=1): BAL TO 00135000 * STKCPBLK ROUTINE TO BUILD AND STACK A CPEXBLOK 00136000 * ON VSPSTK ANCHOR CHAIN TO DELAY THE REQUEST. 00137000 * WHEN THE CPEXBLOK IS UNSTACKED CONTROL WILL BE 00138000 * GIVEN TO ROUTINE AT LABEL RETCPEX. 00139000 * MARK THE VIRTUAL DEVICE AND SUBCHANNEL BUSY, CLEAR THE 00140000 * CSW AND SAVE THE STORAGE KEY; THEN, IF THE SIO IS TO 00141000 * PSEUDO TIMER DEVICE, GO HANDLE THAT CASE; OTHERWISE, 00142000 * CONTINUE 00143000 * 00144000 * 2. FOR SIO'S TO VIRTUAL READERS, PRINTERS AND PUNCHES, TEST 00145000 * TO SEE IF A FILE IS ALREADY OPEN ON THE DEVICE; IF ONE IS 00146000 * OPEN, BRANCH TO HANDLE THE PARTICULAR DEVICE TYPE, 00147000 * OTHERWISE, GO OPEN THE FILE. 00148000 * 00149000 * 3. IF A FILE IS SUCCESFULLY OPENED, CONTINUE PROCESSING FOR 00150000 * THE GIVEN DEVICE TYPE; OTHERWISE RETURN AN ERROR CON- 00151000 * DITION TO THE USER 00152000 * 00153000 * ERROR MESSAGES - 00154000 * 00155000 * DMKVSP427I (TYPE) (VADDR) SYSTEM SPOOL SPACE FULL; FILE CLOSED 00156000 * DMKVSP429I (TYPE) (VADDR) SPOOL ERROR; FILE HELD 00157000 * DMKVSP429I (TYPE) (VADDR) SPOOL ERROR; FILE PURGED 00158000 * 00159000 * ABEND VSP001 00160000 * A CALL TO DMKSCNVU TO LOCATE THE VDEVBLOK, VCHBLOK AND 00161000 * VCUBLOK. ONE OR MORE OF THE BLOK COULD NOT BE LOCATED 00162000 * 00163000 *. 00164000 EJECT 00165000 COPY OPTIONS 00166000 COPY LOCAL OPTIONS 00167000 EJECT 00168000 DMKVSP CSECT LOADER CONTROL ONLY 00169000 SPACE 00170000 ENTRY DMKVSPEX 00171000 SPACE 3 00172000 EXTRN DMKCVTDT,DMKPGTVR,DMKPGTSG 00173000 EXTRN DMKSCNVU,DMKPGTVG,DMKCVTBH 00174000 EXTRN DMKSPLOV,DMKSPLCV 00175000 EXTRN DMKSCNVD @VA12421 00176000 EXTRN DMKTMRPT 00177000 EXTRN DMKRPAGT,DMKRPAPT,DMKVIOMK 00178000 EXTRN DMKPGTSD @VA11232 00178100 EXTRN DMKERMSG,DMKPTRUL,DMKSPLDL 00179000 EXTRN DMKPSASC,DMKPSACC @V60BC11 00180000 EXTRN DMKSTKCP 00181000 EXTRN DMKCKSPL @V304298 00182000 EXTRN DMKVMASH @VA07351 00182100 EXTRN DMKVSQPD @V60BCAA 00182150 SPACE 3 00183000 USING PSA,R0 00184000 USING SPLINK,R2 00185000 USING SFBLOK,R7 00186000 USING VDEVBLOK,R8 00187000 USING VSPLCTL,R9 00188000 USING VMBLOK,R11 00189000 SPACE 2 00190000 DMKVSPEX EQU * 00191000 SPACE 00192000 USING *,R12 00193000 USING *+4096,R10 00194000 SPACE 2 00195000 B VSP0001 00196000 ID DC CL8'DMKVSP' MODULE NAME 00197000 VSP0001 EQU * 00198000 LR R10,R12 SET UP SECOND BASE REGISTER 00199000 A R10,F4096 .. 00200000 STH R13,VDEVUNIT SAVE FULL ADDRESS OF UNIT 00201000 L R1,VDEVIOCT GET IOCOUNT FOR DEVICE 00202000 AL R1,F1 BUMP IO COUNT 00203000 ST R1,VDEVIOCT AND STORE 00204000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01021 00205000 BZ SETBUSY NO - @VM01021 00206000 LA R6,RETCPEX ADDRESS OF CPEX RETURN @VM01021 00207000 B STKCPBLK WAIT FOR DEVICE TO FREE UP @VM01021 00208000 RETCPEX AL R8,VMDVSTRT GET VDEVBLOK ADDRESS @VM01021 00209000 NI VDEVSFLG,X'FF'-VDEVSVC RESET CP BUSY @VM01021 00210000 SETBUSY OI VDEVSTAT,VDEVBUSY+VDEVCHBS INDICATE CP BUSY @VM01021 00211000 XC VDEVCSW,VDEVCSW CLEAR VIRTUAL CSW 00212000 LA R1,0(,R2) CLEAR STORAGE KEY FROM CAW 00213000 OI VDEVFLAG,VDEVCCW1 INDICATE 1ST CCW 00214000 STCM R2,8,VDEVKEY SAVE STORAGE KEY IN VDEVBLOK 00215000 CLI VDEVTYPE,TYPTIMER SIO TO A VIRTUAL PSEUDO-TIMER? 00216000 BE SIOTIMER YES -- 00217000 L R9,VDEVSPL GET ADDRESS OF SPOOLING WORKAREA 00218000 LTR R9,R9 IS FILE OPEN YET? 00219000 BNZ INPROCES YES 00220000 BAL R6,OPEN GO OPEN THE FILE 00221000 ST R7,VSPSFBLK SAVE ADDRESS OF SPOOL FILE BLOK 00222000 ST R1,VSPCAW SAVE CAW ADDRESS 00223000 SPACE 00224000 WKBUF EQU * ABTAIN A WORK BUFFER FOR CCW'S AND DATA 00225000 L R5,VSPBUFBK ADDRESS OF WORK BUFFER 00226000 LTR R5,R5 BUFFER PRESENT ?? 00227000 BNZ INPRO1 YES - 00228000 SPACE 00229000 LA R0,VSPBUFSZ LENGTH OF WORK BUFFER 00230000 CALL DMKFREE OBTAIN STORAGE FOR WORK BUFFER 00231000 ST R1,VSPBUFBK SAVE ADDRESS OF WORK BUFFER 00232000 B INPRO1 AND PROCESS 00233000 SPACE 2 00234000 INPROCES ST R1,VSPCAW SAVE VIRTUAL ADDRESS OF CCW 00235000 INPRO1 L R7,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOCK 00236000 L R6,VSPBUFBK WORK BUFFER AVAILABLE ? 00237000 LTR R6,R6 .. 00238000 BZ WKBUF NO WORK BUFFER - GO GET ONE 00239000 XC VSPCCW,VSPCCW CLEAR CCW SAVEAREA 00240000 MVI VSPIDASW,0 RESET IDA SWITCH 00241000 BAL R6,GETCCW GO PICK UP FIRST CCW 00242000 NOP *+4 CORRECT ALLIGNMENT FOR RETURN @VA04572 00242350 * FROM LABEL 'NONIDA' @VA04572 00242700 CLI VDEVTYPC,CLASURI IS IT UNIT RECORD READER ?? 00243000 BE READER YES -- READER TYPE 00244000 B PRINTER FOR PRINTER AND PUNCH TYPE 00245000 EJECT 00246000 *. 00247000 * 00248000 * PSEUDO-TIMER DEVICE PROCESSING 00249000 * 00250000 * 1. VERIFY THAT THE CCW ADDRESS IS ALIGNED AND WITHIN THE 00251000 * USER'S VIRTUAL ADDRESS SPACE 00252000 * 00253000 * 2. TRANS FOR THE CCW AND VERIFY THAT THE DATA ADDRESS IS 00254000 * WITHIN THE USER'S ADDRESS SPACE, AND THAT THE 24 BYTE 00255000 * DATA AREA WILL NOT CROSS A PAGE BOUNDARY 00256000 * 00257000 * 3. TRANS FOR THE DATA PAGE, VERIFY THAT STORAGE PROTECTION IS 00258000 * NOT VIOLATED, AND MOVE THE DATE, TIME, VIRTUAL CPU TIME 00259000 * AND TOTAL CPU TIME TO THE USER 00260000 * 00261000 * 4. EXIT TO DMKDSPCH WITHOUT POSTING ANY INTERRUPTS AS 00262000 * PENDING 00263000 * 00264000 *. 00265000 SPACE 2 00266000 SIOTIMER EQU * HERE TO SIMULATE A SIO TO A PSEUDO TIMER 00267000 EX R1,CAWTEST TEST FOR DOUBLE WORD ALIGNMENT 00268000 BNZ PROGCHK INVALID ALIGNMENT 00269000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00270000 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 00271100 * USER CCW 00272000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00273000 L R1,0(,R2) GET DATA ADDRESS 00274000 LA R1,0(,R1) CLEAR CCW OP-CODE 00275000 LR R2,R1 DATA MUST NOT CROSS PAGE BOUNDARY 00276000 A R2,=F'23' FINE LAST DATA BYTE ADDRESS 00277000 N R2,NFFS ROUND DOWN TO PAGE NUMBER 00278000 * NFFS = X'FFFFF000' 00279000 CR R1,R2 CROSS PAGE BOUNDARY? 00280000 BL PROGCHK YES -- 00281000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00282000 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 00283100 * USER DATA 00284000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00285000 IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 00286000 CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 00287000 BNE PROTCHK PROTECTION VIOLATION 00288000 LR R3,R2 SAVE REAL ADDRESS 00289000 A R2,=F'23' PROTECTION TEST FOR 2K BOUNDARY 00290000 IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 00291000 CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 00292000 BNE PROTCHK PROTECTION VIOLATION 00293000 LA R1,0(,R3) FIELD FOR DATE 00294000 LA R2,8(,R3) FIELD FOR TIME 00295000 CALL DMKCVTDT FILL THEM IN.. 00296000 CALL DMKTMRPT OBTAIN UP-TO-DATE VTIME @V2B2638 00297000 STM R0,R1,TEMPR0 SAVE IT FOR TOTAL CPU TIME CALCULATION 00298000 BAL R14,CVTIME AND CONVERT IT 00299000 ST R1,16(,R3) STORE FOR USER 00300000 LM R4,R5,VMTTIME GET SUPERVISOR OVERHEAD TIME 00301000 SL R5,TEMPR1 SUBTRACT OUT PROBLEM TIME 00302000 BC 8+2+1,*+8 BR. IF NO-CARRY 00303000 SL R4,F1 ADJUST FOR CARRY 00304000 SL R4,TEMPR0 TOTAL CPU TIME NOW IN R4-5 00305000 BAL R14,CTTIME AND CONVERT IT 00306000 ST R1,20(,R3) AND STORE IT 00307000 NI VDEVSTAT,X'FF'-(VDEVBUSY+VDEVCHBS) MARK DEVICE NOT BUSY 00308000 B EXIT EXIT 00309000 SPACE 00310000 CTTIME LM R0,R1,=X'7FFFFFFFFFFFF000' 00311000 SLR R1,R5 COMPUTE SUPERVISOR TIME USED 00312000 BC 8+2+1,*+8 BR. ON NO-CARRY 00313000 SL R0,F1 RE-ADJUST FOR CARRY 00314000 SLR R0,R4 00315000 SPACE 00316000 CVTIME SRDL R0,12 CONVERT TO MICRO-SECONDS 00317000 SLR R0,R0 REFLECT ONLY THE VALUE AFTER @VW01580 00318000 * WRAPAROUND 00319000 * IF VALUE MORE THAN X'FFFFFFFF' 00320000 LTR R1,R1 BYPASS DIVISION IF ZERO VALUE @VW01580 00321000 BZ *+8 @VW01580 00322000 D R0,=F'13' COMVERT TO TIMER UNITS 00323000 BR R14 RETURN TO CALLER 00324000 SPACE 2 00325000 CAWTEST TM ALIGNMNT,0 EXECUTED TO TEST CAW ALIGNMENT 00326000 SPACE 00327000 ALIGNMNT DC X'07' 00328000 DS 0F 00329000 NFFS DC X'FFFFF000' 00330000 SPACE 00331000 DS 0H 00332000 EJECT 00333000 *. 00334000 * 00335000 * SPOOLED CARD READER PROCESSING - 00336000 * 00337000 * 1. VERIFY THAT THE CCW OP-CODE IS LEGAL, AND SET UP INITIAL 00338000 * STATUS CONDITIONS IN THE CSW 00339000 * 00340000 * 2. VERIFY THAT THE COMMAND SEQUENCE IS LEGAL; THEN, IF THE 00341000 * COMMAND IS A FEED ONLY, GO TO STEP 5; OTHERWISE, CONTINUE 00342000 * 00343000 * 3. FOR A DATA MOVING READ, INDEX TO THE NEXT DATA RECORD IN 00344000 * THE BUFFER, LOCATE AND PAGE IN THE USERS DATA AREA, AND 00345000 * MOVE THE RECORD TO THE USER'S VIRTUAL MEMORY SPACE. THE 00346000 * DATA MOVING SUBROUTINES MUST ALSO TEST FOR ADDRESSING AND 00347000 * PROTECTION VIOLATIONS 00348000 * 00349000 * 4. TEST TO SEE IF A FEED HAS BEEN REQUESTED; IF IT HAS, 00350000 * CONTINUE; OTHERWISE, SKIP TO STEP 6. 00351000 * 00352000 * 5. LOCATE THE NEXT CARD IMAGE TO BE PASSED; IF NECESSARY, PAGE 00353000 * IN THE NEXT SPOOL BUFFER, AND TEST FOR A POSSIBLE END OF 00354000 * FILE CONDITION 00355000 * 00356000 * 6. CURRENT OPERATION IS NOW COMPLETE. TEST FOR ANY ERROR 00357000 * CONDITIONS, AND IF FOUND EXIT AFTER POSTING PROPER ENDING 00358000 * STATUS; OTHERWISE, CONTINUE 00359000 * 00360000 * 7. TEST FOR POSSIBLE COMMAND OR DATA CHAINING OR IDA: IF YES, 00361000 * LOCATE AND VERIFY NEXT CCW AND RESTART INTERPRETATION 00362000 * PROCESS; OTHERWISE, EXIT AFTER POSTING PROPER ENDING 00363000 * STATUS 00364000 * 00365000 *. 00366000 SPACE 2 00367000 READER EQU * HERE TO PROCESS SIO TO SPOOLED READER 00368000 LTR R7,R7 ANY FILE FOUND? @VA03503 00369000 BZ READER1 NO--BYPASS OPEN PROCESS @VA03503 00370000 L R1,VSPVPAGE GET VIRT. ADDR @VA03503 00371000 LTR R1,R1 ALREADY OPENED BY TIO OR SIO? @VA03503 00372000 BNZ READER1 ALREADY OPENED BY SIO @VA03503 00373000 BAL R6,OPENTIO HALF OPEN--FINISH THE OPEN @VA03503 00374000 READER1 EQU * @VA03503 00375000 MVI VDEVCSW+4,X'00' CLEAR STSTUS FOR NEW COMMAND @VA09566 00376100 NI VDEVCSW+5,PCI LEAVING PCI INTACT @VA09566 00376200 CLI VSPCCW,4 IS IT A SENSE COMMAND ?? 00377000 BE SENSE YES -- 00378000 XC VDEVSNSE(4),VDEVSNSE CLEAR SENSE INFORMATION 00379000 TM VSPCCW,X'0F' PROGRAM CHECK CONDITION ?? 00380000 BNZ TESTRDY NO -- TEST FOR DEVICE READY 00381000 OI VDEVCSW+5,PRGC SET PROGRAM CHECK ON 00382000 B RDREOFU USER IS FORCING EOF 00383000 TESTRDY TM VDEVSTAT,VDEVNRDY DEVICE READY ?? 00384000 BO NOTREADY NO -- DEVICE NOT READY 00385000 TM VSPCCW,2 IS THE READ BIT ON? 00386000 BZ RDREOFU NO -- USER IS FORCING EOF 00387000 SPACE 00388000 LTR R7,R7 SPOOL FILE AVAILBLE FOR THIS RDR ?? 00389000 BNZ TSTNOP YES - CONT 00390000 MVI VDEVSNSE,INTREQ SET SENSE TO INTERVENTION REQ 00391000 B NOFILE .. 00392000 SPACE 00393000 SPACE 00394000 TSTNOP CLI VSPCCW,3 IS IT A NOP 00395000 BNE TESTBAD NO -- GO TEST FOR ILLEGAL CCW 00396000 OI VDEVCSW+4,DE NOP WILL PRESENT DE IMMEDIATELY 00397000 B NOFEED GO TEST FOR MORE CCWS 00398000 SPACE 00399000 TESTBAD TM VSPCCW,X'1C' ANY ILLEGAL BITS ON? 00400000 BNZ RDREOFU YES -- 00401000 CLI VSPCCW,X'C3' INVALID OP CODE ? 00402000 BE RDREOFU YES - 00403000 CLI VSPCCW,X'E3' INVALID OP CODE ? 00404000 BE RDREOFU YES - 00405000 SPACE 00406000 TM SFBFLAG,SFBEOF HAS EOF BEEN REACHED? 00407000 BO RDREOF YES -- NORMAL END OF FILE 00408000 FEEDTEST TM VSPCCW,X'23' FEED ONLY? 00409000 BNO READ NO -- GO DO READ 00410000 NI VSPCCW,3 FORCE TREATMENT AS IMMEDIATE COMMAND 00411000 CLI VDEVTYPE,TYP3505 3505 READER ? 00412000 BE RDRFEED YES -- NO ERROR CHECK ON OP 23 00413000 TM VDEVSFLG,VDEVFEED TWO FEEDS IN A ROW ?? 00414000 BZ RDRFEED NO -- COMMAND SEQUENCE OK 00415000 MVI VDEVSNSE,CMDREJ INVALID SEQUENCE 00416000 B UNITCHK GO GIVE UNIT CHECK 00417000 SPACE 3 00418000 READ EQU * HERE TO SIMULATE READ 00419000 L R3,VSPBUFBK ADDRESS OF WORK BUFFER 00420000 LH R5,SFBRECSZ DEVICE LOGICAL RECORD SIZE 00421000 RDRCD LA R0,MOVERDR POINT TO PROPER MOVE INSTRUCTION 00422000 * FOR READER 00423000 TM VSPCCW,3 NOP-CODE TYPE 00424000 BO NOFEED YES -- NO DATA MOVE 00425000 BAL R6,MOVEDATA AND GO MOVE DATA FROM WORK BUFFER 00426000 * TO USER 00427000 SPACE 2 00428000 * 00429000 * READ HAS BEEN SIMULATED 00430000 * 00431000 SPACE 2 00432000 TM VSPCCW+4,CD+IDA IS USER DATA CHAINING OR IDA ?? 00433000 BNZ NOFEED YES -- DO NOT FEED 00434000 SPACE 2 00435000 TM VSPCCW,X'C0' IS IT A READ WITHOUT A FEED? 00436000 BNO RDRFEED NO -- GO SIMULATE A FEED 00437000 OI VDEVCSW+4,DE DE WITH CE FOR READ WITHOUT FEED 00438000 TM VDEVSFLG,VDEVFEED HAS FEED BEEN DONE ?? 00439000 BZ SETUS NEITHER -- THIS IS AN UNUSUAL 00440000 * SEQUENCE 00441000 RESETFD NI VDEVSFLG,X'FF'-VDEVFEED FEED NOT DONE FOR THIS COMMAND 00442000 B NOFEED CONTINUE PROCESSING 00443000 SPACE 00444000 SETUS EQU * 00445000 MVI VDEVSNSE,2 INDICATE UNUSUAL SEQUENCE 00446000 B NOFEED AND CONTINUE 00447000 SPACE 2 00448000 RDRFEED EQU * HERE TO SIMULATE FEED 00449000 OI VDEVSFLG,VDEVFEED FEED DONE FOR THIS COMMAND 00450000 L R1,VSPVPAGE ADDRESS OF VIRTUAL BUFFER 00451000 * PAGE THE BUFFER IN 00452000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00453000 TRANS 2,1,OPT=(BRING,DEFER,SYSTEM),IOER=ERR2 @VA00716 00454000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00455000 LH R13,VSPNEXT INDEX TO NEXT RECORD IN BUFFER 00456000 BAL R6,RDRDATA GO LOCATE NEXT RECORD IN READER 00457000 * BUFFER 00458000 EJECT 00459000 * 00460000 * UPON RETURN FROM RDRDATA, THE FIELD 'VSPNEXT' 00461000 * WILL BE UPDATED TO INDICATE THE DISPLACEMENT 00462000 * OF THE NEXT DATA RECORD. IF THE RECORD 00463000 * JUST READ WAS THE LAST ONE IN THE FILE, 00464000 * THE EOF LATCH WILL BE SET, AND THE 'FEED' WILL BE BYPASSED 00465000 * 00466000 SPACE 2 00467000 NOFEED EQU * IO OPERATION IS COMPLETE 00468000 BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 00469000 OI VDEVCSW+4,CE SET CHANNEL END FOR ALL COMMANDS 00470000 TM VDEVSNSE,2 UNUSUAL SEQUENCE? 00471000 BO UNITCHK YES -- GO SET UNIT CHECK 00472000 OI SFBFLAG,SFBOPEN INDICATE FILE OPENED 00473000 TM VDEVCSW+5,IL WAS INCORRECT LENGTH POSTED? 00474000 BO LASTCCW YES -- TERMINATE CHANNEL PROGRAM @VA01095 00475000 SPACE 2 00476000 CKCHAIN TM VSPCCW+4,CD+CC+IDA ANY CHAINING GOING ON ?? 00477000 BZ LASTCCW NO -- 00478000 L R1,VDEVCSW YES -- GET ADDRESS OF NEXT CCW 00479000 ST R1,VSPCAW AND SAVE IN WORKAREA 00480000 NI VDEVFLAG,X'FF'-VDEVCCW1 NO LONGER PROCESSING 1ST CCW 00481000 BAL R6,GETCCW GO LOCATE AND VALIDATE NEXT 00482000 * NON-TIC CCW 00483000 B READER RETURN IS HERE IF USER WAS COMMAND 00484000 * CHAINING 00485000 B RDRCD AND HERE IF HE WAS DATA CHAINING 00486000 SPACE 2 00487000 MOVERDR MVC 0(*-*,R2),12(R3) EXECUTED TO MOVE DATA TO USER 00488000 SPACE 2 00489000 ERR2 EQU * HERE IF IOERROR ON SPOOLING @VA00716 00490000 * BUFFER (TRANS) 00491000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00492000 SPACE 00493000 ERR1 EQU * HERE IF IOERROR ON SPOOLING BUFFER 00494000 OI SFBFLAG2,SFBHOLD DO NOT PURGE FILE 00495000 OI SFBFLAG,SFBRECER SET ALLOCATION RECORDS INCOMPLETE 00496000 BAL R6,FILECLR CLEAR FILE 00497000 BAL R6,DVICECLR CLEAR DEVICE 00498000 B MSG429I GO GIVE ERROR MESSAGE 00499000 EJECT 00500000 RDRDATA EQU * HERE TO LOCATE THE NEXT VALID DATA RECORD IN THE 00501000 * READER BUFFER. IF THE FILE WAS ORIGINALLY THE OUTPUT OF 00502000 * A PRINTER, IMMEDIATE RECORDS ARE BYPASSED. AFTER 00503000 * THE LAST RECORD IS FED, THE EOF LATCH IS SET. 00504000 * 00505000 L R0,VSPRECNO GET NUMBER OF RECS REMAINING IN 00506000 * BUFFER 00507000 AR R13,R2 POINT TO REAL ADDRESS OF NEXT RECORD 00508000 RDRCOUNT BCT R0,NEXTCARD AND COUNT DOWN BY ONE 00509000 SPACE 2 00510000 CLC VSPDPAGE,SFBLAST BUFFER IS EMPTY--WAS THAT LAST PAGE? 00511000 BNE NEXTPAGE NO -- GO GET NEXT PAGE 00512000 ZEROCNT OI SFBFLAG,SFBEOF LAST PAGE SET EOF 00513000 B RDREND END OF FILE 00514000 SPACE 2 00515000 NEXTPAGE L R0,SPNXTPAG GET CHAIN POINTER IN BUFFER 00516000 L R1,VSPVPAGE VIRTUAL BUFFER ADDRESS 00517000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00518000 CALL DMKRPAGT,PARM=BRING+SYSTEM GET NEXT BUFFER,AND 00519000 BNZ ERR2 SPOOL READ ERROR @VA01460 00520000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00521000 ST R0,VSPDPAGE SAVE DASD PAGE ADDRESS 00522000 SPACE 2 00523000 SR R1,R1 CLEAR 00524000 STH R1,VSPNEXT BUFFER DISPLACEMENT 00525000 * 00526000 * HERE TO BUILD DUMMY ALLOCATION RECORD TO BE USED FOR 00527000 * FAST DELETE LATER 00528000 * 00529000 TM SFBFLAG,SFBRECER ALLOCATION COMPLETE SO FAR ?? 00530000 BO SKIPREC NO -- SKIP DURING DUMMY RECORD 00531000 LA R1,SFBRECS POINT TO ALLOCATION STRING 00532000 USING RECBLOK,R1 00533000 SRL R0,16 GET CYLINDER NUMBER @VA00808 00534000 SPACE 00535000 FINDBLOK LR R4,R1 SAVE BACKCHAIN POINTER 00536000 L R1,RECPNT POINT TO NEXT RECBLOK ON CHAIN 00537000 LTR R1,R1 IS THERE ONE ?? 00538000 BNZ TESTCYL YES -- SEE IF ITS FOR THIS CYLINDER 00539000 SPACE 00540000 LA R0,RECSIZE BUILD A NEW BLOK 00541000 CALL DMKFREE 00542000 ST R1,RECPNT-RECBLOK(,R4) CHAIN NEW BLOK 00543000 XC RECBLOK(RECSIZE*8),RECBLOK CLEAR TO ZEROES 00544000 L R0,VSPDPAGE GET CYLINDER NUMBER 00545000 ST R0,RECCYL AND STORE IN BLOK 00546000 MVI RECUSED,X'00' ZERO OUT PAGE NUMBER 00547000 B SETREC AND GO MARK RECORD 00548000 SPACE 00549000 TESTCYL CH R0,RECCYL IS RECBLOK FOR THIS CYLINDER 00550000 BNE FINDBLOK NO -- KEEP LOOKING 00551000 CLC RECCYL+3(1),VSPDPAGE+3 CORRECT DEVICE ?? 00552000 BNE FINDBLOK NO -- KEEP LOOKING 00553000 SETREC EQU * FOUND THE BLOK -- 00554000 SR R14,R14 .. @VA00808 00555000 ICM R14,B'0001',VSPDPAGE+2 GET PAGE NUMBER @VA00808 00556000 BCTR R14,0 -1 FOR DIVIDE 00557000 SRDL R14,3 DIVIDE BY 8 00558000 SRL R15,29 AND SAVE THE REMAINDER 00559000 LA R14,RECMAP(R14) POINT TO BYTE TO UPDATE 00560000 IC R15,ALOCTABL(R15) AND GET BIT MASK 00561000 EX R15,TSTALLOC PAGE ALL-READY MARKED ? @VW01580 00562000 BO SKIPREC YES - SKIP ALLOCATE AND UPDATE @VW01580 00563000 EX R15,ALOCATE MARK THE PAGE 00564000 IC R15,RECUSED GET NUMBER OF RECORDS FOUND 00565000 LA R15,1(,R15) INCREMENT 00566000 STC R15,RECUSED AND SAVE 00567000 SPACE 00568000 SKIPREC L R0,SPRECNUM GET NUMBER OF RECORDS IN BUFFER 00569000 LA R13,SPSIZE(,R2) ADDRESS OF 1ST RECORD CCW 00570000 C R0,F0 BUFFER RECORD COUNT ZERO ?? 00571000 BE ZEROCNT YES -- EMPTY BUFFER 00572000 SPACE 2 00573000 NEXTCARD ST R0,VSPRECNO SAVE NUMBER OF RECORDS IN BUFFER 00574000 LR R15,R2 ADDRESS OF BUFFER @VA01460 00575000 A R15,F4095 POINT END OF BUFFER @VA01460 00576000 CLR R13,R15 DATA ADDRESS WITH IN PAGE ? @VA01460 00577000 BH UNITCHK NO - BAD DATA IN BUFFER @VA01460 00578000 TM 0(R13),3 IS IT AN IMMEDIATE OP-CODE 00579000 BNO SETNEXT NO -- 00580000 * ASSUME ALL IMMEDIATE RECORDS MUST BE CONTROL TYPE 00581000 TM 4(R13),SKIP IS THIS AN IMMED RECORD ?? @V293598 00582000 BNO SKIP63 SKIP PAST ITS DATA IF NOT @V293598 00583000 LA R13,8(,R13) POINT TO NEXT CCW 00584000 B RDRCOUNT AND CONTINUE THE COUNT-DOWN 00585000 SPACE 2 00586000 SKIP63 AH R13,10(R13) UPDATE TO NEXT CCW 00587000 B RDRCOUNT CONTINUE THE COUNT-DOWN 00588000 SPACE 2 00589000 SETNEXT LR R14,R13 SAVE RECORD ADDRESS 00590000 CLI 0(R13),X'02' READER FILE CCW ?? 00591000 BE *+12 YES -- 00592000 CLI 0(R13),X'42' READER FILE CCW ?? 00593000 BNE SETCONT NO - CONTINUE 00594000 LH R13,10(R14) PICK UP ADDRESS IN TIC CCW 00595000 N R13,F4095 GET DISPLACEMENT INTO PAGE 00596000 B SAVEDISP .. 00597000 SPACE 00598000 SETCONT EQU * 00599000 SR R13,R2 GET DISPLACEMENT INTO BUFFER 00600000 LR R5,R13 SAVE DISPLACEMENT 00601000 AH R13,10(R14) GET DISPLACEMENT TO NEXT CCW 00602000 SAVEDISP STH R13,VSPNEXT SAVE DISPLACEMENT TO NEXT CCW 00603000 L R5,VSPBUFBK WORK BUFFER ADDRESS 00604000 LA R4,VSPBUFSZ LENGTH OF BUFFER AREA 00605000 SLL R4,3 TIMES 8 00606000 LR R13,R4 .. @VW01580 00607000 SH R4,=H'2' -2 FOR CLEAR 00608000 MVI 0(R5),X'40' BLANK 00609000 EX R4,CLRWK CLEAR WORK BUFFER TO BLANKS 00610000 LH R4,6(R14) CCW DATA COUNT 00611000 LA R4,11(R4) ADD 12 BYTES FOR CCWS AND -1 FOR 00612000 * MOVE 00613000 CLR R4,R13 COUNT LARGER THAN BUFFER ??? @VW01580 00614000 BNL NOTREADY YES--UNIT CHECK @VA03503 00615000 EX R4,RDRBUF MOVE CCWS AND DATA TO WORK BUFFER 00616000 RDREND BR R6 RETURN TO CALLER 00617000 SPACE 2 00618000 CLRWK MVC 1(0,R5),0(R5) EXECUTED CLEAR WORK BUFFER TO 00619000 * BLANKS 00620000 SPACE 2 00621000 RDRBUF MVC 0(0,R5),0(R14) EXECUTED MOVE DATA TO WORK BUFFER 00622000 SPACE 2 00623000 ALOCATE OI 0(R14),0 EXECUTED TO MARK PAGE AS ALLOCATED 00624000 TSTALLOC TM 0(R14),0 EXECUTED TO TEST FOR MARK PAGE @VW01580 00625000 SPACE 00626000 ALOCTABL DC X'8040201008040201' BIT MASKS FOR ALLOCATION 00627000 DS 0H 00628000 EJECT 00629000 *. 00630000 * 00631000 * END OF FILE PROCESSING FOR SPOOLED CARD READER 00632000 * 00633000 * 1. CLOSE REQUEST ISSUED VIA CLOSE OR SPOOL COMMANDS: 00634000 * (A) IF THE DEVICE IS CP BUSY (VDEVSVC=1); BRANCH TO 00635000 * STKCPBLK ROUTINE TO BUILD AND STACK CPEXBLOK 00636000 * ON VSPSTK ANCHOR TO DELAY THE REQUEST, AND GO 00637000 * TO DISPATCHER.(DMKDSPCH) 00638000 * ENTRY POINT FOR CPEXBLOK IS LABEL RDRCLRET 00639000 * (B) IF THE DEVICE IS BUSY (SIO-VDEVBUSY=1); 00640000 * SET DEFFERED CLOSE REQUEST FLAG AND EXIT TO 00641000 * THE CALLER. 00642000 * (C) IF THE DEVICE IS NOT BUSY OR CP BUSY OR 00643000 * ENTRY VIA THE STACKED CPEXBLOK; CONTINUE 00644000 * 00645000 * 2. IF USER HAS FORCED END OF FILE VIA CONSOLE FUNCTION 00646000 * OR ILLEGAL CCW COMMAND CODE, CLEAR FILE FROM SYSTEM (UNLESS 00647000 * USER HAS REQUESTED SAVING), CLEAR STATUS FROM DEVICE 00648000 * AND EXIT, POSTING COMMAND REJECT IF APPROPRIATE 00649000 * 00650000 * 3. IF END OF FILE IS REACHED NORMALLY, PROCEED AS IN STEP 2 00651000 * ABOVE, UNLESS USER HAS REQUESTED CONTINUOUS READING. 00652000 * 00653000 * 4. FOR CONTINUOUS READING, DO NOT POST END OF FILE UNLESS 00654000 * NO MORE FILES REMAIN IN THE SYSTEM 00655000 * 00656000 * 5. IF NO MORE FILES REMAIN AND CONTINUOUS READING WITH END 00657050 * OF FILE IS IN EFFECT,POST UNIT EXCEPTION OTHERWISE POST 00657150 * INTERVENTION REQUIRED - READER EMPTY 00657250 * 00657350 * 6. IF NOT CONTINUOUS READING AND END OF FILE IS NOT SET THEN 00657450 * POST INTERVENTION REQUIRED - READER NOT READY 00657550 * 00657650 * 7. BEFORE THE EXIT IS MADE TO THE CALLER,BAL TO 00657750 * UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK,IF ANY 00657850 * FOR THIS DEVICE. 00657950 SPACE 2 00666000 USING SAVEAREA,R13 00667000 DMKVSPCR RELOC 00668000 LR R10,R12 SET UP SECOND BASE REGISTER 00669000 A R10,F4096 .. 00670000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00671000 LA R6,RDRCLRET RETURN ADDRESS FOR DELAY @VM01028 00672000 B SPLADD - @VM01028 00673000 RDRCLRET AL R8,VMDVSTRT VDEVBLOK ADDRESS @VM01028 00674000 NI VDEVSFLG,X'FF'-VDEVSVC RESET CP BUSY @VM01028 00675000 SPLADD ICM R9,B'1111',VDEVSPL GET ACTIVE FILE POINTER @VM01028 00676000 BZ RDRESET BRANCH IF NO ACTIVE FILE @VM01028 00677000 L R7,VSPSFBLK GET POINTER TO SFBLOK 00678000 LTR R7,R7 SPOOL FILE BLOK PRESENT ?? 00679000 BZ *+8 NO -- 00680000 OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00681000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01028 00682000 BO DELAYCL YES - SET UP DELAY @VM01028 00683000 TM VDEVSTAT,VDEVBUSY IS THE DEVICE CURRENTLY BUSY ?? 00684000 BZ RDRCLOSE NO -- CONTINUE WITH CLOSE 00685000 TM VDEVSFLG,VDEVDIAG BUSY WITH DIAGNOSE ?? 00686000 BZ DELAYCL NO - SET UP FOR POSSIBLE DELAY CLOSE 00687000 NI VDEVSTAT,X'FF'-VDEVBUSY RESET BUSY FOR DIAGNOSE 00688000 SPACE 00689000 RDRCLOSE OI VDEVSFLG,VDEVSVC INDICATE DEVICE CP BUSY @VM01028 00690000 BAL R6,FILECLR GO CLEAR FILE @VM01028 00691000 BAL R6,DVICECLR AND DEVICE 00692000 RDRESET MVI VDEVINTS,0 CLEAR STATUS 00693000 NI VDEVSFLG,X'FF'-(VDEVFEED+VDEVSVC) RESET FLAGS @VM01016 00694000 NI VDEVFLAG,X'FF'-VDEVCCW1 RESET 1ST CCW FLAG 00695000 BAL R6,UNSTKBLK GO UNSTACK CPEX BLOK @VM01028 00696000 EXIT - EXIT TO CALLER @VM01028 00697000 SPACE 00698000 DROP R13 00699000 SPACE 2 00700000 EJECT 00701000 RDREOFU EQU * HERE IF USER FORCED THE EOF VIA AN ILLEGAL COMMAND 00702000 SPACE 00703000 TM VDEVFLAG,VDEVCCW1 STILL ON FIRST CCW ?? 00704000 BO TSTFILE YES -- 00705000 BAL R6,PCITEST TEST FOR PCI INTERRUPT 00706000 OI VDEVCSW+4,CE+DE SET CHANNEL AND DEVICE END 00707000 MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 00708000 TSTFILE LTR R7,R7 SPOOL FILE BLOK PRESENT ?? 00709000 BZ NOFILE NO -- 00710000 OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00711000 BAL R6,FILECLR GO CLEAR READER FILE 00712000 NOFILE EQU * HERE IF NO FILE FOUND 00713000 BAL R6,DVICECLR GO CLEAR DEVICE BLOCK 00714000 NI VDEVSFLG,X'FF'-VDEVCFCL RESET DEFERED CLOSED 00715000 SPACE 00716000 SETSENSE TM VDEVSNSE,INTREQ INTERVENTION REQUIRED ?? 00717000 BO UNITCHK YES -- SET UNIT CHECK 00718000 TM VDEVCSW+5,PRGC PROGRAM CHECK SET ?? 00719000 BO PROGCHK YES -- GO 00720000 MVI VDEVSNSE,CMDREJ SET COMMAND REJECT 00721000 B UNITCHK AND GO GIVE UNIT CHECK 00722000 SPACE 2 00723000 RDREOF EQU * HERE ON NORMAL CARD READER END -OF-FILE 00724000 TM VDEVSFLG,VDEVCONT DOES USER WANT CONTINOUS READING ? 00725000 BZ LASTFILE NO -- 00726000 BAL R6,FILECLR GO CLEAR CURRENT FILE 00727000 BAL R6,OPENCONT YES -- GO FIND ANOTHER CARD FILE 00728000 BZ LASTFILE NO MORE FILES TO DO 00729000 ST R7,VSPSFBLK HOLD ADDRESS OF NEW SPOOL FILE BLOK 00730000 B FEEDTEST AND START PROCESSING THE NEW FILE 00731000 SPACE 2 00732000 LASTFILE EQU * HERE TO INDICATE EOF 00733000 TM VDEVSFLG,VDEVEOF END OF FILE BUTTON PUSHED ? 00734000 BO SETUE YES -- GO SET UNIT EXCEPTION 00735000 TM VDEVSFLG,VDEVCONT IS THIS A CONTINUOUS READ ? @VA09064 00735100 BO CONTREAD YES,KEEP READER READY @VA09064 00735200 OI VDEVSTAT,VDEVNRDY INDICATE VIRTUAL DEVICE NOT @VA09064 00735300 * READY 00735400 CONTREAD EQU * @VA09064 00735500 MVI VDEVSNSE,INTREQ OTHERWISE, SET INT.REQ. 00736000 OI VDEVCSW+4,UC AND UNIT CHECK 00737000 B SETRID AND SET RESIDUAL COUNT 00738000 SPACE 00739000 SETUE OI VDEVCSW+4,UE PUT UNIT EXCEPTION IN CSW 00740000 SETRID MVC VDEVCSW+6(2),VSPCCW+6 SET RESIDUAL COUNT 00741000 BAL R6,FILECLR GO CLEAR CURRENT FILE 00742000 BAL R6,DVICECLR AND DEVICE BLOCK 00743000 TM VDEVFLAG,VDEVCCW1 FIRST CCW ?? 00744000 BO VSPEXIT YES -TAKE GENERAL EXIT 00745000 B ENDCCW BREAK CHAIN AND EXIT 00746000 SPACE 2 00747000 FILECLR EQU * HERE TO START CLEARING THE OLD READER FILE 00748000 * UNLESS THE USER WANTS IT SAVED 00749000 LTR R9,R9 SPOOL CONTROL BLOK ?? 00750000 BCR 8,R6 NO -- LEAVE 00751000 L R7,VSPSFBLK LOAD ADDRESS OF SFBLOK 00752000 LTR R7,R7 SPOOL FILE PRESENT ?? 00753000 BCR 8,R6 NO - 00754000 NI SFBFLAG,X'FF'-SFBEOF RESET EOF @VA12597 00755000 TM SFBFLAG2,SFBHOLD FILE TO BE HELD ?? 00756000 BO TSTCONT TEST FOR CONT WITH HOLD @V200930 00757000 TM SFBFLAG2,SFBNOHLD FILE TO BE DELETED ?? 00758000 BO FILECLR1 YES - 00759000 TM VDEVSFLG,VDEVHOLD SHOULD FILE BE SAVED ?? 00760000 BZ FILECLR1 NO - CLEAR IT 00761000 TSTCONT TM VDEVSFLG,VDEVCONT CONT READING ON DEVICE ?? @V200930 00762000 BZ HOLDFILE NO, SAVE FILE @V200930 00763000 OI SFBFLAG,SFBUHOLD FORCE FILE TO USER HOLD @V200930 00764000 HOLDFILE NI SFBFLAG2,X'FF'-SFBHOLD RESET HOLD FLAG 00765000 OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00766000 NI SFBFLAG,X'FF'-SFBOPEN RESET OPEN FLAG @VA03105 00767000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @V304298 00768000 CALL DMKCKSPL,PARM=CHGSFB CHECKPOINT @V304298 00769000 AL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @V304298 00770000 NI SFBFLAG,X'FF'-SFBINUSE RESET INUSE @VA12597 00770500 BR R6 SAVE IS ON - DON'T CLEAR IT 00771000 FILECLR1 EQU * 00772000 NI SFBFLAG,X'FF'-SFBINUSE RESET INUSE @VA12597 00772050 NI SFBFLAG2,X'FF'-SFBNOHLD RESET NOHOLD FLAG 00773000 TM SFBFLAG,SFBOPEN WAS THE FILE SUCCESSFULLY OPENED ?? 00774000 BCR 8,R6 NO -- EXIT NOW 00775000 L R1,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOCK 00776000 L R2,ARSPRD AND ADDRESS OF READER FILE CHAIN 00777000 FILECLR2 L R3,0(,R2) POINTER TO NEXT FILE BLOCK 00778000 CR R1,R3 HAVE WE FOUND THE BLOCK? 00779000 BE UNCHAIN YES -- UNCHAIN IT 00780000 LR R2,R3 SAVE ADDRESS OF PREVIOUS BLOCK 00781000 B FILECLR2 AND KEEP LOOKING 00782000 UNCHAIN MVC 0(4,R2),0(R3) UNCHAIN THE BLOCK 00783000 XC VSPSFBLK(4),VSPSFBLK CLEAR SFBLOK ADDRESS 00784000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00785000 CALL DMKSPLDL AND CALL THE FILE DELETER 00786000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00787000 SR R7,R7 CLEAR SFBLOK ADDRESS 00788000 BR R6 RETURN TO CALLER 00789000 SPACE 2 00790000 DVICECLR EQU * HERE TO CLEAR THE DEVICE BLOCK 00791000 L R9,VDEVSPL ADDRESS VSPLCTL 00792000 LTR R9,R9 ACTIVE BLOK ?? 00793000 BCR 8,R6 NO - 00794000 L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 00795000 LTR R1,R1 VIRTUAL BUFFER ADDRESS PRESENT ?? 00796000 BZ CLRBUFBK NO - 00797000 SR R0,R0 DUMMY DASD ADDRESS 00798000 SPACE 00799000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00800000 CALL DMKRPAGT,PARM=SYSTEM TO RELEASE STORAGE PAGE 00801000 CALL DMKPGTVR RELEASE THE VIRTUAL BUFFER ADDRESS 00802000 XC VSPVPAGE(4),VSPVPAGE CLEAR VIRTUAL PAGE POINTER 00803000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00804000 SPACE 00805000 CLRBUFBK L R1,VSPBUFBK ADDRESS OF WORK BUFFER 00806000 LTR R1,R1 BUFFER BLOCK PRESENT ?? 00807000 BZ CLRCTL NO - 00808000 LA R0,VSPBUFSZ NUMBER OF DOUBLE WORDS 00809000 CALL DMKFRET RELEASE THE WORK BUFFER 00810000 SPACE 00811000 CLRCTL EQU * 00812000 SPACE 00813000 L R1,VDEVSPL ADDRESS OF VSPLCTL 00814000 SR R9,R9 00815000 LTR R1,R1 ADDRESS VALID ?? 00816000 BCR 8,R6 NO - RETURN 00817000 LA R0,VSPSIZE SIZE IN DOUBLE WORDS 00818000 CALL DMKFRET FRET THE BLOCK 00819000 XC VDEVSPL,VDEVSPL CLEAR THE POINTER 00820000 NI VDEVSFLG,X'FF'-VDEVDIAG RESET DIAG FLAG FOR DUMP 00821000 BR R6 AND RETURN TO CALLER 00822000 EJECT 00823000 *. 00824000 * 00825000 * SPOOLED PRINTER AND PUNCH PROCESSING - 00826000 * 00827000 * 1. VERIFY VALIDITY OF CCW OP-CODE, AND SET UP INITIAL CSW 00828000 * STATUS 00829000 * 00830000 * 2. DETERMINE WHETHER CCW WILL TRANSFER DATA OR IS AN IMMEDIATE 00831000 * CONTROL COMMAND; FOR CONTROL COMMANDS, GO TO STEP4; OTHER- 00832000 * WISE, CONTINUE 00833000 * 00834000 * 3. FOR DATA MOVING CCW, MOVE DATA AND CCW TO WORK BUFFER, 00835000 * TRUNCATE ALL RIGHT JUSTIFIED BLANKS AND LOCATE 00836000 * SPACE IN A PAGED SPOOL BUFFER AND MOVE THE CCW AND 00837000 * DATA FROM THE WORK BUFFER TO THE SPOOL BUFFER, THEN GO 00838000 * STEP 5. 00839000 * 00840000 * 4. FOR CONTROL COMMANDS, INSERT ONLY THE CONTROL CCW INTO THE 00841000 * BUFFER, UNLESS IT IS A UCS COMMAND; IN THIS CASE, IGNORE 00842000 * THE COMMAND AND CONTINUE 00843000 * 00844000 * 5. AFTER PROCESSING THE CCW, TEST FOR ANY ERROR CONDITIONS; 00845000 * IF THERE ARE ANY, TERMINATE THE CHANNEL PROGRAM AND EXIT 00846000 * AFTER POSTING THE APPROPRIATE ERROR STATUS; OTHERWISE 00847000 * CONTINUE WITH THE NEXT CCW IN THE CHANNEL PROGRAM (IF THERE 00848000 * IS ONE) 00849000 * 00850000 * 6. AFTER THE LAST CCW IS PROCESSED, EXIT AFTER POSTING THE 00851000 * PROPER ENDING STATUS 00852000 * 00853000 *. 00854000 SPACE 2 00855000 PRINTER EQU * HERE TO PROCESS A SIO TO A SPOOLED PRINTER 00856000 PUNCH EQU * OR PUNCH -- 00857000 SPACE 00858000 MVI VDEVCSW+4,X'00' CLEAR STSTUS FOR NEW COMMAND @VA09566 00859100 NI VDEVCSW+5,PCI LEAVING PCI INTACT @VA09566 00859200 CLI VSPCCW,4 IS IT A SENSE COMMAND ?? 00860000 BE SENSE YES -- 00861000 XC VDEVSNSE(4),VDEVSNSE CLEAR SENSE INFORMATION 00862000 TM VSPCCW,X'0F' PROGRAM CHECK CONDITION ?? 00863000 BZ PRTEOFU2 YES -- SET PROGRAM CHECK 00864000 TM VDEVSTAT,VDEVNRDY DEVICE READY ?? 00865000 BO NOTREADY NO - 00866000 CLC SFBSTART(4),ZEROES DASD ADDRESS AVAILABLE ?? 00867000 BNE DASDOK YES -- GO 00868000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00869000 CALL DMKPGTSG GET A DASD ADDRESS 00870000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00871000 LTR R1,R1 ANY DASD SPACE LEFT ?? 00872000 BNZ SETDASD YES -- SET UP ADDRESSES 00873000 BAL R6,PRTPUR NO -- CLEAR DEVICE 00874000 B MSG427I GIVE ERROR MSG DMKVSP427I 00875000 SETDASD ST R1,SFBSTART SAVE DASD ADDRESS 00876000 ST R1,SFBLAST IN SFBLOK AND 00877000 ST R1,VSPDPAGE CONTROL BLOK 00878000 DASDOK CLI VSPCCW,3 IS IT A NO - OP ?? 00879000 BNE TSTCMD NO -- TEST FOR VALID COMMAND 00880000 SPACE 00881100 * THE FOLLOWING CHECK WILL ALLOW A NOP CCW TO BE TREATED AS 00881200 * A DATA MOVER. THIS UPDATE WILL CAUSE NOP COMMANDS WITH 00881300 * COUNTS GREATER THAN ONE WHICH ARE EXECUTED ON (SPOOL) 00881400 * SIMULATED UNIT RECORD OUTPUT DEVICES TO BE ENTERED INTO THE 00881500 * SPOOL OUTPUT FILE WITH THEIR DATA BUFFERS, BUT WILL NOT 00881600 * AFFECT THE I/0 INTERFACE PRESENTED TO THE VIRTUAL MACHINE 00881700 * PROGRAM (E.I. NOP COMMANDS WILL CONTINUE TO APPEAR AS 00881800 * IMMEDIATE NON-DATA MOVER COMMANDS). THE CODE WITHIN THIS 00881900 * MODULE RELATING TO THIS UPDATE CAN BE RECOGNIZED BY THE 00882000 * FOLLOWING SNDCODE @V63A4B5. THE NOP DATA MOVERS CAN ONLY 00883100 * BE READ WHEN USING THE DIAGNOSE 14 INTERFACE TO MANIPULATE 00883200 * THE INPUT SPOOL FILES. 00883300 CLC VSPCCW+6(2),F1+2 IS COUNT GREATER THAN 1? @V60A4B5 00883400 BH CCWOK YES -> TREAT AS A DATA MVR @V60A4B5 00883500 B FLAGTEST OTHERWISE, DO NEXT CCW OR END @V60A4B5 00883600 SPACE 00884000 TSTCMD TM VDEVTYPE,TYPPUN IS IT A PUNCH ?? 00885000 BO CKPUNCCW YES -- VALIDATE PUNCH COMMANDS 00886000 LA R15,CCWCNT NUMBER OF VALID PRINTER CCW OP-CODES 00887000 LA R14,CCWEND POINT TO END OF VALID CODE LIST 00888000 IC R1,VSPCCW GET CCW OP CODE 00889000 CLILP EX R1,CLICCW VALID OP-CODE ?? 00890000 BNE OPNEXT NO -- CHECK NEXT 00891000 TM VSPCCW,X'03' CONTROL TYPE OP CODE ?? 00892000 BO PRTCNTRL YES -- 00893000 B CCWOK DATA TYPE CCW OP-CODE COMMAND 00894000 CLICCW CLI 0(R14),0 EXECUTED COMPARE 00895000 OPNEXT BCTR R14,0 -1 CCW OP CODE LIST 00896000 BCT R15,CLILP BRANCH IF NOT END OF LIST 00897000 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 00898000 BNO REGPRT NO--1403 @V386298 00899000 USING VFCBBLOK,R13 @VA00716 00900000 L R13,VDEVFCBK ADDRESS OF FORMS CONTROL BLOK @VA00716 00901000 CLI VSPCCW,X'63' FORMS CONTROL OP-CODE ? @VA00716 00902000 BE CCWOK YES -- PROCESS @VA00716 00903000 CLI VSPCCW,X'07' DIAG GATE COMMAND ? @VA00716 00904000 BE CMD07 YES -- @VA00716 00905000 CLI VSPCCW,X'12' READ FCB COMMAND ? @VA00716 00906000 BE CCWOK YES -- @VA00716 00907000 TM VFCBFLAG,VFCBDIAG DIAG GATE ACTIVE ? @VA00716 00908000 BZ PRT3211 NO -- CONT @VA00716 00909000 CLI VSPCCW,X'06' CHECK READ BUFFER COMMAND ? @VA00716 00910000 BE CCWOK YES - SET WORK BUFFER ADDRESS @VA00716 00911000 VFCBDIAG EQU X'01' DIAG OP-CODE X'07' PROCESSED @VA00716 00912000 PRT3211 NI VFCBFLAG,X'FF'-VFCBDIAG RESET CMD 07 PROCESSING @VA00716 00913000 LA R15,LEN3211 COUNT OF NOP TYPE CCW OP-CODES 00914000 CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 00914100 BNE CLILP2 NO--MAKE 3211 OPCODE @V386298 00914200 * COMPARE 00914300 BCTR 15,0 DECREMENT CMD CODE TABLE @V386298 00914400 * BY 1 FOR 3203 CMD CODE 00914500 * TABLE 00914600 CLILP2 EX R1,CLICCW OP-CODE COMPARE ? 00915000 BE FORCE3 YES -- TREAT AS NOP 00916000 BCTR R14,0 CCW LIST ADDRESS -1 00917000 BCT R15,CLILP2 BRANCH IF NOT END OF LIST 00918000 B PRTEOFU INVALID OP-CODE - FORCE EOF 00919000 REGPRT LA R14,REGEND END OF FORCE3 TYPE OP-CODES 00920000 LA R15,REGCNT LENGTH OF LIST 00921000 CLILP3 EX R1,CLICCW OP-CODE COMPARE ? 00922000 BE FORCE3 YES -- TREAT AS NOP 00923000 BCTR R14,0 LIST ADDRESS -1 00924000 BCT R15,CLILP3 BRANCH IF NOT END OF LIST 00925000 B PRTEOFU INVALID OP-CODE - FORCE EOF 00926000 SPACE 00927000 CMD07 EQU * HERE IF PROCESSING DIAG CMD FOR @VA00716 00928000 * 3211 OR 3203 00929000 OI VFCBFLAG,VFCBDIAG INDICATE CMD07 PROCESSING @VA00716 00930000 B FORCE3 AND TREAT AS NOP @VA00716 00931000 SPACE 00932000 CMD06 EQU * HERE TO CONVERT FCB BUFFER @VA00716 00933000 * COUNTER TO HARDWARE 00934000 * FCB ADDRESS REGISTER VALUE 00935000 MVI 0(R3),X'00' CLEAR BYTE FOR NEW HARDWARE VALUE @VA00716 00936000 LH R0,VFCBCNT GET CURRENT LINE COUNT @VA00716 00937000 AL R0,F1 ADJUST COUNTER TO HARDWARE VALUE @VA00716 00938000 STC R0,1(R3) SAVE IN WORK BYTE @VA00716 00939000 LA R14,1 TM MASK (BINARY COUNTER) @VA00716 00940000 LA R15,128 OI MASK (HARDWARE COUNTER) @VA00716 00941000 * BIT 0=1, 1=2, 2=4, 3=8, 4=16, 5=32, 6=64, 7=128 00942000 LA R6,8 LOOP COUNT @VA00716 00943000 CMD06LP EX R14,TMCNT BIT PRESENT ?? @VA00716 00944000 BZ *+8 NO -- @VA00716 00945000 EX R15,OICNT CONVERT TO HARDWARE VALUE @VA00716 00946000 SLL R14,1 SHIFT BINARY MASK @VA00716 00947000 SRL R15,1 SHIFT HARDWARE MASK @VA00716 00948000 BCT R6,CMD06LP AND TEST NEXT BIT @VA00716 00949000 MVC 1(179,R3),0(R3) FILL BUFFER WITH HARDWARE VALUE @VA00716 00950000 LA R5,150 SET MAX BUFFER SIZE @VA00716 00951000 B CMD0612 NOW MOVE DATA @VA00716 00952000 TMCNT TM 1(R3),0 EXECUTED TM INSTRUCTION @VA00716 00953000 OICNT OI 0(R3),0 EXECUTED OI INSTRUCTION @VA00716 00954000 MOVEFCB MVC 0(*-*,R2),0(R3) MOVE DATA FROM BUFFER TO USER @VA00716 00955000 * AREA 00956000 SPACE 00957000 CMD12 EQU * HERE ON FCB READ COMMAND @VA00716 00958000 MVC 0(180,R3),VFCBLOAD MOVE FCB DATA TO BUFFER @VA00716 00959000 LA R5,180 SET MAX BUFFER SIZE @VA00716 00960000 CMD0612 EQU * HERE TO MOVE BUFFER DATA TO @VA00716 00961000 * USER AREA 00962000 LA R0,MOVEFCB ADDRESS OF MOVE INSTRUCTION @VA00716 00963000 BAL R6,MOVEDATA MOVE DATA TO USER @VA00716 00964000 B SETDE SET DEVICE END AND CHECK FOR @VA00716 00965000 * CC,IDA 00966000 SPACE 00967000 FORCE3 TM VSPCCW+4,CD IS CCW DATA CHAINING? @VA12613 00968000 BZ FORCE3A NO - NO FLAG NECESSARY @VA12613 00968200 OI VSPFLAG1,VSPDCFOP FLAG CD CCW FORCED TO '03' @VA12613 00968400 FORCE3A MVI VSPCCW,X'03' FORCE '03'OP CODE @VA00716 00968600 B SETDE GO SET UP DEVICE END STATUS @VA00716 00969000 SPACE 00970000 REGBEG DC X'EBFBF3737B' 00971000 REGEND EQU *-1 00972000 REGCNT EQU *-REGBEG 00973000 BEG3211 DC X'83FB4323737B020A066B0E' @VA00716 00974000 END3211 EQU *-1 00975000 LEN3211 EQU *-BEG3211 00976000 CCWBEG DC X'E3E1DBD9D3D1CBC9C3C1BBB9B3B1ABA9A3A19B9993' 00977000 DC X'918B8919111B130B0901' 00978000 CCWEND EQU *-1 00979000 CCWCNT EQU *-CCWBEG 00980000 DS 0H 00981000 EJECT 00982000 SPACE 00983000 CKPUNCCW EQU * HERE TO VALIDATE PUNCH CCW 00984000 TM VSPCCW,1 WRITE CCW ? 00985000 BZ PRTEOFU NO -- ILLEGAL COMMAND 00986000 TM VSPCCW,4 ALWAYS ILLEGAL 00987000 BO PRTEOFU ASSUME USER IS FORCING EOF 00988000 TM VSPCCW,X'18' THESE BITS INVALID FOR PUNCH 00989000 BNZ PRTEOFU FORCE END OF FILE 00990000 TM VSPCCW,X'C0' BOTH BITS MAY NOT BE ON -- 00991000 BO PRTEOFU IF BOTH ON, ILLEGAL COMMAND 00992000 TM VSPCCW,X'03' PUNCH BLANK CARD ? 00993000 BO PRTEOFU ILLEGAL PUNCH COMMAND @VA05105 00994100 SPACE 3 00998000 * 00999000 * CCW IS WRITE -- START TO TRANSFER DATA 01000000 * 01001000 SPACE 01002000 CCWOK EQU * HERE TO MOVE USER'S DATA 01003000 L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01004000 LA R3,12(R3) ADJUST PASS CCW AND TIC 01005000 LH R5,SFBRECSZ DEVICE LOGICAL RECORD SIZE 01006000 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 01007000 BNO PRTCD NO-- @V386298 01008000 L R13,VDEVFCBK LOAD ADDRESS OF FCB BLOK @VA00716 01009000 NI VFCBFLAG,X'FF'-VFCBDIAG RESET DIAG FLAG @VA00716 01010000 CLI VSPCCW,X'06' CHECK READ CMD (3211/3203) @V386298 01011000 BE CMD06 YES -- @VA00716 01012000 CLI VSPCCW,X'12' READ FCB CMD (3211/3203) @V386298 01013000 BE CMD12 YES -- @VA00716 01014000 DROP R13 @VA00716 01015000 CLI VSPCCW,X'63' FORMS CONTROL COMMAND ?? 01016000 BNE PRTCD NO - 01017000 *********************************************************************** 01017100 *** THE NEXT THREE COMMANDS WILL ENSURE THAT THE SILI BIT IS ON IF *** 01017200 *** THE PRINTER IS A 3203. THIS WILL PREVENT INCORRECT LENGTH FROM *** 01017300 *** BEING REFLECTED. *** 01017400 *********************************************************************** 01017500 TM VDEVTYPE,TYP3203 @V60A6B6 01017600 BNO MOD3211 @V60A6B6 01017700 OI VSPCCW+4,SILI @V60A6B6 01017800 MOD3211 EQU * @V60A6B6 01017900 LA R5,181 MAX RECORD LENGTH FOR FCB 01018000 SPACE 01019000 PRTCD TM VSPFLAG1,VSPDCFOP WAS CD CCW FORCED TO '03'? @VA12613 01020000 BZ PRTCD1 NO - REG3 & REG5 INITIALIZED @VA12613 01020100 L R3,VSPBUFBK WE DIDN'T COME THRU CCWOK, SO @VA12613 01020200 LA R3,12(R3) ..INITIALIZE REG 3 AND REG5 @VA12613 01020300 LH R5,SFBRECSZ ...NOW @VA12613 01020400 NI VSPFLAG1,255-VSPDCFOP RESET FLAG @VA12613 01020500 PRTCD1 CLI VSPCCW,X'06' CK RD CMD ( 3211-TYPE PRNTR ) @V6CD1F1 01020600 BE CMD0612 YES - @VA00716 01021000 CLI VSPCCW,X'12' FCB READ CMD (3211/3203) ? @V386298 01022000 BE CMD0612 YES -- @VA00716 01023000 LA R0,MOVEPRT ADDRESS OF MOVE INSTRUCTION TO @VA00716 01024000 * MOVE 01025000 * USER DATA TO WORK BUFFER 01026000 TEST63 CLI VSPCCW,X'63' FORMS CONTROL CMD (3211/3203) ? @V386298 01035000 BE DATAMOVE YES -- @V60A4B5 01036000 CLI VSPCCW,X'03' IS IT A NO-OP? @V60A4B5 01036100 BE DATAMOVE YES -> MUST HAVE DATA @V60A4B5 01036200 TM VSPCCW,3 NOP-CODE OR COMMAND IMMEDIATE ?? 01037000 BO FLAGTEST YES -- NO DATA MOVE 01038000 DATAMOVE EQU * @V60A4B5 01038100 BAL R6,MOVEDATA GET USER'S DATA 01039000 TM VSPCCW+4,CD+IDA ANY CD CHAINING OR IDA ?? 01040000 BNZ FLAGTEST YES - 01041000 OP23 LR R13,R3 SAVE ADDRESS OF DATA END PLUS ONE 01042000 L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01043000 MVC 0(12,R3),MODELCCW MOVE CCW AND TIC 01044000 CLI VSPCCW,X'03' IT IS A NO-OP? @V60A4B5 01044100 BE NOPGO YES -> USE NOP OPCODE IN CCW@V60A4B5 01044200 TM VDEVTYPE,TYPPUN PUNCH ?? 01045000 BO COMPRESS YES - 01046000 NOPGO EQU * @V60A4B5 01046100 MVC 0(1,R3),VSPCCW USE OP-CODE FROM VSPCCW 01047000 SPACE 01048000 CLI VDEVTYPE,TYP3211 3211 PRINTER ?? 01049000 BNE COMPRESS NO -- 01050000 CLI VSPCCW,X'63' FORM CONTROL OP-CODE ?? 01051000 BE COMPRESS YES -- NO NEED TO INDEX 01052000 USING VFCBBLOK,R14 01053000 L R14,VDEVFCBK ADDRESS OF VFCBBLOK 01054000 SR R5,R5 .. 01055000 NI VFCBNDEX,X'1F' TURN OFF INDEX FLAG 01056000 ICM R5,B'0001',VFCBNDEX GET INDEX COUNT, IF ANY 01057000 BZ COMPRESS NO INDEXING -- 01058000 LR R15,R13 ADDRESS OF DATA END +1 01059000 LA R13,12(R3) START OF DATA 01060000 SR R15,R13 LENGTH OF DATA 01061000 BCTR R15,0 .. 01062000 L R6,WRKADD ADDRESS OF INDEX WORK AREA 01063000 MVI 0(R6),X'40' CLEAR IT 01064000 MVC 1(183,R6),0(R6) .. 01065000 BCTR R5,0 INDEX -1 01066000 AR R6,R5 ADJUST ADDRESS TO OFFSET OF INDEX 01067000 EX R15,MINDEX MOVE DATA TO WORK AREA OFFSET 01068000 SR R6,R5 RESET WORK AREA ADDRESS TO START 01069000 LH R5,SFBRECSZ GET DEVICE LOGICAL RECORD SIZE 01070000 AR R13,R5 SET DATA END ADDRESS PLUS ONE 01071000 BCTR R5,0 -1 FOR MOVE OF NEW RECORD 01072000 EX R5,RINDEX MOVE OFFSETTED DATA BACK TO BUFFER 01073000 DROP R14 01074000 SPACE 01075000 * TRUNCATE ALL RIGHT JUSTIFIED BLANKS 01076000 SPACE 01077000 SPACE 01078000 COMPRESS LA R5,12(R3) ADDRESS OF FIRST DATA BYTE 01079000 NEXTCOL BCTR R13,R0 MINUS ONE COL 01080000 CR R5,R13 ZERO LENGTH RECORD OR BLANK RECORD 01081000 BE CNT1 YES SET UP FOR 8 BYTE DATA 01082000 CLI 0(R13),X'40' BLANK ?? 01083000 BE NEXTCOL YES KEEP CHECKING 01084000 CNT1 SR R13,R5 NEW DATA BYTE COUNT FOR CCW 01085000 LA R13,1(R13) CORRECT COUNT BY ADDING ONE 01086000 FILLCCW STH R13,6(R3) STORE NEW DATA COUNT IN CCW 01087000 LA R13,19(R13) ADD CCW LENGTH PLUS 7 FOR ROUND 01088000 TM VDEVTYPE,TYPPUN DEVICE PUNCH ?? 01089000 BZ *+8 NO - 01090000 LA R13,4(R13) ADD 4 BYTES FOR BACKCHAIN ADDRESS 01091000 N R13,=A(X'FFFFF8') ROUNDING TO DOUBLE WORD 01092000 STH R13,10(R3) FILL IN TIC CCW RELATIVE ADDRESS 01093000 * TO NEXT CCW 01094000 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER ??@V386298 01095000 BNO PUTDATA NO--1403 @V386298 01096000 CLI VSPCCW,X'63' FORMS CONTROL COMMAND 01097000 BNE PUTDATA NO --CONTINUAL 01098000 L R15,VSPBUFBK ADDRESS OF WORK BUFFER 01099000 USING VFCBBLOK,R6 @VA01095 01100000 L R6,VDEVFCBK ADDRESS OF VFCB BLOK @VA01095 01101000 LR R14,R6 SET UP MOVE REGISTER @VA01095 01102000 XC 0(VFCBSIZE*8,R14),0(R14) CLEAR TO BINARY ZEROES 01103000 LH R13,6(R3) GET DATA COUNT 01104000 BCTR R13,0 -1 FOR MOVE 01105000 TM 12(R15),X'80' FIRST BYTE INDEX ?? 01106000 BZ *+6 NO -- 01107000 BCTR R14,0 SET MOVE TO ADDRESS TO VFCBNDEX 01108000 EX R13,FCBMOVE MOVE DATA TO VFCBLOK 01109000 B VALIDATE VALIDATE FCB DATA @VA01095 01110000 SPACE 01111000 PUTDATA LR R3,R13 R3 CONTAINS LENGTH OF BUFFER 01112000 CALL DMKVSQPD GO OBTAIN NEEDED BUFFER SPACE @V60BCAA 01113000 B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01113100 * ERROR MESSAGE 01113200 * IF NO ERROR OCCURRED, WILL FALL THRU 01113300 SPACE 2 01114000 * 01115000 * WRITE HAS BEEN SIMULATED 01116000 * 01117000 B CMD3211 PROCESS 3211/3203 CMDS @V386298 01118000 SPACE 2 01119000 PRTCNTRL EQU * HERE FOR CONTROL COMMANDS 01120000 L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01121000 MVC 1(7,R3),MODELCCW+1 GET MODEL CCW (CC+SILI) 01122000 MVC 0(1,R3),VSPCCW GET CONTROL OP-CODE 01123000 OI 4(R3),SKIP INDICATE NO DATA @V293598 01124000 LA R3,8 NEED ONLY 8 BYTES FOR CCW 01125000 CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01126000 B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01126100 * ERROR MESSAGE. 01126200 * IF NO ERROR OCCURRED, WILL FALL THROUGH 01126300 SPACE 01127000 TM VSPCCW+4,IDA IDA ???? 01128000 BZ CMD3211 NO -- 01129000 MVC VSPCCW+6(2),VSPIDACT RESTORE CCW COUNT 01130000 NI VSPCCW+4,X'FF'-(CD+IDA) RESET CD AND IDA FLAGS 01131000 OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 01132000 SPACE 2 01133000 CMD3211 EQU * PROCESS 3211/3203 CMDS @V386298 01134000 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER ??@V386298 01135000 BNO FLAGTEST NO--1403 @V386298 01136000 L R6,VDEVFCBK RELOAD BASE 01137000 NI VFCBFLAG,X'FF'-VFCBDIAG RESET CMD 07 FLAG @VA00716 01138000 NI VFCBFLAG,X'FF'-VFCBEOF TURN OFF EOF FLAG FORM CONTROL 01139000 SPACE 01140000 SR R4,R4 CLEAR REG 01141000 IC R4,VSPCCW CCW COMMAND 01142000 SRL R4,3 SHIFT RIGHT 3 POSITIONS 01143000 N R4,=X'0000000F' ONLY COUNT OR CHANNEL NUMBER 01144000 LTR R4,R4 ZERO SPACE REQUIRED ?? 01145000 BZ FLAGTEST YES -- 01146000 STC R4,VFCBCHL STORE SPACE CNT OR CHANNEL NUMBER 01147000 TESTLOOP LH R15,VFCBCNT GET LINE COUNT 01148000 LA R14,VFCBLOAD(R15) POINT TO CURRENT BUFFER COL 01149000 A R15,F1 UPDATE TO NEXT LINE 01150000 STH R15,VFCBCNT AND SAVE 01151000 BCTR R15,0 RESTORE CURRENT LINE COUNT 01152000 TM VSPCCW,X'80' SKIP COMMAND ?? 01153000 BO SKIP3211 YES -- 01154000 * 01155000 * PROCESSING SPACE COMMAND 01156000 * 01157000 LTR R15,R15 FIRST POSITION ?? 01158000 BZ SPACE1 BYPASS EOF TEST 01159000 TM 0(R14),X'10' END OF FORMS FLAG ON ?? 01160000 BZ SPACE1 NO -- 01161000 MVI VFCBCNT+1,X'00' RESET LINE POINTER TO ONE 01162000 CLI 0(R14),X'19' CHANNEL 9 WITH END OF FORMS ? 01163000 BE CHL9 YES -- 01164000 CLI 0(R14),X'1C' CHANNEL 12 WITH END OF FORMS ?? 01165000 BE CHL12 YES -- 01166000 B ZEROTEST TEST FOR ANY MORE SPACES 01167000 SPACE 01168000 SPACE1 CLI 0(R14),X'09' CHANNEL 9 ?? 01169000 BE CHL9 YES - 01170000 CLI 0(R14),X'0C' CHANNEL 12 ?? 01171000 BE CHL12 YES -- 01172000 ZEROTEST BCT R4,TESTLOOP -1 SPACE AND COUNTING 01173000 B FLAGTEST TEST FOR CHAINING 01174000 SPACE 01175000 CHL9 OI VDEVINTS,UC SET UNIT CHECK FOR DEVICE END TIME 01176000 OI VDEVSNSE,X'01' SET CHANNEL 9 SENSE BIT 01177000 TM VSPCCW+4,CC COMMAND CHAINING ? 01178000 BZ ENDCCW1 NO -- 01179000 B ENDCCW2 BREAK CHAINING AND LEAVE 01180000 SPACE 01181000 CHL12 OI VDEVINTS,UE SET UNIT EXCEPTION FOR DEVICE END 01182000 * TIME 01183000 TM VSPCCW+4,CC COMMAND CHAINING ? 01184000 BZ ENDCCW1 NO -- 01185000 TM VDEVFLAG,VDEVCCW1 STILL ON FIRST CCW @VA11708 01185300 BO ENDCCW1 YES- LEAVE UE FOR INTERRUPT @VA11708 01185600 * AFTER INITIAL STATUS (CE) @VA11708 01185900 OI VDEVCSW+4,UE SET UNIT EXCEPTION 01186000 B ENDCCW AND LEAVE NOW 01187000 SPACE 01188000 SKIP3211 EQU * PROCESS SKIP COMMANDS 01189000 SPACE 01190000 LTR R15,R15 FIRST POSITION ?? 01191000 BZ COMP YES - DO NOT TEST BIT 3 01192000 TM 0(R14),X'10' END OF FORMS FLAG ?? 01193000 BZ COMP NO DO COMPARE 01194000 MVI VFCBCNT+1,X'00' RESET COUNTER TO LINE ONE 01195000 TM VFCBFLAG,VFCBEOF END OF FORMS PASSED ONCE ?? 01196000 BO EOFERR YES ??? (CARRIAGE RUNAWAY) 01197000 OI VFCBFLAG,VFCBEOF TURN ON EOF BIT FLAG 01198000 SPACE 01199000 COMP EQU * R14 CONTAINS ADDRESS OF CURRENT LINE 01200000 CLC VFCBCHL(1),0(R14) CHANNEL EQUAL ?? 01201000 BE FLAGTEST YES SKIP COMPLETE 01202000 OI VFCBCHL,X'10' SET 3 BIT FOR COMPARE 01203000 CLC VFCBCHL(1),0(R14) COMPARE FOR CHANNEL WITH BIT 3 ON 01204000 BE FLAGTEST EQUAL COMPARE 01205000 NI VFCBCHL,X'0F' RESET UNWANTED BITS 01206000 B TESTLOOP NO CHECK NEXT COL 01207000 SPACE 01208000 EOFERR OI VDEVINTS,UC SET UNIT CHECK 01209000 OI VDEVSNSE,DATACHK SET DATA CHECK 01210000 OI VDEVSNSE+1,X'10' SET CARRIAGE COMPARE ERROR 01211000 TM VSPCCW+4,CC COMMAND CHAINING ? 01212000 BZ ENDCCW1 NO -- 01213000 B ENDCCW2 BREAK CHAINING AND LEAVE 01214000 SPACE 01215000 VALIDATE EQU * VALIDATE BUFFER INFORMATION 01216000 SR R1,R1 GET INDEX VALUE 01217000 ICM R1,B'0001',VFCBNDEX INDEX PRESENT ? 01218000 BZ VALID1 NO -- CONT 01219000 SL R1,=F'128' REMOVE INDEX FLAG 01220000 BC 6,LOADCK COUNT NOT POSITIVE 01221000 C R1,=F'31' GREATER THAN 31 ? 01222000 BH LOADCK YES -- 01223000 BCTR R13,0 COUNT -1 DUE INDEX BYTE 01224000 VALID1 MVI VFCBLOAD+180,X'00' CLEAR BYTE 181 @VA01095 01225000 LA R1,VFCBLOAD ADDRESS OF FIRST DATA BYTE @VA01095 01226000 AR R13,R1 ADDRESS OF LAST DATA BYTE @VA01095 01227000 TM 0(R1),X'10' COL1. 6 OR 8 LINES PER INCH ? @VA01095 01228000 BO CHECK1C YES -- VALIDATE CHANNEL @VA01095 01229000 CLI 0(R1),X'0C' CHANNEL VALUE LARGER THAN 12 ? @VA01095 01230000 BH LOADCK YES -- LOAD CHECK @VA01095 01231000 CHECK1C CLI 0(R1),X'1C' LARGER THAN CHANNEL 12 WITH BIT 3@VA01095 01232000 BNH CKLOOP NO -- CHECK NEXT @VA01095 01233000 LOADCK OI VDEVSNSE,X'02' SET LOAD CHECK @VA01095 01234000 MVI VFCBNDEX,X'00' CLEAR OUT INDEX BYTE @VA01095 01235000 MVI VFCBCNT+1,X'00' RESET LINE COUNTER @VA01095 01236000 B ENDCCW2 BREAK CHAINING AND LEAVE @VA01095 01237000 SPACE 01238000 CKLOOP LA R1,1(,R1) UPDATE VFCBLOAD ADDRESS @VA01095 01239000 CLR R1,R13 IS THIS THE LAST BYTE OF BUFFER ?@VA01095 01240000 BH LOADCK YES - EOF MISSING LOAD CHECK @VA01095 01241000 TM 0(R1),X'10' END OF FORMS BIT ? @VA01095 01242000 BO CHECKEOF YES -- @VA01095 01243000 CLI 0(R1),X'0C' GREATER THAN CHANNEL 12 ? @VA01095 01244000 BH LOADCK YES - LOAD CHECK @VA01095 01245000 B CKLOOP CHECK NEXT BYTE IN BUFFER @VA01095 01246000 SPACE 01247000 CHECKEOF CLI 0(R1),X'1C' VALID CHANNEL VALUE ? @VA01095 01248000 BH LOADCK NO - LOAD CHECK @VA01095 01249000 SLR R13,R1 CALULATE RESIDUAL COUNT @VA01095 01250000 AH R13,VDEVCSW+6 ADD PRESENT RESIDUAL COUNT @VA01095 01251000 STH R13,VDEVCSW+6 AND STORE IN CSW @VA01095 01252000 MVI VFCBCNT+1,X'01' SET COUNTER TO ONE @VA01095 01253000 SETDE OI VDEVCSW+4,DE SET DEVICE END FOR THIS COMMAND 01254000 SPACE 01255000 FLAGTEST EQU * HERE TO FINISH UP WITH CCW 01256000 OI VDEVCSW+4,CE SET CHANNEL END FOR EVERYONE 01257000 CLI VSPCCW,X'03' IS IT A NOP COMMAND? @V60A4B5 01257100 BNE NOTIMMED NOPE - DON'T FORCE IMMED END@V60A4B5 01257200 MVI VDEVCSW+5,X'00' CLEAR POSSIBLE IL @V60A4B5 01257300 TM VSPCCW+4,CC+CD ANY CHAINING SPECIFIED? @V60A4B5 01257400 BNZ NOTIMMED NO IMMED END IF SO @V60A4B5 01257500 OI VDEVCSW+4,DE SET DE TO CAUSE IMMED END @V60A4B5 01257600 NOTIMMED EQU * @V60A4B5 01257700 BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 01258000 TM VDEVCSW+5,IL INCORRECT LENGTH ?? 01259000 BO LASTCCW YES - FINISHED CHANNEL PROGRAM 01260000 TM VSPCCW+4,CD+CC+IDA IS ANY CHAINING OR IDA ?? 01261000 BZ LASTCCW NO -- FINISHED WITH CHANNEL PROGRAM 01262000 NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 01263000 BAL R6,GETCCW GO LOCATE AND VERIFY NEXT NON-TIC 01264000 * CCW 01265000 B PRINTER RETURN HERE IF USER IS COMMAND 01266000 * CHAINING 01267000 B PRTCD OR HERE IF HE IS DATA CHAINING 01268000 SPACE 2 01269000 MOVEPRT MVC 0(*-*,R3),0(R2) EXECUTED TO MOVE DATA 01270000 * FROM USER TO BUFFER 01271000 MINDEX MVC 0(0,R6),12(R3) MOVE DATA TO WORK AREA OFFSET 01272000 RINDEX MVC 12(0,R3),0(R6) MOVE OFFSET DATA TO BUFFER 01273000 SPACE 01274000 SPACE 01275000 EJECT 01276000 *. 01277000 * 01278000 * SPOOLED PRINTER AND PUNCH END OF FILE PROCESSING - 01279000 * 01280000 * 1. CLOSE REQUEST ISSUED VIA CLOSE OR SPOOL COMMANDS: 01281000 * (A) IF THE DEVICE IS CP BUSY (VDEVSVC=1); BRANCH TO 01282000 * STKCPBLK ROUTINE TO BUILD AND STACK CPEXBLOK 01283000 * ON VSPSTK ANCHOR TO DELAY THE REQUEST, AND GO TO 01284000 * DISPATCHER (DMKDSPCH). 01285000 * ENTRY POINT FOR CPEXBLOK IS LABEL RDRCLRET 01286000 * (B) IF THE DEVICE IS BUSY (SIO-VDEVBUSY=1); 01287000 * SET DEFFERED CLOSE REQUEST FLAG AND EXIT TO 01288000 * THE CALLER. 01289000 * (C) IF THE DEVICE IS NOT BUSY OR CP BUSY OR 01290000 * ENTRY VIA THE STACKED CPEXBLOK; CONTINUE 01291000 * 01292000 * 2. VERIFY THAT THE FILE TO BE CLOSED IS NOT EMPTY AND WRITE 01293000 * THE FINAL PAGE BUFFER TO DASD. THEN CALL DMKSPLCV TO 01294000 * COMPLETE HOUSEKEEPING AND QUEUE THE FILE FOR FURTHER PRO- 01295000 * CESSING EITHER ON THE REAL SPOOLING HARDWARE OF, IF XFERED, 01296000 * QUEUE IT AS A VIRTUAL INPUT READER FILE 01297000 * 01298000 * 3. IF THE END OF FILE HAS BEEN FORCED VIA AN ILLEGAL CCW OP- 01299000 * CODE, POST COMMAND REJECCT AND EXIT. 01300000 * 01301000 * 4. BEFORE THE EXIT IS MADE TO THE CALLER, A BAL TO 01302000 * UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK,IF ANY 01303000 * FOR THIS DEVICE. 01304000 * 01305000 *. 01306000 SPACE 2 01307000 USING SAVEAREA,R13 01308000 DMKVSPCO RELOC FOR CONSOLE FUNCTIONS 01309000 LR R10,R12 SET UP SECOND BASE REGISTER 01310000 A R10,F4096 .. 01311000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VM01028 01312000 LA R6,OUTRET DELAY CPEX RETURN ADDRESS @VM01028 01313000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01028 01314000 BO DELAYCL YES - DELAY CLOSE @VM01028 01315000 CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? @VM01028 01316000 BE CLPRTPUN YES - SKIP BUSY TEST @VM01028 01317000 TM VDEVSTAT,VDEVBUSY DEVICE BUSY ?? @VM01028 01318000 BO DELAYCL YES - DELAY CLOSE @VM01028 01319000 B CLPRTPUN CLOSE OUTPUT DEVICE @VM01028 01320000 OUTRET AL R8,VMDVSTRT FULL VDEVBLOK ADDRESS @VM01028 01321000 NI VDEVSFLG,X'FF'-VDEVSVC RESET DEVICE CP BUSY @VM01028 01322000 CLPRTPUN ICM R9,B'1111',VDEVSPL ADDRESS OF CONTROL BLOK @VM01028 01323000 BZ VSPCFXIT BRANCH IF NO FILE @VM01028 01324000 NI SAVER2+3,VDEVPURG KEEP ONLY PURGE OPTION @VM01028 01325000 OC VDEVSFLG,SAVER2+3 SET FLAG OPTION @VM01028 01326000 L R7,VSPSFBLK ADDRESS OF SPOOL FILE BLOK @VM01028 01327000 OI VDEVSFLG,VDEVSVC INDICATE DEVICE CP BUSY @VM01028 01328000 LA R6,CLOSERET RETURN ADDRESS @VM01028 01329000 ST R6,SAVEWRK6 SAVE RETURN ADDRESS 01330000 BAL R6,PRTEOF GO CLOSE SPOOL FILE @VM01028 01331000 CLOSERET NI VDEVSFLG,X'FF'-VDEVSVC RESET DEVICE CP BUSY @VM01028 01332000 VSPCFXIT BAL R6,UNSTKBLK GO UNSTACK CPEX BLOK @VM01028 01333000 EXIT - EXIT TO CALLER @VM01028 01334000 SPACE 01335000 DROP R13 01336000 SPACE 3 01337000 PRTEOFU2 EQU * HERE FOR CHANNEL PROGRAM CHECK CONDITION 01338000 LA R6,PROGCHK SET RETURN ADDRESS 01339000 B PRTEOFU1 FORCE CLOSING OF FILE 01340000 SPACE 01341000 PRTEOFU EQU * HERE TO CLOSE COMPLETED SPOOL FILE 01342000 BAL R6,PCITEST CHECK FOR PCI 01343000 MVI VDEVSNSE,CMDREJ MOVE IN COMMAND REJECT 01344000 LA R6,UNITCHK UNITCHECK AND COMMAND REJECT 01345000 PRTEOFU1 TM VDEVSFLG,VDEVCONT CONT OUTPUT ?? @V200930 01346000 BCR 1,R6 YES - DO NOT CLOSE FILE 01347000 MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 01348000 SPACE 01349000 PRTEOF L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 01350000 * PAGE IN LAST BUFFER PAGE 01351000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 01352000 TRANS 2,1,OPT=(BRING,DEFER,SYSTEM),IOER=EMSG429 @VA00716 01353000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 01354000 L R0,SFBRECNO GET TOTAL NUMBER OF RECORDS 01355000 TM SFBFLAG2,SFBFLNMT IS FILE EMPTY ?? @VA04920 01356000 BNO PRTPUR YES THEN PURGE IT. @VA04920 01357000 LA R5,10 RETRY COUNT 01358000 TM VDEVTYPE,TYPPUN PUNCH ?? 01359000 BZ PRTCNT NO - 01360000 AL R0,VMPNCH UPDATE PUNCH CARD COUNT 01361000 ST R0,VMPNCH .. 01362000 B CHAINBUF .. 01363000 PRTCNT AL R0,VMLINS UPDATE LINE COUNT 01364000 ST R0,VMLINS .. 01365000 CHAINBUF L R1,SFBSTART GET START CCPD @VA11232 01366000 L R0,SPPREPAG DETERMINE WHETHER RE-WRITING @VA11232 01366100 LTR R0,R0 FIRST PAGE BECAUSE OF ERROR @VA11232 01366200 BNZ USESTRT NOT FIRST PAGE @VA11232 01366300 C R1,VSPDPAGE ARE WE WRITING IT IN SAME SLOT? @VA11232 01366400 BE USESTRT YES, SFBSTART IS OK @VA11232 01366500 L R1,VSPDPAGE USE CURRENT BUFFER AS START CCPD @VA11232 01366600 ST R1,SFBSTART UPDATE SFBSTART AND SFBLAST @VA11232 01366700 ST R1,SFBLAST BEFORE WRITE @VA11232 01366800 USESTRT ST R1,SPRMISC SAVE NEW START CCPD @VA11232 01366900 ST R0,SFBPNT SFBPNT PTS TO PREV. WHILE WRITE @VA11232 01367000 ST R1,SPNXTPAG CHAIN TAIL OF FILE TO HEAD @VA11232 01367100 LM R0,R1,VSPDPAGE GET BUFFER AND VIRTUAL ADDRESSES 01368000 MVC SPFILID,SFBFILID FILE ID FOR VALIDATING PAGE @V60B9BA 01369000 MVC SPTIME,SFBTIME MORE VALIDATION DATA @V60B9BA 01370000 LR R4,R2 SAVE BUFFER ADDRESS 01371000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01372000 CALL DMKRPAPT,PARM=SYSTEM AND WRITE PAGE TO DASD 01373000 LR R2,R4 RESTORE BUFFER ADDRESS 01374000 LR R3,R0 LAST BUFFER CCPD WRITTEN @VA11232 01375000 BZ TSTPUR NO ERRORS -- 01376000 BCT R5,*+8 RETRY 10 TIMES 01377000 B EMSG429 RETRYED 10 CONSECUTIVE TIMES @VA01460 01378000 OI VSPFLAG1,VSPERR INDICATE BUFFER WRITE ERROR @VA11232 01379000 CALL DMKPGTSG GET NEW DASD BUFFER (CCPD) 01380000 LTR R1,R1 VALID DASD ADDRESS 01381000 BZ EMSG429 NO MORE DASD SPACE -- @VA01460 01382000 * WHILE IN ERROR RECOVERY - 01383000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01384000 ST R1,VSPDPAGE SAVE NEW CCPD 01385000 B CHAINBUF RE-WRITE USING NEW CCPD 01389000 SPACE 01390000 TSTPUR AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01391000 TM VSPFLAG1,VSPERR BUFFER WRITE ERROR ? @VA11232 01392000 BO TSTERR YES -- 01393000 ST R3,SFBLAST UPD. SFBLAST IF SUCCESSFUL WRITE @VA11232 01393100 TM VDEVSFLG,VDEVPURG WAS PURGE REQUESTED ?? 01394000 BO PRTPUR YES -- 01395000 B SETOPTS NO -- CLOSE FILE 01396000 TSTERR NI VSPFLAG1,X'FF'-VSPERR RESET ERROR INDICATOR @VA11232 01397000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01398000 ICM R0,B'1111',SPPREPAG GET PREVIOUS BUFFER DASD ADDRESS 01399000 BNZ UPDPREV UPDATE PREVIOUS BUFFER @VA11232 01400000 MVC SFBSTART,VSPDPAGE UPDATE NEW START CCPD @VA11232 01400100 B TSTPUR GO UPDATE SFBLAST @VA11232 01400200 UPDPREV L R1,VSPVPAGE GET VIRTUAL PAGE ADDRESS @VA11232 01400300 CALL DMKRPAGT,PARM=(SYSTEM+BRING+LOCK) GET BUFFER 01402000 LR R2,R4 RE-ESTABLISH BUFFER ADDRESS @VA11232 01403000 BNZ EMSG429B SPOOL READ ERROR @VA11232 01403100 ST R3,SPNXTPAG UPDATE FORWARD BUFFER POINTER @VA11232 01404000 CALL DMKRPAPT,PARM=(SYSTEM) WRITE OUT BUFFER 01405000 LR R2,R4 RE-ESTABLISH BUFFER ADDRESS @VA11232 01406000 BZ TSTPUR NO ERRORS, UPDATE SFBLAST @VA11232 01406100 L R6,SPPREPAG SFBPNT SHOULD POINT TO PREVIOUS @VA11232 01406200 ST R6,SFBPNT GOOD BUFFER WRITE @VA11232 01406300 B EMSG429B GO PURGE FILE @VA11232 01406400 PRTPUR XC VSPSFBLK(4),VSPSFBLK CLEAR SFBLOK POINTER 01408000 CLI VDEVTYPE,TYP3210 IS THIS A SPOOLED CONSOLE @VA14162 01408100 BE NOPURFLG YES,THEN FILE HAS BEEN CKPT @VA14162 01408200 OI SFBFLAG2,SFBPURGE PURGING AN OPEN SPOOL FILE @VA11439 01408500 NOPURFLG DS 0H @VA14162 01408600 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01409000 CALL DMKSPLDL AND PURGE THE FILE 01410000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01411000 SR R7,R7 CLEAR SFBLOK GPR 01412000 B PRTDONE AND EXIT NOW 01413000 SPACE 01414000 SETOPTS MVC SFBCLAS,VDEVCLAS MOVE IN FILE CLASS 01415000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01416000 CALL DMKSPLCV CALL VIRTUAL OUTPUT FILE CLOSE 01417000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01418000 * ROUTINE 01419000 SPACE 2 01420000 PRTDONE EQU * HERE WHEN FINISHED CLOSING THE FILE 01421000 L R9,VDEVSPL RESTORE ADDRESS OF WORKAREA 01422000 L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 01423000 SR R0,R0 DUMMY DASD ADDRESS 01424000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01425000 CALL DMKRPAGT,PARM=SYSTEM TO RELEASE CORE PAGE, AND 01426000 CALL DMKPGTVR TO RELEASE VIRTUAL BUFFER ADDRESS 01427000 L R1,VSPVPG2 SECOND VIRTUAL BUFFER ADDRESS @VA11232 01427200 LTR R1,R1 IS THERE ONE ? @VA11232 01427400 BZ NOBUFF2 NO, NOTHING TO RELEASE @VA11232 01427600 CALL DMKRPAGT,PARM=SYSTEM RELEASE CORE PAGE @VA11232 01427800 CALL DMKPGTVR AND RELEASE VIRTUAL BUFFER @VA11232 01428000 NOBUFF2 AL R8,VMDVSTRT RE-ESTABLISH VDEVBLOK ADDRESS @VA11232 01428200 L R1,VSPBUFBK GET ADDRESS OF WORK BUFFER 01429000 LTR R1,R1 BLOK TO BE FRETED ?? 01430000 BZ FRETSPL NO - FRET VSPLCTL BLOK 01431000 LA R0,VSPBUFSZ SIZE OF BLOK 01432000 CALL DMKFRET FRET IT 01433000 SPACE 01434000 FRETSPL LR R1,R9 GET ADDRESS OF VSPLCTL WORKAREA 01435000 LA R0,VSPSIZE AND ITS SIZE 01436000 CALL DMKFRET AND FREE IT 01437000 SR R9,R9 01438000 ST R9,VDEVSPL CLEAR ADDRESS OF VSPLCTL 01439000 NI VDEVSFLG,X'FF'-(VDEVPURG+VDEVCFCL) RESET PURGE AND 01440000 * CONSOLE FUNCTION FLAG 01441000 BR R6 AND LEAVE 01442000 SPACE 3 01443000 DELAYCL EQU * HERE TO SET UP FOR POSSIBLE DELAYED CLOSE 01444000 OI VDEVSFLG,VDEVCFCL FLAG CONSOLE CLOSE PENDING 01445000 USING SAVEAREA,R13 01446000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01028 01447000 BO STKCPBLK YES - SET DELAY @VM01028 01448000 CLC SAVER1,=C'CLOS' PROCESSING CLOSE COMMAND ? 01449000 DROP R13 01450000 BE VSPCFXIT YES - RETURN TO CALLER 01451000 OI VDEVKEY,X'0F' FORCE CHANNEL PROGRAM CHECK 01452000 USING CPEXBLOK,R1 01453000 STKCPBLK LA R0,CPEXSIZE SIZE OF CPEXBLOK @VM01021 01454000 CALL DMKFREE GET STORAGE 01455000 XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEAR IT 01456000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01457000 LR R15,R6 SET UP ENTRY ADDRESS 01458000 STM R15,R14,CPEXADD SET ENTRY POINT AND SAVE REGS 01459000 LA R2,VSPSTK GET LOCAL STACK CP BLOKS 01460000 LR R3,R2 SAVE PREVIOUS ADDRESS @VA01460 01461000 ICM R2,B'1111',0(R2) GET ADDRESS OF NEXT CPEXBLOK @VA01460 01462000 BNZ *-6 BRANCH IF NOT LAST @VA01460 01463000 ST R1,0(,R3) CHAIN THIS ONE TO END @VA01460 01464000 GOTO DMKDSPCH RETURN CONTROL BACK TO SYSTEM 01465000 DROP R1 01466000 SPACE 3 01467000 SPACE 01468000 SPACE 3 01469000 EJECT 01470000 *. 01471000 * 01472000 * HANDLING CONTROL PROGRAM REQUESTS TO USE THE VIRTUAL PRINTER - 01473000 * 01474000 * 1. UPON ENTRY TO DMKVSPRT, THE FOLLOWING REGISTERS MUST BE 01475000 * LOADED - 01476000 * GPR0 = BYTE COUNT OF LINE TO PRINTED 01477000 * GPR1 = ADDRESS OF FIRST BYTE OF OUTPUT LINE 01478000 * GPR11 = ADDRESS OF VMBLOK FOR OWNER OF VIRTUAL PRINTER 01479000 * GPR12 = ADDRESS OF DMKVSPRT 01480000 * GPR13 = ADDRESS OF SAVEAREA 01481000 * 01482000 * 2. VERIFY THAT THE LINE BYTE COUNT IS 0 TO 132, IF NOT SET 01483000 * RETURN CODE 4 AND EXIT TO THE CALLER. 01484000 * 01485000 * 3. LOCATE AN AVAILABLE VIRTUAL PRINTER; IF NONE, SET RETURN 01486000 * CODE 4 AND EXIT TO THE CALLER 01487000 * 01488000 * 4. IF THE DEVICE IS CP BUSY(VDEVSVC=1) OR BUSY(SIO-VDEVBUSY=1) 01489000 * BRANCH TO STKCPBLK ROUTINE TO BUILD AND STACK A 01490000 * CPEXBLOK ON VSPSTK ANCHOR CHAIN, AND GO TO DISPATCHER. 01491000 * 01492000 * 5. IF THE DEVICE IS NOT CP BUSY OR BUSY OR ENTRY FROM A 01493000 * PREVIOUS STACK CPEXBLOK; OPEN A FILE FOR THIS DEVICE IF 01494000 * NECESSARY AND PLACE THE LINE INTO THE FILE. IF LINE COUNT 01495000 * WAS ZERO, INSERT A SKIP TO CHANNEL ONE CCW. 01496000 * 01497000 * 6. BAL TO THE UNSTKBLK ROUTINE TO UNSTACK THE NEXT 01498000 * CPEXBLOK FOR THIS DEVICE, IF ANY. 01499000 * 01500000 * 7. SET THE CORRECT RETURN CODE IN GPR2 AND EXIT TO THE CALLER 01501000 * 01502000 * 01503000 * EXIT CONDITIONS 01504000 * 01505000 * GPR2 = ZERO SUCCESSFULL COMPLETION 01506000 * GPR2 = 4 VIRTUAL PRINTER DEVICE NOT FOUND OR 01507000 * DEDICATED TO REAL DEVICE OR NOT-READY. 01508000 * GPR2 = 8 SPOOLING SPACE FULL OR SPOOL IO ERROR 01509000 * 01510000 * HANDLING CONTROL PROGRAM REQUESTS FOR HARD COPY OF CONSOLE 01511000 * REAL OR VIRTUAL - 01512000 * 01513000 * 1. UPON ENTRY TO DMKVSPVP, THE FOLLOWING REGISTERS MUST BE 01514000 * LOADED - 01515000 * GPR0 = BYTE COUNT OF DATA TO BE SPOOLED 01516000 * GPR1 = ADDRESS OF FIRST BYTE OF OUTPUT LINE 01517000 * GPR8 = ADDRESS OF CONSOLE VDEVBLOK 01518000 * GPR11 = ADDRESS OF VMBLOK FOR OWNER OF VIRUAL CONSOLE 01519000 * GPR12 = ADDRESS OF DMKVSPVP 01520000 * GPR13 = ADDRESS OF SAVEAREA 01521000 * 01522000 * 2. VERIFY THAT THE LINE BYTE COUNT IS 1 TO 132, IF NOT, 01523000 * EXIT TO THE CALLER. 01524000 * 01525000 * 3. IF THE VIRTUAL CONSOLE IS CP BUSY(VDEVSVC=1), DO THE 01526000 * FOLLOWING TO PREVENT USER LOCK OUT: (NOT BUSY GO TO STEP 6) 01527000 * (A) GET FREE STORAGE TO HOLD THE PRINT LINE DATA. 01528000 * (B) GET STORAGE FOR CPEXBLOK AND STACK BY CALLING 01529000 * DMKSTKCP FOR ENTRY POINT VSPCON. 01530000 * (C) EXIT TO CALLER TO PREVENT USER LOCKOUT. 01531000 * 4. ENTRY POINT - VSPCON - 01532000 * (A) CALL DMKVSPCP TO WRITE DATA LINE TO SPOOL FILE 01533000 * (B) ON RETURN FROM DMKVSPCP, RETURN BUFFER STORAGE. 01534000 * (C) GO TO DISPATCHER (DMKDSPCH) 01535000 * 01536000 * 5. ENTRY POINT - DMKVSPCP - IF THE CONSOLE DEVICE IS CP BUSY, 01537000 * BRANCH TO STKCPBLK ROUTINE TO BUILD AND STACK A CPEXBLOK 01538000 * ON VSPSTK ANCHOR CHAIN AND GO TO DISPATCHER. 01539000 * WHEN THE CPEXBLOK IS UNSTACKED BY CP RETURN IS TO 01540000 * STEP 6. 01541000 * 01542000 * 6. OPEN A FILE FOR THIS DEVICE IF NECESSARY AND PLACE THE 01543000 * LINE INTO THE FILE. INSERT A SKIP TO CHANNEL ONE, 01544000 * EVERY 60 LINES OF DATA. 01545000 * 01546000 * 7. BAL TO UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK 01547000 * IF ANY, FOR THIS DEVICE AND EXIT TO CALLER.. 01548000 * 01549000 * EXIT CONDITIONS - 01550000 * 01551000 * VDEVBLOK - VDEVCSPL WILL BE RESET IF SPOOL 01552000 * SPACE FULL OR SPOOL BUFFER ERROR 01553000 * CONDITION. THE USER WILL RECEIVE ERROR 01554000 * MESSAGE DMKVSP427I OR DMKVSP429I. 01555000 * 01556000 * NO RETURN CODE IS RETURN TO THE CALLER 01557000 * 01558000 *. 01559000 SPACE 2 01560000 USING SAVEAREA,R13 01561000 DMKVSPRT RELOC 01562000 LR R10,R12 SET UP SECOND BASE REGISTER 01563000 A R10,F4096 .. 01564000 SR R2,R2 CLEAR RETURN CODE REG 01565000 ST R2,SAVEWRK2 .. 01566000 SR R1,R1 ZERO CHANNEL INDEX 01567000 LA R4,2 INCREMENT VALUE 01568000 LA R5,30 TABLE LENGTH 01569000 VCH LH R6,VMCHTBL(R1) LOAD INDEX TO NEXT VIRT CHANNEL 01570000 LTR R6,R6 CHANNEL EXIST ?? 01571000 BM VCHI NO, TRY NEXT 01572000 A R6,VMCHSTRT POINT TO VCHBLOK 01573000 USING VCHBLOK,R6 01574000 SR R2,R2 ZERO CU TABLE INDEX 01575000 VCU LH R7,VCHCUTBL(R2) LOAD INDEX TO NEXT VIRT CONTROL UNIT 01576000 LTR R7,R7 DOES IT EXIST ?? 01577000 BM VCUI NO, TRY NEXT 01578000 A R7,VMCUSTRT POINT TO VCUBLOK 01579000 USING VCUBLOK,R7 01580000 SR R3,R3 CLEAR DEVICE INDEX 01581000 VDV LH R8,VCUDVTBL(R3) LOAD INDEX TO DEVICE BLOK 01582000 LTR R8,R8 DOES IT EXIST ?? 01583000 BM NEXTDEV NO TRY NEXT 01584000 A R8,VMDVSTRT POINT TO VDEVBLOK 01585000 CLI VDEVTYPC,CLASURO OUTPUT DEVICE ?? 01586000 BNE NEXTDEV NO - 01587000 TM VDEVSTAT,VDEVDED DEDICATED TO REAL DEVBLOK ? 01588000 BO NEXTDEV YES - 01589000 TM VDEVTYPE,TYPPRT PRINTER DEVICE ?? 01590000 BO PRTFND YES -- GO 01591000 NEXTDEV BXLE R3,R4,VDV INCREMENT THRU DEVICES 01592000 VCUI BXLE R2,R4,VCU INCREMENT THRU CONTROL UNIT 01593000 VCHI BXLE R1,R4,VCH INCREMENT THRU CHANNEL 01594000 L R8,FFS INDICATE NO VDEVBLOK 01595000 SPACE 01596000 USING SFBLOK,R7 01597000 VSPRT4 MVI SAVEWRK2+3,4 SET RETURN CODE 01598000 B VSPRINTX USER HAS NO PRINTER 01599000 SPACE 01600000 DMKVSPVP RELOC ENTRY FOR CONSOLE SUPPORT HARD COPY 01601000 LR R10,R12 SET UP SECOND BASE REGISTER 01602000 A R10,F4096 .. 01603000 SR R2,R2 CLEAR RETURN CODE 01604000 ST R2,SAVEWRK2 .. 01605000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01606000 CL R0,F1 LENGTH 1 OR GREATER ? 01607000 BL VSPRT4 NO -- EXIT 01608000 TM VDEVSTAT,VDEVNRDY+VDEVDED DEDICATED OR NOT READY ?? 01609000 BNZ VSPRT4 YES --RESET SPOOL ACTIVE AND EXIT 01610000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01021 01611000 BZ PRTNBUSY NO - CONTINUE @VM01021 01612000 LR R2,R1 SAVE DATA ADDRESS @VM01021 01613000 LR R4,R0 SAVE DATA COUNT @VM01021 01614000 TM VDEVFLAG,VDEVDLY WAIT AND SPOOL IT LATER? @VA04213 01614250 BNO NODELAY NO...DO IT NOW @VA04213 01614500 NI VDEVFLAG,255-VDEVDLY RESET DELAY FLAG @VA04213 01614750 LA R0,7(,R4) GET NUMBER OF DOUBLE WORDS @VM01021 01615000 SRL R0,3 .. @VM01021 01616000 LR R5,R0 SAVE FOR BUFFER FRET @VM01021 01617000 CALL DMKFREE GET STORAGE FOR BUFFER @VM01021 01618000 LR R3,R1 SAVE ADDRESS OF BUFFER @VM01021 01619000 BCTR R4,0 DATA BYTE COUNT -1 @VM01021 01620000 EX R4,MOVEPRT MOVE DATA TO NEW TEMP BUFFER @VM01021 01621000 LA R0,CPEXSIZE BUILD CPEXBLOK @VM01021 01622000 CALL DMKFREE .. @VM01021 01623000 USING CPEXBLOK,R1 @VM01021 01624000 XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEAR IT @VM01021 01625000 LA R0,1(,R4) BYTE COUNT OF DATA @VM01021 01626000 L R8,SAVER8 RESTORE VDEVBLOK DISPLACEMENT @VM01021 01627000 LA R15,VSPCON CPEX ENTRY ADDRESS @VM01021 01628000 STM R15,R14,CPEXADD SET ENTRY POINT AND SAVE REGS @VM01021 01629000 ST R3,CPEXR1 SET BUFFER ADDRESS IN REG 1 @VM01021 01630000 CALL DMKSTKCP HAVE CP STACK IT @VM01021 01631000 EXIT - EXIT TO CALLER @VM01021 01632000 NODELAY LA R6,VSPCON1 RETURN ADDRESS @VA04213 01632350 B STKCPBLK STACK IT @VA04213 01632700 SPACE 01633000 VSPCON EQU * ENTER HERE FROM CPEX BLOK @VM01021 01634000 CALL DMKVSPCP WRITE CONSOLE HARDCOPY OF @VM01021 01635000 * DATA PASSED BY CPEX BLOK 01636000 LR R0,R5 SIZE OF TEMP BUFFER @VM01021 01637000 LR R1,R3 ADDRESS OF TEMP BUFFER @VM01021 01638000 CALL DMKFRET RETURN TEMP BUFFER STORAGE @VM01021 01639000 GOTO DMKDSPCH GO TO DISPATCHER @VM01021 01640000 SPACE 01641000 DMKVSPCP RELOC - ENTRY FOR STACKED HARD COPY DATA @VM01021 01642000 AL R8,VMDVSTRT FULL VDEVBLOK ADDRESS @VM01021 01643000 B CONFND TRY AND PRINT A LINE @VM01021 01644000 SPACE 01645000 DROP R1 @VM01021 01646000 VSPCON1 LR R0,R4 GET THE COUNT @VA04213 01646140 LR R1,R2 AND THE DATA ADDRESS @VA04213 01646280 AL R8,VMDVSTRT AND THE VDEVBLOK ADDRESS @VA04213 01646420 B PRTNBUSY PICK UP THIS TASK @VA04213 01646560 SPACE 2 01646700 PRTFND TM VDEVSTAT,VDEVNRDY DEVICE NOT READY ? 01647000 BO NEXTDEV BRANCH NOT READY 01648000 TM VDEVSTAT,VDEVBUSY DEVICE BUSY WITH SIO ? @VM01021 01649000 BO PRTDLY YES - SET UP DELAY @VM01021 01650000 CONFND TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01021 01651000 BZ PRTNBUSY NO - START PROCESSING @VM01021 01652000 PRTDLY LA R6,PRTCPEX CPEX ENTRY ADDRESS @VM01021 01653000 B STKCPBLK GO STACK CPEX BLOK @VM01021 01654000 PRTCPEX AL R8,VMDVSTRT GET VDEVBLOK ADDRESS @VM01021 01655000 PRTNBUSY L R9,VDEVSPL ADDRESS OF SPOOL CONTROL BLOK @VM01021 01656000 OI VDEVSFLG,VDEVSVC INDICATE CALL BY SVC 01657000 LTR R9,R9 IS ANY FILE OPEN? 01658000 BNZ FILEOPEN 01659000 CALL DMKSCNVD GET FULL DEVICE ADDRESS 01660000 BNZ VSPRT4 VCUBLOK OR VCHBLOK MISSING 01661000 STH R1,VDEVUNIT SAVE FULL DEVICE ADDRESS 01662000 BAL R6,OPEN OPEN FILE - SFBLOK VSPLCTL 01663000 ST R7,VSPSFBLK STORE ADDRESS OF SFBLOK 01664000 CLC SFBSTART(4),ZEROES DASD SPACE AVAILABLE ?? 01665000 BNE OPENCKPT YES - CHECKPOINT IT .. @VM02132 01666000 LA R6,VSPRINTX RETURN ADDRESS FOR EXIT 01667000 ST R6,SAVEWRK6 SAVE IT 01668000 BAL R6,PRTPUR PURGE FILE - CLEAR DEVICE 01669000 B MSG427I GIVE ERROR MSG DMKVSP427I 01670000 * CONTROL WILL RETURN TO VSPRINTX 01671000 OPENCKPT CLI VDEVTYPE,TYP1052 @VA05480 01672100 BNE FILEOPEN @VA05480 01672200 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA07487 01672250 CALL DMKCKSPL,PARM=OPNSFB+ADDSFB+PRTCHN @VA05480 01672300 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA07487 01672400 FILEOPEN L R7,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOK 01673000 L R5,VSPBUFBK ADDRESS OF WORK BUFFER 01674000 LTR R5,R5 VALID WORK ADDRESS 01675000 BP SETCCW YES 01676000 LA R0,VSPBUFSZ NUMBER OF DOUBLE WORDS FOR PRINTER 01677000 SPACE 01678000 CALL DMKFREE GET STORAGE FOR WORK BUFFER 01679000 ST R1,VSPBUFBK SAVE ADDRESS OF WORK BUFFER 01680000 LR R5,R1 ADDRESS OF WORK BUFFER 01681000 SETCCW MVC 1(11,R5),MODELCCW+1 GET MODEL CCW AND TIC 01682000 MVI 0(R5),X'09' SET UP FOR PRINT AND SPACE 01683000 CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ?? 01684000 BNE SPACE01 NO -- CHECK FOR SPACE NO PRINT 01685000 ICM R3,B'1111',SFBRECNO RECORD COUNT OF ZERO @VA01330 01686000 BZ CONSKIP YES -- DO SKIP 01687000 SR R2,R2 SET UP FOR DIVIDE 01688000 D R2,=F'60' 60 LINES PER PAGE 01689000 LTR R2,R2 TIME FOR SKIP 01690000 BNZ TESTCNT NO --CONTINUE 01691000 CONSKIP MVI 0(R5),X'8B' INSERT SKIP TO CHANNEL ONE @VW01580 01692000 OI 4(R5),SKIP SET CCW TO INDICATE NO DATA @V293598 01693000 LA R3,8 LENGTH OF SKIP CCW @VW01580 01694000 LA R6,CONSRET SET UP RETURN ADDRESS @VW01580 01695000 ST R6,SAVEWRK6 .. @VW01580 01696000 CALL DMKVSQPD GET BUFFER SPACE AND MOVE DATA @V60BCAA 01697000 B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01697100 * ERROR MESSAGE. 01697200 * IF NO ERROR OCCURRED, WILL FALL THROUGH 01697300 CONSRET L R5,VSPBUFBK RESTORE ADDRESS OF BUFFER @VW01580 01698000 NI 4(R5),X'FF'-SKIP AND RESET THE CCW @V293598 01699000 MVI 0(R5),X'09' PRINT AND SPACE CCW OP-CODE @VW01580 01700000 B TESTCNT NOW PROCESS INPUT LINE 01701000 SPACE 01702000 SPACE01 CLI VSPCCW,X'01' LAST CCW WRITE NOSPACE 01703000 MVI VSPCCW,X'09' SET UP FOR PRINT AND SPACE 01704000 BNE TESTCNT NO -- 01705000 MVI VSPCCW,X'0B' SET UP TO SPACE IMMEDIATE 01706000 MVI 0(R5),X'0B' .. 01707000 OI 4(R5),SKIP INDICATE NO DATA @V293598 01708000 LA R3,8 LENGTH OF CCW 01709000 LA R6,SPACERET RETURN ADDRESS 01710000 ST R6,SAVEWRK6 .. 01711000 CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01712000 B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01712100 * ERROR MESSAGE. 01712200 * IF NO ERROR OCCURRED, WILL FALL THROUGH 01712300 NI 4(R5),X'FF'-SKIP AND RESET THE CCW @V293598 01713000 SPACERET MVI VSPCCW,X'01' PRINT AND NOSPACE 01714000 MVI 0(R5),X'01' .. 01715000 TESTCNT L R4,SAVER0 RESTORE BYTE COUNT 01716000 LTR R4,R4 COUNT ZERO ?? 01717000 BNZ NOSKIP NO - NO SKIP 01718000 MVI 0(R5),X'8B' MOVE IN SKIP TO ONE 01719000 OI 4(R5),SKIP INDICATE NO DATA @V293598 01720000 LA R3,8 SET LENGTH TO 8 01721000 B SKLINE 01722000 NOSKIP CL R4,=F'132' WILL IT FIT ON ONE LINE? @VA05182 01723500 BNH LOWLIMIT YES @VM03186 01724000 LA R4,132 SET MAXIMUM LINE LENGTH @VA05182 01725500 LOWLIMIT L R1,SAVER1 RESTORE ADDRESS OF INPUT DATA @VM03186 01726000 * LINE 01727000 LA R15,12(R5) POINT TO START OF DATA IN BUFFER 01728000 LR R6,R15 SAVE FOR DATA MOVE INSTRUCTION 01729000 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 01730000 BNO SETCNT NO--1403 @V386298 01731000 USING VFCBBLOK,R14 01732000 L R14,VDEVFCBK ADDRESS OF FORMS BLOK 01733000 SR R3,R3 SET UP TO TEST FOR INDEXING 01734000 NI VFCBNDEX,X'1F' RESET ALL EXCEPT COUNT 01735000 ICM R3,B'0001',VFCBNDEX GET INDEX BYTE COUNT 01736000 BZ SETCNT NO INDEXING AVAILABLE 01737000 MVI 12(R5),X'40' CLEAR FIRST 31 BYTES 01738000 MVC 13(31,R5),12(R5) OF DATA AREA 01739000 BCTR R3,0 INDEX COUNT -1 01740000 AR R4,R3 ADD INDEX COUNT TO INPUT LINE CNT 01741000 C R4,=F'150' GREATER THAN MAX LINE ?? 01742000 BNH *+8 NO -- 01743000 LA R4,150 RESET TO MAX OF 150 01744000 SR R4,R3 GET NEW INPUT DATA COUNT 01745000 AR R6,R3 SET UP NEW BUFFER DATA ADDRESS 01746000 SETCNT LR R3,R4 SAVE COUNT OF DATA 01747000 BCTR R4,0 -1 FOR MOVE 01748000 EX R4,VSPMOVE MOVE DATA TO BUFFER 01749000 AR R3,R15 POINT TO END OF DATA 01750000 TRUNC BCTR R3,R0 -1 TO TRUNCATE BLANKS 01751000 CR R3,R15 START OF BUFFER ?? 01752000 BNH NONBLANK YES - 01753000 CLI 0(R3),C' ' IS THIS COL BLANK ?? 01754000 BE TRUNC YES - CHECK NEXT 01755000 SPACE 01756000 NONBLANK SR R3,R15 FIND LENGTH 01757000 LA R3,1(R3) ADD ONE TO LENGTH 01758000 STH R3,6(R5) STORE LENGTH IN CCW 01759000 LA R3,19(R3) CCW LENGTH PLUS 7 FOR ROUNDING 01760000 N R3,=A(X'FFFFF8') ROUND TO DOUBLE WORD 01761000 STH R3,10(R5) SET TIC ADDRESS OF NEXT CCW 01762000 * R3 LENGTH OF WORK BUFFER 01763000 SKLINE LA R6,VSPRINTX GET RETURN ADDRESS 01764000 ST R6,SAVEWRK6 AND SAVE 01765000 CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01766000 B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01766100 * ERROR MESSAGE. 01766200 * IF NO ERROR OCCURRED, WILL FALL THROUGH 01766300 VSPRINTX EQU * EXIT TO CALLER 01767000 LTR R8,R8 VALID VDEVBLOK ADDRESS 01768000 BNP RETCODE NO -- SET RETURN CODE AND EXIT @VA00808 01769000 NI VDEVSFLG,X'FF'-VDEVSVC RESET ENTRY INDICATOR 01770000 BAL R6,UNSTKBLK GO UNSTACK CPEX BLOCK @VM01021 01771000 CLI VDEVTYPE,TYP3210 CONSOLE DEVICE? @VA11114 01771200 BNE RETCODE IF NOT, GO SET RETURN CODE @VA11114 01771400 TM VDEVSFLG,VDEVSVC WAS A CPEXBLOK UNSTACKED? @VA11114 01771600 BO PRTEXIT IF SO, BEAT IT QUIETLY @VA11114 01771800 TM VMRSTAT,VMCPWAIT WAITIING FOR CP RESOURCE? @VA11114 01772000 BNZ PRTEXIT IF SO, OUT QUIETLY @VA11114 01772200 TM VMPEND,255 ANY PENDING INTERRUPTS AT ALL? @VA11114 01772400 BZ PRTEXIT NOPE, ALL IS WELL @VA11114 01772600 * AT THIS POINT, CONSOLE SPOOLING MAY HAVE BLOCKED A USER, 01772800 * SO GIVE HIM A SHOT AT DISPATCH: 01773000 LA R0,CPEXSIZE @VA11114 01773200 CALL DMKFREE NEED A CPEXBLOK NOW @VA11114 01773400 USING CPEXBLOK,R1 TELL SAM @VA11114 01773600 XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEARED, PLEASE @VA11114 01773800 LA R15,VSPCDISP WHERE TO COME BACK @VA11114 01774000 STM R15,R14,CPEXADD STOW THE REGISTERS @VA11114 01774200 CALL DMKSTKCP AND STACK RETURN @VA11114 01774400 B PRTEXIT NO RETURN CODE FOR CONSOLE @VA11114 01774600 DROP R1 NO MORE CPEXBLOK @VA11114 01774800 * 01775000 RETCODE DS 0H HERE TO SET RETURN CODE @VA11114 01775200 L R2,SAVEWRK2 GET RETURN CODE @VA11114 01775400 ST R2,SAVER2 AND STORE IN CALLER'S REG2 @VA11114 01775600 PRTEXIT DS 0H RETURN TO CALLER @VA11114 01775800 EXIT , -------------------------------->@VA11114 01776000 * 01776200 VSPCDISP DS 0H HERE ON CPEXBLOK UNSTACK @VA11114 01776400 GOTO DMKDSPCH WAKE UP, YOU ------------------->@VA11114 01776600 * 01776800 SPACE 01777000 SPACE 2 01778000 VSPMOVE MVC 0(*-*,R6),0(R1) MOVE DATA TO BUFFER 01779000 SPACE 01780000 DROP R14 01781000 SPACE 01782000 DROP R13 01783000 EJECT 01784000 LTORG * 01785000 EJECT 01786000 SPACE 3 01980000 EJECT 01981000 SPACE 2 01983000 MODELCCW EQU * MODEL CCW AND TIC 01984000 DC X'41' PUNCH OP-CODE 01985000 DC AL3(12) RELATIVE DATA ADDRESS 01986000 DC AL1(CC+SILI,0) FLAGS 01987000 DC AL2(80) DATA LENGTH 01988000 DC X'08' TIC OP-CODE 01989000 DC AL3(96) RELATIVE ADDRESS OF NEXT RECORD 01990000 SPACE 01991000 DS 0H 01992000 EJECT 01993000 SENSE EQU * HERE TO DO A SENSE TO READER 01994000 * PRINTER, OR PUNCH 01995000 SPACE 3 01996000 L R1,VSPCCW GET DATA ADDRESS 01997000 LA R1,0(,R1) CLEAR COMMAND CODE 01998000 BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 01999000 OI VDEVCSW+4,CE+DE SENSE RETURNS CE+DE TOGETHER 02000000 LA R3,VDEVSNSE ADDRESS OF VDEVICE SENSE BYTES 02001000 SR R4,R4 GET CCW COUNT @VA00808 02002000 ICM R4,B'0011',VSPCCW+6 .. @VA00808 02003000 TM VDEVSTAT,VDEVNRDY DEVICE NOTREADY 02004000 BO SETNR YES - 02005000 SPACE 02006000 SPACE 02007000 LTR R7,R7 ACTIVE FILE ?? 02008000 BNZ *+8 YES -- INDICATE PRESENT SENSE 02009000 SETNR MVI VDEVSNSE,INTREQ INDICATE INTERVENTION REQUIRED 02010000 LA R5,1 SENSE COUNT OF ONE 02011000 CLI VDEVTYPE,TYP3505 3505 RDR ? 3525 PUN ? 02012000 BNE CNT3211 NO--CHECK 3211/3203 @V386298 02013000 LA R5,4 SENSE COUNT FOR 3505 AND 3525 02014000 TM VDEVSNSE,INTREQ INTERVENTION REQUIRED ? 02015000 BZ *+8 NO -- CHECK FOR COMMAND REJECT 02016000 MVI VDEVSNSE+1,X'10' SENSE BYTE 1 FOR 3505 OR 3525 02017000 TM VDEVSNSE,CMDREJ COMMAND REJECT ?? 02018000 BZ SENTST NO -- SENSE INFORMATION OK 02019000 MVI VDEVSNSE+1,X'80' INDICATE PERMANENT ERROR 02020000 B SENTST CONTINUE 02021000 CNT3211 EQU * 02021500 TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 02022000 BNO SENTST NO--1403 @V386298 02023000 ICM R5,B'1111',VDEVFCBK ADDRESS OF FORM CONTROL BLOK@VA00716 02024000 BZ *+8 NONE PRESENT - BRANCH @VA00716 02025000 NI VFCBFLAG-VFCBBLOK(R5),X'FF'-VFCBDIAG @VA14403 02026010 * RESET CMD 07 PROCESSING 02027010 CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 02027100 BNE SENS3211 NO--LOAD 3211 SESE COUNT @V386298 02027200 LA R5,24 LOAD 3203 SENSE BYTE COUNT @V386298 02027300 B SENTST GO CHECK CCW SENSE COUNT @V386298 02027400 SENS3211 EQU * @V386298 02027500 LA R5,6 SENSE COUNT FOR 3211 02028000 SPACE 02029000 SENTST CR R4,R5 CCW SENSE COUNT VALID 02030000 BH COUNTHI CCW COUNT HIGH 02031000 BL CNTLOW CCW COUNT LOWER THAN DEVICE COUNT 02032000 B SENSEQ SENSE COUNT EQUAL 02033000 SPACE 02034000 COUNTHI EQU * HERE IF COUNT IS TOO BIG 02035000 SR R4,R5 RESIDUAL COUNT 02036000 STH R4,VDEVCSW+6 STORE RESIDUAL COUNT 02037000 LR R4,R5 GET DEVICE SENSE COUNT 02038000 TM VSPCCW+4,CD+IDA DATA CHAINING OR IDA ?? 02039000 BZ TSTWLR NO -- TEST SILI FLAG 02040000 TM VSPCCW+4,IDA IDA ?? 02041000 BZ SNSIL NO --SET INCORRECT LENGTH 02042000 LH R14,VSPIDACT GET ORIGNAL CCW DATA COUNT 02043000 SR R14,R5 GET TRUE RESIDUAL COUNT 02044000 STH R14,VDEVCSW+6 AND STORE IN CSW 02045000 OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02046000 NI VSPCCW+4,X'FF'-IDA REMOVE IDA FROM CCW 02047000 B SNSIL SET INCORRECT LENGTH 02048000 SPACE 02049000 CNTLOW TM VSPCCW+4,IDA IDA ?? 02050000 BO IDALOW YES -- 02051000 TM VSPCCW+4,CD DATA CHAINING ?? 02052000 BO NORMSNS YES -- TAKE NORMAL PATH 02053000 B TSTWLR NO -- CHECK SILI FLAG 02054000 IDALOW CH R4,VSPIDACT MOVE COUNT EQUAL TOTAL COUNT ? 02055000 BNE NORMSNS NO -- 02056000 BAL R6,SENSMOVE MOVE SENSE INFORMATION 02057000 SPACE 02058000 IDAEND1 TM VSPCCW+4,SILI SUPPRESS INCORRECT LENGTH ?? 02059000 BZ *+8 NO -- 02060000 OI VDEVCSW+5,IL YES - SET INCORRECT LENGTH 02061000 OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02062000 NI VSPCCW+4,X'FF'-IDA REMOVE IDA FROM CCW 02063000 B CKCC CHECK FOR CHAINING 02064000 TSTWLR TM VSPCCW+4,SILI SUPPRESS INCORRECT LENGTH ?? 02065000 BO NORMSNS YES -- 02066000 SNSIL OI VDEVCSW+5,IL NO -- SET INCORRECT LENGTH 02067000 NORMSNS SR R5,R4 SAVE REMAINING COUNT 02068000 LTR R4,R4 MOVE COUNT ZERO ?? 02069000 BZ *+8 YES -- 02070000 BAL R6,SENSMOVE GO MOVE SENSE TO USER AREA 02071000 TM VDEVCSW+5,IL INCORRECT LENGTH ?? 02072000 BO LASTCCW YES -- END CHAIN 02073000 TM VSPCCW+4,CD+CC+IDA ANY CHAINING OR IDA ?? 02074000 BZ LASTCCW NO -- LEAVE 02075000 NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 02076000 BAL R6,GETCCW GET NEXT CCW 02077000 B CHKDEVIC COMMAND CHAINING 02078000 SR R4,R4 GET NEXT CCW COUNT @VA00808 02079000 ICM R4,B'0011',VSPCCW+6 .. @VA00808 02080000 L R1,VSPCCW GET DATA ADDRESS 02081000 LA R1,0(R1) 02082000 CR R4,R5 COUNT EQUAL REMAINING COUNT ?? 02083000 BH COUNTHI NO - COUNT HIGH 02084000 BL CNTLOW COUNT LOW 02085000 SPACE 02086000 * HERE DIRECTLY IF COUNT OK 02087000 SENSEQ EQU * 02088000 BAL R6,SENSMOVE GO MOVE SENSE BYTES TO USER'S AREA 02089000 SR R5,R5 INDICATE ZERO DEVICE COUNT LEFT 02090000 CKCC TM VSPCCW+4,CD+CC+IDA ANY CHAINING OR IDA ?? 02091000 BZ LASTCCW NO -- 02092000 NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 02093000 SNSNXT BAL R6,GETCCW GO LOCATE AND VALIDATE NEXT CCW 02094000 B CHKDEVIC BRANCH IF COMMAND CHAINING 02095000 SR R4,R4 HERE IF DATA CHAINING @VA00808 02096000 ICM R4,B'0011',VSPCCW+6 GET CCW COUNT @VA00808 02097000 B SENTST AND CONTINUAL 02098000 SPACE 02099000 SENSMOVE TM VSPCCW+4,SKIP SKIP FLAG ON ?? 02100000 BO CKCC YES - 02101000 ALTER1 SL R8,VMDVSTRT VDEVBLOK DISP @VA05901 02102700 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02103400 * USER AREA 02104000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02105000 IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02106000 CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02107000 BNZ PROTCHK REFLECT PROTECTION EXCEPTION @V304735 02108000 CALL DMKPSACC CHECK IF PAGE WAS CHANGED. @V304735 02109000 BZ NOTCHG1 IF NOT CONTINUE @V304735 02110000 CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02110100 B ALTER1 RE-ISSUE THE TRANS @V304735 02112000 NOTCHG1 LA R14,VDEVFCBK ADDR. POINTER TO FCB BLOK @V304735 02113000 CR R3,R14 MUST ZERO LAST 2 BYTES OF 02114000 BL MOVEINST 6 COUNT SENSE 02115000 BE SENBYTE4 CHECK DEVICE FOR SENSE BYTE 4 @VA11722 02115200 SENRET EQU * @VA11722 02115400 MVI 0(R2),X'00' ZERO SENSE BYTE 02116000 B UPDATSEN CONTINUE WITH SENSE BYTES @VA11722 02117100 SENBYTE4 EQU * @VA11722 02117150 CLI VDEVTYPE,TYP3203 IS THIS A 3203 PRINTER ? @VA11722 02117200 BNE SENRET NO,CONTINUE @VA11722 02117250 MVI 0(R2),DEVID84 MOVE IN DEVICE IDENTIFIER @VA11722 02117300 B UPDATSEN CONTINUE WITH SENSE BYTES @VA11722 02117350 MOVEINST MVC 0(1,R2),0(R3) MOVE SENSE BYTE TO USER'S AREA 02118000 UPDATSEN EQU * @VA11722 02118500 LA R1,1(R1) UPDATE OUTPUT ADDRESS 02119000 LA R3,1(R3) UPDATE SENSE ADDRESS 02120000 BCT R4,SENSMOVE GO MOVE NEXT BYTE 02121000 BR R6 02122000 SPACE 02123000 SPACE 2 02124000 CHKDEVIC CLI VDEVTYPC,CLASURI INPUT DEVICE ?? 02125000 BE READER CONTINUE WITH READER 02126000 B PRINTER CONTINUE WITH PRINTER/PUNCH 02127000 EJECT 02128000 * CALLED FROM DMKVSI, FOR PROCESSING VIRTUAL TIO,AS A 02129000 * SUBROUTINE TO TEST IF THE RDR IS EMPTY. 02130000 SPACE 02131000 USING SAVEAREA,R13 @VA03503 02132000 DMKVSPTO RELOC ENTRY FOR TIO TO A SPOOL READER @VA03503 02133000 LR R10,R12 SET UP SECOND BASE REGISTER @VA03503 02134000 A R10,F4096 ... @VA03503 02135000 BAL R6,CHEKRDR GO SEARCH THE RDR FILE CHAIN @VA13708 02136000 LTR R7,R7 SET CC @VA03503 02142000 EXITVIO EXIT @VA03503 02143000 EJECT 02144000 OPEN EQU * HERE TO OPEN 1ST FILE 02145000 CLI VDEVTYPC,CLASURI IS IT A READER FILE ?? 02146000 BE OPENRDR YES -- 02147000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02148000 CALL DMKSPLOV CALL VIRTUAL SPOOL FILE OPEN ROUTINE 02149000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02150000 LR R4,R1 SAVE CAW ADDRESS @V386298 02150100 CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 02150200 BE CKFCBBK YES--GO GET VFCBBLOK ADDRESS@V386298 02150300 CLI VDEVTYPE,TYP3211 3211 PRINTER ?? 02151000 BNE OPENRET NO 02153000 ICM R5,B'1111',WRKADD INDEX WORK AREA PRESENT ?? 02154000 BNZ CKFCBBK YES -- 02155000 LA R0,184/8 LENGTH OF INDEX WORK AREA 02156000 CALL DMKFREE GET STORAGE 02157000 ST R1,WRKADD AND SAVE ADDRESS 02158000 CKFCBBK L R5,VDEVFCBK GET VFCBBLOK ADDRESS 02159000 DROP R6 02160000 USING VFCBBLOK,R5 SET BASE FOR BLOK 02161000 LTR R5,R5 VFCBBLOK PRESENT ?? 02162000 BP OPENRET YES 02163000 LA R0,VFCBSIZE SIZE OF BLOCK 02164000 CALL DMKFREE GET STORAGE 02165000 LR R5,R1 LOAD BASE REG 02166000 ST R5,VDEVFCBK STORE ADDRESS IN VDEVBLOK 02167000 XC VFCBBLOK(VFCBSIZE*8),VFCBBLOK CLEAR VFCBBLOK 02168000 * 02169000 * SET DEFAULT CHANNELS 02170000 * 02171000 MVI VFCBCNT+1,X'01' SET COUNT TO LINE 2 @VA00716 02172000 MVC VFCBLOAD(11),=X'0102030405060708090A0B' 02173000 MVI VFCBLOAD+59,X'0C' PUT IN CHANNEL 12 02174000 OI VFCBLOAD+65,X'10' END OF FORMS BIT 02175000 OPENRET LR R1,R4 RESTORE CAW ADDRESS 02176000 BR R6 RETURN TO CALLER 02177000 SPACE 2 02178000 OPENRDR EQU * HERE TO OPEN A READER FILE 02179000 LR R5,R1 SAVE CAW 02180000 LA R0,VSPSIZE GET CORE FOR 02181000 CALL DMKFREE A VSPLCTL WORK AREA 02182000 LR R9,R1 SAVE ITS ADDRESS 02183000 ST R9,VDEVSPL IN THE VDEVBLOK 02184000 XC VSPLCTL(VSPSIZE*8),VSPLCTL CLEAR OUT THE BLOK 02185000 ST R5,VSPCAW SAVE CAW ADDRESS 02186000 LA R0,VSPBUFSZ LENGTH OF WORK BUFFER 02187000 CALL DMKFREE GET STORAGE 02188000 ST R1,VSPBUFBK 02189000 SPACE 02190000 OPENCONT EQU * 02191000 L R1,VSPCAW RESTORE CAW ADDRESS @VA02259 02192000 CHEKRDR DS 0H @VA13708 02192500 SLR R7,R7 CLEAR READER FILE POINTER @VA02259 02193000 TM VDEVSTAT,VDEVNRDY IS READER READY? @VA02259 02194000 BO OPNTST NO, RETURN TO CALLER @VA02259 02195000 L R7,ARSPRD POINT TO READER FILE CHAIN @VA02259 02196000 SPACE 02197000 FILESRCH L R7,SFBPNT POINTER TO NEXT FILE 02198000 OPNTST LTR R7,R7 ANY MORE FILES? @VA02259 02199000 BCR 8,R6 NO, RETURN COND ZERO TO CALLER @V200930 02200000 CLC VMUSER,SFBUSER IS THIS A FILE FOR THIS USER? 02201000 BNE FILESRCH NO -- KEEP LOOKING 02202000 TM SFBFLAG,SFBINUSE+SFBDUMP+SFBUHOLD INUSE, DUMP @V200930 02203000 * OR HOLD ? 02204000 BNZ FILESRCH YES -- 02205000 TM SFBFLAG2,SFBMON IS THIS A MONITOR FILE @V50A2B5 02205100 BO FILESRCH YES, SO SKIP THIS @V50A2B5 02205200 CLI VDEVCLAS,C'*' READ ANY CLASS ?? @V200930 02206000 BE SETFLAG YES, FOUND A FILE @V200930 02207000 CLC VDEVCLAS,SFBCLAS RIGHT CLASS?? 02208000 BNE FILESRCH NO -- 02209000 * 02210000 * FINALLY FOUND A FILE 02211000 * 02212000 SETFLAG DS 0H @VA12125 02213500 CLI VMINST,X'9D' TIO? @VA12125 02214000 BER R6 YES - EXIT @VA12125 02214500 OI SFBFLAG,SFBINUSE MARK SPOOL FILE IN USE @VA12125 02215000 OPENTIO LR R3,R6 SAVE FIRST LEVEL RTN ADDR @VA03503 02216000 L R1,VSPVPAGE GET VIRTUAL PAGE ADDRESS 02217000 LTR R1,R1 ADDRESS PRESENT ?? 02218000 BNZ VPAGE YES -- 02219000 SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02220000 CALL DMKPGTVG GET VIRTUAL BUFFER 02221000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02222000 ST R1,VSPVPAGE SAVE ADDRESS 02223000 VPAGE LA R2,SFBSTART POINT TO DASD ADDRESS 02224000 BAL R6,NEXTPAGE FETCH FIRST PAGE BUFFER 02225000 L R6,SFBRECNO GET NUMBER OF RECORDS IN FILE @VA02075 02226000 AL R6,VMCRDS UPDATE CARD COUNT @VA02075 02227000 ST R6,VMCRDS AND STORE @VA02075 02228000 TM SFBFLAG,SFBEOF END OF FILE OR DATA ? @VW01580 02229000 BZ *+8 BRANCH IF DATA PRESENT @VW01580 02230000 OI SFBFLAG,SFBOPEN ZERO RECORD FILE 02231000 L R1,VSPCAW RESTORE CONTENTS OF CALLER'S R1 02232000 OI VDEVSFLG,VDEVFEED INDICATE FEED DONE FOR 1ST CARD 02233000 CR R6,R12 SET CONDITION CODE NON-ZERO 02234000 BR R3 FILE FOUND - GO PROCESS 02235000 EJECT 02236000 GETCCW EQU * HERE TO FIND AND VALIDATE THE NEXT 02237000 * NON-TIC CCW IN THE CHANNEL PROGRAM 02238000 L R1,VSPCAW POINT TO NEXT CCW TO PROCESS 02239000 TM VSPIDASW,X'C0' PROCESSING IDA CCW ?? 02240000 BM VSPIDA2 YES -- PART TWO PROCESSING 02241000 ADDRTEST TM VSPCAW+3,7 CHECK DOUBLE-WORD ALIGNMENT 02242000 BNZ PROGCHK ALIGNMENT ERROR 02243000 TM VDEVKEY,X'0F' CAW BITS 4-7 ZERO ?? 02244000 BNZ PROGCHK NO -- CHANNEL PROGRAM CHECK 02245000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02246000 ALTER2 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02247100 CALL DMKPSACC CHECK IF SHARED PAGE CHANGED @V304735 02248000 BZ NOTCHG2 IF NOT CONTINUE @V304735 02249000 CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02249100 B ALTER2 RE-ISSUE TRANS @V304735 02251000 NOTCHG2 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02252000 LA R15,8(,R1) GET CCW ADDRESS+8 02253000 ST R15,VDEVCSW AND SAVE IN CSW 02254000 ST R15,VSPCAW AND IN CAW FOR NEXT TIME 02255000 TM 0(R2),7 COULD IT BE A TIC? 02256000 BNZ NOTTIC NO -- 02257000 TM 0(R2),8 IS IT A TIC 02258000 BO TIC YES -- 02259000 SPACE 2 02260000 NOTTIC LH R1,6(,R2) IS THE 02261000 LTR R1,R1 COUNT ZERO? 02262000 BZ PROGCHK YES -- BAD NEWS 02263000 TM 4(R2),3 BITS 38-39 OF THE CCW MUST BE 0 02264000 BNZ PROGCHK IF NOT -- 02265000 TM 4(R2),IDA IS THIS A IDA CCW ?? @VA00808 02266000 BZ NONIDA NO -- BRANCH @VA00808 02267000 L R1,0(R2) GET DATA ADDRESS 02268000 LA R1,0(R1) CLEAR HIGH BYTE 02269000 TM 3(R2),3 IDAL ADDRESS ON FULL WORD BOUNDS ?? 02270000 BNZ PROGCHK NO -- 02271000 TM VSPCCW+4,CD IS USER DATA CHAINING ?? 02272000 MVC VSPCCW+1(7),1(R2) MOVE IN MOST OF CCW 02273000 BZ VSPIDA NO -- COMMAND CHAINING 02274000 AL R6,F4 SET UP FOR CHAIN DATA RETURN 02275000 B VSPIDA1 ... @V304635 02276000 VSPIDA MVC VSPCCW(1),0(R2) MOVE IN COMMAND CODE 02277000 VSPIDA1 L R1,VSPCCW ADDRESS OF IDAL @V304635 02278000 LA R1,0(R1) CLEAR COMMAND CODE 02279000 STCM R1,B'0111',VSPIDAL SAVE ADDRESS OF IDAL 02280000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02281000 ALTER3 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02282100 CALL DMKPSACC CHECK IF SHARED PAGE CHANGED @V304735 02283000 BZ NOTCHG3 IF NOT CONTINUE @V304735 02284000 CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02284100 B ALTER3 RE-ISSUE TRANS CALL @V304735 02286000 NOTCHG3 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02287000 CLI 0(R2),0 FIRST BYTE ZERO ?? 02288000 BNE PROGCHK NO -- 02289000 SPACE 02290000 L R14,0(R2) LOAD FIRST IDAW 02291000 STCM R14,B'0111',VSPCCW+1 STORE FIRST IDAW IN CCW 02292000 N R14,F2047 FIND DISPLACEMENT INTO 2048 02293000 L R15,F2048 02294000 SR R15,R14 NUMBER OF BYTES TO NEXT 2048 02295000 SR R14,R14 .. 02296000 ICM R14,B'0011',VSPCCW+6 GET CCW DATA COUNT 02297000 STH R14,VSPIDACT SAVE DATA COUNT 02298000 CR R14,R15 IS THERE AN OTHER IDAW ?? 02299000 BNH ONEIDAW NO -- ONLY ONE 02300000 SPACE 02301000 STH R15,VSPCCW+6 STORE THE DATA COUNT FOR THE FIRST 02302000 LA R1,4(R1) IDAW AND READ THE NEXT IDAW 02303000 ST R1,VSPIDAW2 SAVE ADDRESS OF IDAW2 02304000 MVI VSPIDASW,X'80' INDICATE 1ST CCW ALL SET UP 02305000 BR R6 AND RETURN 02306000 SPACE 02307000 VSPIDA2 EQU * HERE TO SET UP CCW WITH IDAW2 02308000 L R1,VSPIDAW2 GET ADDRESS OF IDAW2 02309000 * 02310000 * VALIDATE IDAW2 WORD 02311000 * 02312000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02313000 ALTER4 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02314100 CALL DMKPSACC CHECK IF SHARED PAGE WAS CHANGED @V304735 02315000 BZ NOTCHG4 IF NOT CONTINUE @V304735 02316000 CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02316100 B ALTER4 RE-ISSUE THE TRANS CALL @V304735 02318000 NOTCHG4 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02319000 CLI 0(R2),0 HIGH ORDER BYTE MUST BE ZERO 02320000 BNE PROGCHK NO -- 02321000 TM 3(R2),X'FF' CHECK FOR 2048 BOUNDARY ALINED 02322000 BNZ PROGCHK NOT ON 2048 BOUNDS 02323000 TM 2(R2),X'07' STILL CHECKING 2048 02324000 BNZ PROGCHK NOT ON 2048 BOUNDS 02325000 SPACE 02326000 MVC VSPCCW+1(3),1(R2) STORE IDAW2 DATA ADDRESS IN CCW 02327000 AL R6,F4 SET RETURN FOR DATA CHAINING 02328000 SR R14,R14 CLEAR COUNT REGS @VA00808 02329000 SR R15,R15 .. @VA00808 02330000 ICM R14,B'0011',VSPIDACT GET ORIGINAL COUNT @VA00808 02331000 ICM R15,B'0011',VSPCCW+6 GET DATA COUNT FOR 1ST IDAW@VA00808 02332000 SR R14,R15 COUNT FOR REMAINING DATA 02333000 STH R14,VSPCCW+6 AND STORE IN CCW 02334000 SPACE 02335000 ONEIDAW OI VSPIDASW,X'C0' INDICATE ALL DONE 02336000 NI VSPCCW+4,X'FF'-IDA RESET IDA FLAG 02337000 BR R6 02338000 SPACE 02339000 NONIDA EQU * 02340000 TM VSPCCW+4,CD IS USER DATA CHAINING? 02341000 MVC VSPCCW+1(7),1(R2) IN ANY CASE, MOVE IN MOST OF CCW 02342000 BO 4(,R6) IF DATA CHAINING EXIT NOW 02343000 MVC VSPCCW(1),0(R2) IF COMMAND CHAINING, MOVE IN COMMAND 02344000 BR R6 AND EXIT TO HANDLE COMMAND CHAINING 02345000 SPACE 2 02346000 TIC EQU * HERE TO FOLLOW THE TIC 02347000 TM VDEVFLAG,VDEVCCW1 IS IT THE FIRST CCW? 02348000 BO PROGCHK YES -- GO SET PROGRAM CHECK 02349000 TM VSPCCW+5,X'01' TIC TO TIC?? 02350000 BO PROGCHK YES -- PROGRAM CHECK 02351000 OI VSPCCW+5,X'01' INDICATE LAST CCW WAS A TIC 02352000 L R1,0(,R2) GET ADDRESS OF NEXT CCW 02353000 LA R1,0(,R1) STRIP OP-CODE 02354000 ST R1,VSPCAW SAVE ADDRESS 02355000 B ADDRTEST GO VALIDATE NEW CCW 02356000 EJECT 02357000 MOVEDATA EQU * HERE TO LOCATE USER'S DATA AREA 02358000 * AND MOVE DATA BETWEEN USER AND WORK BUFFER. 02359000 * R3 ADDRESS OF THE SOURCE DATA OR WORK BUFFER 02360000 * R0 POINTS THE MOVE INSTRUCTION TO BE EXECUTED TO MOVE 02361000 * THE DATA IN THE PROPER DIRECTION 02362000 * GPR5 CONTAINS LOGICAL RECORD SIZE OR RESIDUAL COUNT FOR 02363000 * DATA CHAINING 02364000 * 02365000 L R1,VSPCCW GET VIRTUAL DATA ADDRESS 02366000 LA R1,0(,R1) CLEAR OUT COMMAND CODE 02367000 SR R4,R4 CLEAR COUNT REG @VA00808 02368000 ICM R4,B'0011',VSPCCW+6 GET COUNT FROM CCW @VA00808 02369000 CR R4,R5 COUNT VALID FOR THIS DEVICE ?? 02370000 BE COUNTOK YES COUNT OK 02371000 BL COUNTLOW MORE CHECKING 02372000 * 02373000 * HERE IS COUNT IS TOO HIGH 02374000 * 02375000 SR R4,R5 GET RESIDUAL COUNT 02376000 STH R4,VDEVCSW+6 PUT RESIDUAL COUNT IN CSW 02377000 LR R4,R5 SET UP MOVE COUNT REG 02378000 TM VSPCCW+4,CD+IDA CHAINING DATA OR IDA ?? 02379000 BZ COUNTLOW NO --CHECK SILI 02380000 NI VSPCCW+4,X'FF'-CD RESET CHAIN DATA 02381000 TM VSPCCW+4,IDA DOING IDA ?? 02382000 BZ SETWLR NO - MUST BE CHAIN DATA 02383000 NI VSPCCW+4,X'FF'-IDA RESET IDA 02384000 OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02385000 LH R14,VSPIDACT GET TOTAL CCW COUNT 02386000 SR R14,R4 SGET TRUE RESIDUAL COUNT 02387000 STH R14,VDEVCSW+6 AND STORE IN CSW 02388000 B SETWLR MUST SET INCORRECT LENGTH FLAG 02389000 SPACE 02390000 COUNTLOW EQU * @V60A6B6 02391000 *********************************************************************** 02391010 *** THE NEXT THREE LINES OF CODE WILL ENSURE THAT 3203 HAS THE SILI *** 02391020 *** BIT TURNED ON IN ORDER TO SUPPRESS THE INCORRECT LENGTH FROM *** 02391030 *** BEING REFLECTED. *** 02391040 *********************************************************************** 02391050 CLI VDEVTYPE,TYP3203 @V60A6B6 02391060 BNO CNTCHECK @V60A6B6 02391070 OI VSPCCW+4,SILI @V60A6B6 02391080 CNTCHECK EQU * @V60A6B6 02391090 TM VSPCCW+4,SILI+CD+IDA SUPRESS INCORRECT LENGTH OR@V60A6B6 02391100 * CHAIN OR IDA 02392000 BNZ COUNTOK YES - NO INCORRECT LENGTH 02393000 * DATA 02394000 CLI VDEVTYPE,TYP3211 3211 PRINTER ? @VA00716 02395000 BNE SETWLR NO -- SET WLR FLAG (IL) @VA00716 02396000 ICM R14,B'0011',VDEVCSW+6 RESIDUAL COUNT PRESENT ? @VA00716 02397000 BNZ SETWLR YES -- TRUE WLR @VA00716 02398000 LR R14,R5 CHECK FOR 132 BYTE 3211 DEVICE @VA00716 02399000 SR R14,R4 150 MINUS CCW COUNT @VA00716 02400000 C R14,=F'18' 132 BYTE -3211 ? @VA00716 02401000 BE COUNTOK YES -- DO NOT SET IL FLAG @VA00716 02402000 SPACE 02403000 SETWLR CLI VSPCCW,X'63' FORMS CONTROL OP-CODE ? 02404000 BE COUNTOK YES -- DO NOT SET INCORRECT LENGTH 02405000 OI VDEVCSW+5,IL SET INCORRECT LENGTH 02406000 SPACE 02407000 COUNTOK EQU * HERE DIRECTLY IF COUNT IS OK 02408000 SR R5,R4 GET RESIDUAL COUNT FOR THIS DEVICE 02409000 CNTOK LTR R4,R4 MOVE COUNT OF ZERO ??? 02410000 BZ RDRSKIP YES -- SKIP MOVE 02411000 TM VSPCCW,1 IS IT A WRITE CCW ?? 02412000 BO GETPAGE YES IGNORE POSSIBLE SKIP FLAG 02413000 TM VSPCCW+4,SKIP READ WITH SKIP ?? 02414000 BO RDRSKIP YES -- NO DATA MOVEMENT OR PROT 02415000 * TEST. 02416000 SPACE 02417000 GETPAGE EQU * GET DATA PAGE 02418000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02419000 ALTER5 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02420100 CALL DMKPSACC CHECK IF SHARED PAGE WAS CHANGED @V304735 02421000 BZ NOTCHG5 IF NOT CONTINUE @V304735 02422000 CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02422100 B ALTER5 RE-ISSUE THE TRANS CALL @V304735 02424000 NOTCHG5 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02425000 TM VSPCCW,X'01' WILL CCW MODIFY STORAGE ? 02426000 BO KEYOK NO -- NO PROTECTION TEST 02427000 ST R0,TEMPR1 SAVE ADDRESS OF MOVE INSTRUCTION @V304735 02428000 IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02429000 CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02430000 L R0,TEMPR1 RESTORE REGISTER @V304735 02431000 BE KEYOK NO VIOLATION 02432000 B PROTCHK AND REFLECT INTERRUPT 02433000 SPACE 02434000 KEYOK EQU * HERE IF STORAGE KEYS MATCH 02435000 N R1,F4095 GET DISPLACEMENT INTO PAGE 02436000 L R15,F4096 SET SIZE OF PAGE 02437000 SR R15,R1 SUBST PAGE SIZE FROM DISPLACEMNT 02438000 CR R4,R15 R4 IS THE NUMBER OF BYTES TO BE 02439000 * MOVED 02440000 BNH ONEPAGE DATA AREA IS IN ONE PAGE 02441000 SPACE 2 02442000 * HERE IF USER'S DATA CROSSES PAGE BOUNDARY 02443000 SR R4,R15 AMOUNT OF DATA IN SECOND PAGE IN R4 02444000 BCTR R15,0 DECREMENT R15 FOR EXECUTE 02445000 LR R14,R0 POINT TO MOVE INSTRUCTION 02446000 EX R15,0(R14) EXCUTED MOVE INSTRUCTION 02447000 LA R3,1(R15,R3) BUMP POINTER TO NEXT DATA SLOT 02448000 L R1,VSPCCW GET ORIGINAL DATA ADDRESS 02449000 LA R1,1(R15,R1) POINT TO FIRST BYTE IN NEXT PAGE 02450000 B GETPAGE AND RE-EXECUTE THE SUBROUTINE 02451000 SPACE 02452000 ONEPAGE EQU * HERE WHEN REMAINING DATA IS ALL IN ONE PAGE 02453000 BCTR R4,0 DECREMENT LENGTH FOR EXECUTE 02454000 TM VSPCCW,X'01' WILL CCW MODIFY STORAGE ? 02455000 BO EXMVC NO -- GO MOVE DATA 02456000 AR R2,R4 POINT TO LAST BYTE OF DATA 02457000 ST R0,TEMPR1 SAVE ADDRESS OF MOVE INSTRUCTION @V304735 02458000 IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02459000 CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02460000 L R0,TEMPR1 RESTORE REGISTER @V304735 02461000 BNE PROTCHK PROTECTION VIOLATION 02462000 SR R2,R4 RESTORE ADDRESS OF FIRST DATA BYTE 02463000 EXMVC LR R14,R0 POINT TO MOVE INSTRUCTION 02464000 EX R4,0(R14) EXECUTE MOVE INSTRUCTION PASSED BY 02465000 * CALLER 02466000 UPCNT LA R4,1(,R4) BUMP DATA COUNT 02467000 RDRSKIP AR R3,R4 BUMP DATA ADDRESS TO NEXT BYTE IN 02468000 * BUFFER 02469000 BR R6 AND RETURN TO CALLER 02470000 EJECT 02471000 * 02472000 * MISCELLANEOUS SUBROUTINES 02473000 * 02474000 SPACE 3 02475000 PCITEST EQU * HERE TO TEST FOR A PCI INTERRUPTION 02476000 TM VSPCCW+4,PCIF IS THEIR A PCI FLAG IN THE CCW? 02477000 BCR 8,R6 NO -- LEAVE 02478000 OI VDEVCSW+5,PCI YES SET PCI IN CSW 02479000 BR R6 AND LEAVE 02480000 SPACE 3 02481000 MSG427I EQU * HERE IF SPOOL SPACE FULL 02482000 LA R2,427 ERROR MSG DMKVSP427I 02483000 USING SAVEAREA,R13 02484000 ERROMSG LA R0,2 SET AREA FOR MESSAGE 02485000 CALL DMKFREE .. 02486000 XC 0(16,R1),0(R1) CLEAR AREA 02487000 LR R3,R1 SAVE ADDRESS OF AREA 02488000 LH R1,VDEVUNIT GET FULL ADDRESS OF VIRTUAL DEVICE 02489000 CALL DMKCVTBH CONVERT ADDRESS 02490000 STCM R1,B'0111',4(R3) STORE ADDRESS IN MESSAGE AREA 02491000 MVC 8(6,R3),=C'HELD ' .. 02492000 MVC 0(3,R3),=C'RDR' MOVE IN RDR, PRT OR PUN 02493000 TM VDEVTYPC,CLASURI READER ?? 02494000 BO EMSG YES -- 02495000 LTR R7,R7 FILE BEING PURGED ?? 02496000 BNZ *+10 NO -- 02497000 MVC 8(6,R3),=C'PURGED' .. 02498000 MVC 0(3,R3),=C'CON' SET CON TYPE IN MSG 02499000 NI VDEVFLAG,X'FF'-VDEVCSPL RESET CONSOLE SPOOL ACTIVE 02500000 CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? 02501000 BE EMSG YES -- 02502000 MVC 0(3,R3),=C'PRT' .. 02503000 OI VDEVSTAT,VDEVNRDY INDICATE VIRTUAL DEVICE NOT READY 02504000 TM VDEVTYPE,TYPPRT .. 02505000 BO EMSG .. 02506000 MVC 0(3,R3),=C'PUN' .. 02507000 EMSG LA R0,16 SET UP FOR CALL TO DMKERMSG 02508000 LR R1,R3 ADDRESS OF MESSAGE 02509000 ICM R0,14,ID+3 RETURN - INSERT MODULE ID 02510000 O R2,=X'80C90000' SET RETURN TO THIS MODULE 02511000 * AND INDICATE 'I' MSG 02512000 TM VDEVSFLG,VDEVSVC ENTERED VIA CALL ?? @VM01016 02513000 BZ NOCFRUN NO, SET UP RETURN ADDRESS @VM01016 02514000 PRTRET MVI SAVEWRK2+3,8 SET ERROR RETURN CODE 8 02515000 L R6,SAVEWRK6 GET RETURN ADDRESS FOR DMKVSPRT 02516000 B CALLERM GO WRITE ERROR MESSAGE 02517000 NOCFRUN EQU * 02518000 LA R6,NOTREADY RETURN ADDRESS FOR NO-CONSOL OR SVC 02519000 SPACE 02520000 CALLERM SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02521000 CALL DMKERMSG WRITE ERROR MESSAGE @VA01460 02522000 LA R0,2 LENGTH OF MESSAGE AREA 02523000 CALL DMKFRET FRET MESSAGE AREA 02524000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02525000 BR R6 RETURN TO CALLER 02526000 SPACE 02526100 EMSG429B XC VSPCCW(8),VSPCCW CLEAR DUMMY SWAPTABLE @VA11232 02526200 LR R2,R4 RESTORE BUFFER ADDRESS @VA11232 02526300 LA R5,VSPCCW ADDRESS OF DUMMY SWAPTABLE @VA11232 02526400 EMSG429C L R4,VSPDPAGE DEALLOCATE CURRENT SLOT @VA11232 02526500 ST R4,VSPCCW+4 STORE IN DUMMY SWAPTABLE @VA11232 02526600 CALL DMKPGTSD DEALLOCATE PAGE @VA11232 02526700 EMSG429 EQU * HERE IF IO ERROR ON TRANS @VA01460 02527000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02528000 MSG429F EQU * HERE IF SPOOLING DEVICE ERROR AND 02529000 * SFBLOK TO BE FRETED 02530000 MSG429 MVC SFBLAST(4),SFBPNT CCPD OF LAST BUFFER WRITTEN @VA01460 02531000 BAL R6,PRTPUR PURGE FILE AND CLEAR BLOKS @VA00808 02532000 SPACE 02533000 MSG429I EQU * HERE IF SPOOLING I/O ERROR 02534000 LA R2,429 ERROR MSG DMKVSP429I 02535000 DROP R13 02536000 B ERROMSG WRITE ERROR MSG 02537000 EJECT 02538000 * 02539000 * HERE FOR SUBROUTINES TO HANDLE EXIT FROM DMKVSPEX TO DMKVIOEX 02540000 * 02541000 SPACE 3 02542000 NOTREADY EQU * HERE IF VDEVICE NOT READY 02543000 MVI VDEVSNSE,INTREQ SET INTERVENTION REQUIRED 02544000 UNITCHK EQU * HERE TO INDICATE UNIT CHECK -- SENSE BYTE IS ALREADY 02545000 * ESTABLISHED 02546000 OI VDEVCSW+4,UC SET UNITCHECK 02547000 TM VDEVSNSE,INTREQ DEVICE NOT READY ? @VA03803 02548000 BNZ VSPCHK YES..SEE IF FIRST CCW @VA03803 02549000 TM VDEVSNSE,CMDREJ INVALID COMMAND CODE ? @VA03803 02550000 BZ LASTCCW NO..CONTINUE... @VA03803 02551000 NI VDEVCSW+4,255-(CE+DE) UNIT CHECK ALONE @VA03803 02552000 B VSPEXIT CONTINUE... @VA03803 02553000 SPACE 3 02554000 PROTCHK EQU * HERE ON A PROTECTION VIOLATION 02555000 OI VDEVCSW+5,PRTC SET PROTECTION CHECK 02556000 CLI VDEVTYPE,TYPTIMER PSEUDO TIMER ? @VA03182 02557000 BE VSPEXIT EXIT..CC SET @VA03182 02558000 OI VDEVCSW+4,CE+DE SET CORRECT ENDING STATUS @VA03182 02559000 VSPCHK TM VDEVFLAG,VDEVCCW1 PROCESSING FIRST CCW ?? 02560000 BO VSPEXIT YES -- GENERAL EXIT 02561000 B ENDCCW AND TAKE EXIT 02562000 SPACE 3 02563000 PROGCHK1 EQU * HERE ON A PROGRAM CHECK (TRANS) @VA00716 02564000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02565000 SPACE 02566000 PROGCHK EQU * HERE ON A PROGRAM CHECK 02567000 OI VDEVCSW+5,PRGC SET CHANNEL PROGRAM CHECK 02568000 B VSPCHK AND TAKE EXIT 02569000 SPACE 02570000 PROGCHK2 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00808 02571000 OI VDEVCSW+5,PRGC INDICATE PROGRAM CHECK @VA00808 02572000 B ENDCCW POST ENDING STATUS AND EXIT @VA00808 02573000 SPACE 3 02574000 ENDCCW2 OI VDEVCSW+4,UC SET UNIT CHECK 02575000 ENDCCW NI VDEVINTS,X'FF'-(UE+UC) RESET UNUSED FLAGS 02576000 OI VDEVCSW+4,DE SET DEVICE END IN CSW 02577000 SPACE 02578000 ENDCCW1 OI VDEVCSW+4,CE SET CHANNEL END 02579000 SPACE 02580000 LASTCCW EQU * HERE TO FINISH PROCESSING THE LAST CCW 02581000 CLI VDEVTYPC,CLASURO OUTPUT DEVICE ?? 02582000 BE EXITDE YES -- 02583000 LTR R7,R7 ACTIVE FILE ?? 02584000 BNZ EXITDE YES - 02585000 BAL R6,DVICECLR GO CLEAR BLOKS 02586000 SPACE 02587000 EXITDE TM VDEVCSW+4,DE IS DE IN CSW? 02588000 BO VSPEXIT YES -- NO DE STATUS IN DEVICE 02589000 OI VDEVSTAT,VDEVPEND DE MUST BE PENDING IN DEVICE 02590000 OI VDEVINTS,DE 02591000 SPACE 3 02592000 VSPEXIT EQU * HERE FOR GENERAL EXIT 02593000 OI VDEVSTAT,VDEVCHAN SET CHANNEL INTERRUPT PENDING 02594000 USING VCHBLOK,R6 @VA00702 02595000 USING VCUBLOK,R7 @VA00702 02596000 LH R1,VDEVUNIT VIRTUAL DEVICE ADDRESS @VA00702 02597000 CALL DMKSCNVU LOC VCH AND VCU BLOKS @VA00702 02598000 BZ VSP006 ALL BLOCK FOUND - BRANCH @VA00702 02599000 * 02600000 * NO -- ONE OR MORE OF THE FOLLOWING BLOCKS ARE 02601000 * MISSING - VDEVBLOK - VCUBLOK - VCHBLOK 02602000 * 02603000 ABEND 1 ABEND VSP001 @VA00702 02604000 VSP006 DS 0H @VA10788 02605300 TM VCHTYPE,VCHSEL IS IT SELECTOR CHANNEL @VA10788 02605700 BZ VSP008 NO - BRANCH @VA00702 02606000 STH R1,VCHCEDEV SAVE ADDRESS OF UNIT @VA00702 02607000 OI VCHSTAT,VCHCEPND FLAG CHANNEL CLASS INTERRUPT @VA00702 02608000 VSP008 TM VDEVFLAG,VDEVCCW1 STILL ON 1ST CCW ? @VA00702 02609000 BZ VSPEXITX NO -- NO CHANCE FOR CC1 TO SIO 02610000 SPACE 02611000 TM VDEVCSW+4,CE+DE ANY CHANNEL OR DEVICE STATUS PENDING 02612000 BZ VSPLCC1 NO MUST BE AN UNUSUAL CONDITION 02613000 LTR R9,R9 ACTIVE FILE 02614000 BZ VSPEXITX NO - 02615000 TM VSPCCW,3 IS IT AN IMMEDIATE COMMAND? 02616000 BNO VSPEXITX NO --LEAVE 02617000 SPACE 02618000 CLI VSPCCW,X'63' FORM CONTROL LOAD ?? 02619000 BE VSPEXITX YES -- 02620000 SPACE 02621000 VSPLCC1 EQU * HERE FOR CC1 TO SIO 02622000 TM VMESTAT,VMEXTCM IS V.M. IN EXTENDED CONTROL MODE? 02623000 BZ VSP004 NO -- 02624000 OI VMPSW+2,X'10' SET CC1 IN EXTENDED PSW 02625000 B VSP005 02626000 VSP004 OI VMPSW+4,X'10' SET CC = 1 02627000 VSP005 LA R1,CSW ADDRESS OF CSW 02628000 SL R6,VMCHSTRT CHAN. DISP. @VA01770 02629000 SL R7,VMCUSTRT C.U. DISP. @VA01770 02630000 SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02631000 TRANS 2,1,OPT=(BRING,DEFER),IOER=EXIT1 GET USER PAGE 0@VA01770 02632000 AL R6,VMCHSTRT RESTORE CHAN ADDRESS @VA01770 02633000 AL R7,VMCUSTRT RESTORE C.U. ADDRESS @VA01770 02634000 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02635000 MVC 4(2,R2),VDEVCSW+4 STORE STATUS ONLY 02636000 NI VDEVSTAT,X'FF'-VDEVCHAN NO CHANNEL CLASS INTERRUPT PEND 02637000 TM VCHTYPE,VCHSEL IS IT SELECTOR CHANNEL @VA10788 02638500 BZ *+8 NO -- @VA00702 02639000 NI VCHSTAT,X'FF'-VCHCEPND RESET CE PENDING FLAG @VA00702 02640000 SPACE 3 02641000 VSPEXITX EQU * HERE TO TEST FOR AND POST PENDING INTERRUPTS 02642000 MVC VDEVCSW(1),VDEVKEY MOVE CAW KEY TO CSW 02643000 LTR R9,R9 ACTIVE FILE ?? 02644000 BZ VSP007 NO -- 02645000 TM VSPCCW,3 NO-OP-CODE ?? 02646000 BNO VSP007 NO - 02647000 CLI VSPCCW,X'63' FORM CONTROL ?? 02648000 BE VSP007 YES -- COUNT PRESENT IF ANY 02649000 MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 02650000 VSP007 TM VDEVSTAT,VDEVCHAN+VDEVPEND ANY INTERRUPTS PENDING? 02651000 BZ VSPNOINT NO -- EXIT 02652000 L R2,=A(DMKVIOMK) POINT TO INTERRUPT PENDING @VA00702 02653000 * TABLE 02654000 LH R3,VDEVADD GET DEVICE ADDRESS 02655000 AR R3,R3 TIMES 2 02656000 LA R3,0(R3,R2) POINT TO CORRECT PENDING MASK 02657000 OC VCUDVINT,0(R3) SET PENDING FLAGS IN VCUBLOK 02658000 LH R3,VCUADD GET ADDRESS OF CONTROL UNIT 02659000 SRL R3,3 TIMES 2 02660000 LA R3,0(R3,R2) POINT TO CORRECT PENDING MASK 02661000 OC VCHCUINT,0(R3) AND SET PENDING FLAG 02662000 LH R3,VCHADD GET CHANNEL ADDRESS 02663000 SRL R3,7 TIMES 2 02664000 ALR R3,R2 POINT TO MASK BYTES 02665000 OC VMIOINT,0(R3) SET CHANNEL PENDING FLAG IN VMBLOK 02666000 OI VMPEND,VMIOPND SET SUMMARY PENDING FLAG 02667000 SPACE 3 02668000 VSPNOINT EQU * HERE DIRECTLY IF NO INTERRUPTS ARE PENDING 02669000 NI VDEVSTAT,X'FF'-(VDEVBUSY+VDEVCHBS) MARK DEVICE AND SUB- 02670000 * CHANNEL AS NO LONGER BUSY 02671000 TM VDEVSFLG,VDEVCFCL IS A CONSOLE CLOSE PENDING ?? 02672000 BZ EXIT NO -- EXIT 02673000 L R9,VDEVSPL ADDRESS OF SPL BLOK 02674000 LTR R9,R9 BLOK PRESENT ?? 02675000 BZ EXIT2 NO -- FILE CLOSED 02676000 L R7,VSPSFBLK RELOAD SFBLOK ADDRESS 02677000 LA R6,EXIT2 RETURN ADDRESS 02678000 CLI VDEVTYPC,CLASURI IS THE CLOSE FOR READER ? 02679000 BNE PRTEOF NO - GO CLOSE PRINTER OR PUNCH 02680000 B RDREOF CLOSE READER 02681000 SPACE 02682000 EXIT2 NI VDEVSFLG,X'FF'-VDEVCFCL RESET PENDING FLAG 02683000 B EXIT SKIP EXIT1 RESTORES @VA01770 02684000 EXIT1 AL R6,VMCHSTRT RESTORE VCHBLOK @VA01770 02685000 AL R7,VMCUSTRT RESTORE VCUBLOK @VA01770 02686000 AL R8,VMDVSTRT RESTORE VDEVBLOK @VA01770 02687000 EXIT NI VMRSTAT,X'FF'-VMEXWAIT TAKE USER OUT OF EXWAIT 02688000 BAL R6,UNSTKBLK GO UNSTACK CPEXBLOK @VM01021 02689000 GOTO DMKDSPCH EXIT - @VM01021 02690000 SPACE 2 02691000 UNSTKBLK EQU * HERE TO UNSTACK CPEXBLOK @VM01021 02692000 * FOR THIS VIRTUAL DEVICE 02693000 TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01021 02694000 BOR R6 YES - RETURN TO CALLER @VM01021 02695000 CLI VDEVTYPE,TYP3210 CONSOLE ? @VM01021 02696000 BE GETDISP YES - FORGET BUSY TEST @VM01021 02697000 TM VDEVSTAT,VDEVBUSY DEVICE BUSY WITH SIO ? @VM01021 02698000 BOR R6 YES - RETURN TO CALLER @VM01021 02699000 USING CPEXBLOK,R1 @VM01021 02700000 GETDISP LR R3,R8 GET VDEVBLOK DISPLACEMENT @VM01021 02701000 SL R3,VMDVSTRT .. @VM01021 02702000 LA R1,VSPSTK ADDRESS OF STACK CPEXBLOKS @VM01021 02703000 NXTCPEX LR R2,R1 SAVE PREVIOUS CPEXBLOK ADDRESS @VM01021 02704000 ICM R1,B'1111',CPEXFPNT GET ADDRESS OF NEXT CPEXBLOK@VM01021 02705000 BZR R6 BRANCH IF NONE LEFT @VM01021 02706000 C R11,CPEXR11 CPEXBLOK FOR THIS USER ? @VM01021 02707000 BNE NXTCPEX NO - CHECK NEXT @VM01021 02708000 C R3,CPEXR8 CPEXBLOK FOR THIS DEVICE ? @VM01021 02709000 BNE NXTCPEX NO - CHECK NEXT @VM01021 02710000 OI VDEVSFLG,VDEVSVC INDICATE BUSY @VM01021 02711000 MVC 0(4,R2),CPEXFPNT UNCHAIN THIS CPEXBLOK @VM01021 02712000 CALL DMKSTKCP HAVE CP STACK THIS BLOK @VM01021 02713000 BR R6 RETURN TO CALLER @VM01021 02714000 SPACE 2 02715000 FCBMOVE MVC VFCBLOAD-VFCBBLOK(0,R14),12(R15) 02716000 SPACE 2 02716100 DEVID84 EQU X'84' DEVICE IDENTIFICATION @VA11722 02716200 SPACE 02717000 SPACE 2 02720000 * KEEP THE FOLLOWING THREE IN ORDER: 02721000 ENTRY DMKVSPWA EXTERNAL NAME FOR ... @VA00881 02722000 DMKVSPWA DS 0F 3211 INDEX WORK AREA ... @VA00881 02723000 WRKADD DC F'0' ADDRESS OF INDEX WORK AREA 02724000 HDRADD DC F'0' ADDRESS OF HEADER BUFFER 02725000 VSPSTK DC F'0' ADDRESS OF LOCAL STACK CPEXBLOKS 02726000 F2047 DC F'2047' 02727000 F2048 DC F'2048' 02728000 DS 0F 02729000 EJECT 02730000 LTORG 02731000 EJECT 02732000 COPY EQU 02733000 COPY RBLOKS 02734000 COPY VBLOKS 02735000 COPY VMBLOK 02736000 COPY SPOOL 02737000 PSA 02738000 COPY SAVE 02739000 COPY DEVTYPES 02740000 COPY IOBLOKS 02741000 COPY ALLOC 02742000 COPY IOER 02743000 END 02744000