MACRO 00001000
RCHANNEL &ADDRESS=,&CHTYPE= 00002000
.* THIS MACRO GENERATES A REAL CHANNEL BLOCK 00005000
GBLA &CHADDR,&DEC,&RCHCNT 00006000
GBLA &RDVCNT,&RCUCNT 00006500
GBLB &RCODE 00007000
GBLC &HEX,&CHTBL(16),&CUTBL(512) 00008000
LCLA &COUNT,&INDEX 00009000
LCLC &NAME,&RCHTYPE 00010000
AIF (&RDVCNT EQ 0 OR &RCUCNT EQ 0).ERR15 00010500
AIF (K'&ADDRESS NE 1).ERR1 00011000
&HEX SETC '&ADDRESS' 00012000
HEXDEC 00013000
AIF (&RCODE).ERR1 00014000
&CHADDR SETA &DEC 00015000
&INDEX SETA &CHADDR*32+1 00016000
&NAME SETC 'RCHAN'.'&ADDRESS' 00017000
AIF ('&CHTYPE' NE 'MULTIPLEXER').MPX2 00017100
&RCHTYPE SETC 'RCHMPX' 00017200
AGO .TOK 00017300
.MPX2 ANOP 00017400
AIF ('&CHTYPE' NE 'MULTIPLEXOR').SEL 00018000
&RCHTYPE SETC 'RCHMPX' 00019000
AGO .TOK 00020000
.SEL AIF ('&CHTYPE' NE 'SELECTOR').BMX 00021000
&RCHTYPE SETC 'RCHSEL' 00022000
AGO .TOK 00023000
.BMX AIF ('&CHTYPE' NE 'BLKMPXR').ERR2 00024000
&RCHTYPE SETC 'RCHBMX' 00025000
.TOK AIF (&RCHCNT NE 0).N1ST 00026000
ENTRY DMKRIOCH 00027000
DMKRIOCH DS 0D 00028000
.N1ST ANOP 00029000
&CHTBL(&CHADDR+1) SETC '&NAME' 00030000
&NAME DS 0D 00031000
DC XL2'&ADDRESS.00' - RCHADD 00032000
DC H'0' - RCHLOCK 00033000
DC AL1(0) - RCHSTAT 00034000
DC AL1(&RCHTYPE+RCH370) -RCHTYPE 00035000
DC H'0' - RESERVED 00036000
DC A(&NAME) - RCHFIOB 00037000
DC A(&NAME) - RCHLIOB 00038000
DC 4X'00' - ERROR COUNTS 00039000
DC F'0' - RESERVED 00040000
DC A(&NAME) - RCHRSTQ 00041000
DC F'0' - RCHOPER 00042000
DS 0D RCHCUTBL 00043000
&COUNT SETA 1 00044000
.LOOP ANOP 00045000
AIF ('&CUTBL(&INDEX)' EQ '').SKIP 00046000
DC AL2(&CUTBL(&INDEX)-DMKRIOCU) 00047000
AGO .CONT 00048000
.SKIP ANOP 00049000
DC H'-1' 00050000
.CONT ANOP 00051000
&COUNT SETA &COUNT+1 00052000
&INDEX SETA &INDEX+1 00053000
AIF (&COUNT LE 32).LOOP 00054000
&RCHCNT SETA &RCHCNT+1 00055000
EJECT 00056000
MEXIT 00057000
.ERR1 MNOTE 8,'INVALID CHANNEL ADDRESS' 00058000
MEXIT 00059000
.ERR2 MNOTE 8,'INVALID CHANNEL TYPE' 00060000
MEXIT 00060300
.ERR15 MNOTE 12,'RCHANNEL MACRO OUT OF SEQUENCE' 00060700
MEND 00061000