MACRO 00001000
&LABEL RDTAPE &BUFFER,&LENGTH,&ADDR,&MODE=,&ERROR=*+4 00002000
GBLC &DMSMODE 00003000
LCLC &BUF,&LEN,&TAPE 00004000
LCLA &LENCNT 00004500
CNOP 0,4 00005000
&LABEL DS 0H 00006000
AIF (T'&BUFFER EQ 'O').ERR1 00007000
AIF (T'&LENGTH EQ 'O').ERR2 00008000
&BUF SETC '&BUFFER' 00009000
AIF ('&BUFFER'(1,1) NE '(').SKIP1 00010000
&BUF SETC '0' 00011000
STCM &BUFFER(1),7,DMS&SYSNDX.A+1 00012000
.SKIP1 ANOP 00013000
&LEN SETC '&LENGTH' 00014000
AIF ('&LENGTH'(1,1) NE '(').SKIP2 00015000
&LEN SETC '0' 00016000
ST &LENGTH(1),DMS&SYSNDX.B 00017000
AGO .SKIP2A @VA02030 00017500
.SKIP2 ANOP 00018000
&LENCNT SETA &LENGTH 00018100
AIF (&LENCNT LT 65536).SKIP2A 00018200
&LEN SETC '65535' 00018300
MNOTE 4,'LENGTH PARAMETER SET TO 65535' 00018400
.SKIP2A ANOP 00018500
&TAPE SETC 'TAP1' 00019000
AIF (T'&ADDR EQ 'O').NOAD 00020000
AIF ('&ADDR'(1,3) NE 'TAP').NTAP 00021000
AIF (K'&ADDR NE 4).ERR3 00022000
AIF ('&ADDR'(4,1) LT '1' OR '&ADDR'(4,1) GT '4').ERR3 00023000
&TAPE SETC '&ADDR' 00024000
AGO .NOAD 00025000
.NTAP ANOP 00026000
AIF (K'&ADDR NE 3).ERR3 00027000
&TAPE SETC '0&ADDR' 00028000
.NOAD ANOP 00029000
&DMSMODE SETC '0' 00030000
AIF (T'&MODE(1) NE 'O').YESMS @VA05521 00030300
AIF (T'&MODE(2) NE 'O').YESMS @VA05521 00030600
AIF (T'&MODE(3) NE 'O').YESMS @VA05521 00030900
AGO .NOMS @VA05521 00031200
.YESMS ANOP 00031500
DMSTMS &MODE(1),&MODE(2),&MODE(3) 00032000
.NOMS ANOP 00033000
BAL 1,DMS&SYSNDX.D 00034000
DC CL8'TAPEIO' 00035000
DC CL8'READ' 00036000
DC CL4'&TAPE' 00037000
DMS&SYSNDX.A DC BL1'&DMSMODE',AL3(&BUF) 00038000
DMS&SYSNDX.B DC F'&LEN' 00039000
DMS&SYSNDX.C DC F'0' 00040000
DMS&SYSNDX.D SVC 202 00041000
DC AL4(&ERROR) 00042000
L 0,DMS&SYSNDX.C 00043000
MEXIT 00044000
.ERR1 MNOTE 8,'BUFFER ADDRESS NOT SPECIFIED' 00045000
MEXIT 00046000
.ERR2 MNOTE 8,'LENGTH PARAMETER NOT SPECIFIED' 00047000
MEXIT 00048000
.ERR3 MNOTE 8,'INVALID DEVICE ADDRESS SPECIFIED' 00049000
MEND 00050000