begin                                                                   00001000
comment                                                                 00002000
                                                                        00003000
   This program will set the JCW WHICHMPE equal to 4 if                 00004000
we are running MPE IV and 5 if we are running MPE V.                    00005000
                                                                        00006000
endcomment;                                                             00007000
                                                                        00008000
logical array pcb(0:3);                                                 00009000
byte array bpcb(*)=pcb;                                                 00010000
                                                                        00011000
byte array jcwname(0:24):="WHICHMPE ";                                  00012000
logical jcwvalue;                                                       00013000
integer status;                                                         00014000
integer len;                                                            00015000
entry setup;                                                            00016000
byte array filename(0:26):="THISMPE.HP32002.SUPPORT*";                  00017000
integer filenum;                                                        00018000
                                                                        00019000
intrinsic putjcw,quit,fopen,fclose,fwrite,fread,read,print;             00020000
                                                                        00021000
procedure setjcw;                                                       00022000
begin                                                                   00023000
filenum:=fopen(filename,1,0);                                           00024000
if <> then quit(300);                                                   00025000
fread(filenum,pcb,-1);                                                  00026000
if <> then quit(301);                                                   00027000
if bpcb(0)="4" then                                                     00028000
  jcwvalue:=4                                                           00029000
else if bpcb(0)="5" then                                                00030000
  jcwvalue:=5                                                           00031000
else jcwvalue:=0;                                                       00032000
                                                                        00033000
putjcw(jcwname,jcwvalue,status);                                        00034000
if status <> 0 then                                                     00035000
  quit(1);                                                              00036000
end;                                                                    00037000
procedure setfile;                                                      00038000
begin                                                                   00039000
                                                                        00040000
move bpcb:="Which MPE (4 or 5)? ",2;                                    00041000
len:=@bpcb-tos;                                                         00042000
print(pcb,-len,%320);                                                   00043000
read(pcb,-1);                                                           00044000
filenum:=fopen(filename,1,1);                                           00045000
if = then begin                                                         00046000
  fclose(filenum,4,0);                                                  00047000
  if <> then quit(200);                                                 00048000
  end;                                                                  00049000
filenum:=fopen(filename,%4,1);                                          00050000
if <> then quit(201);                                                   00051000
fwrite(filenum,pcb,-1,0);                                               00052000
if <> then quit(202);                                                   00053000
fclose(filenum,1,0);                                                    00054000
if <> then quit(203);                                                   00055000
end;                                                                    00056000
                                                                        00057000
if false then                                                           00058000
                                                                        00059000
setup:                                                                  00060000
                                                                        00061000
  setfile                                                               00062000
else setjcw;                                                            00063000
                                                                        00064000
end.                                                                    00065000
