home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / ucsdappleii / attach.upd.text < prev    next >
Text File  |  1986-04-07  |  5KB  |  120 lines

  1. >>>>>>>>>>>>>>>>>>>> ATTACH.UPD.TEXT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  2.  
  3. PROGRAM ATTACHUPD ;
  4.  
  5. TYPE  SD = RECORD
  6.             DISKINFO : ARRAY[0..15] OF RECORD
  7.                                          CODELENG, CODEADDR : INTEGER
  8.                                        END;
  9.             SEGNAME  : ARRAY[0..15] OF PACKED ARRAY[0..7] OF CHAR;
  10.             SEGKIND  : ARRAY[0..15] OF ( LS, HS, SP, US, SS, UI, LI, DS );
  11.             TEXTADDR : ARRAY[0..15] OF INTEGER;
  12.             SEGINFO  : PACKED ARRAY[0..15] OF PACKED RECORD
  13.                                                        SEGNUM : 0..255;
  14.                                                        MTYPE  : 0..015;
  15.                                                        UNUSED : 0..001;
  16.                                                        VERSION: 0..007
  17.                                                      END;
  18.             INTRINSEG: SET OF 0..31;
  19.             INFO     : PACKED ARRAY[0..219] OF 0..255;
  20.            END;
  21.  
  22. VAR   SEGDIC : SD;
  23.       FILENAME : STRING;
  24.       F : FILE;
  25.       OPTION,J : INTEGER;
  26.  
  27.  
  28.  
  29. PROCEDURE EXPLAIN;
  30. BEGIN
  31.   WRITELN('This program patches the FORTRAN compiler or SYSTEM.ATTACH (V1.1).');
  32.   WRITELN('They can then be used with the UCSD Pascal Version 1.2.');
  33.   WRITELN('The "Segment Version Numbers" in the SEGMENT-DICTIONARY of');
  34.   WRITELN('these files will be changed to 5.');
  35.   WRITELN('( Operating system reference manual pp. 266-269 )');
  36.   WRITELN;
  37.   WRITELN('Version 1.1 also accepts these patched files.');
  38.   WRITELN;
  39.   WRITELN('I cannot guarantee that this patch will work for all cases!');
  40.   WRITELN('( P. Terpstra, Dept. Biochemistry, Groningen )');
  41.   WRITELN;
  42.   WRITELN('Choose option 1,2,3 or 4');
  43.   WRITELN;
  44.   WRITELN('1) FORTRAN COMPILER ==> Version 1.2');
  45.   WRITELN('2) FORTRAN COMPILER ==> Restore original version bytes.');
  46.   WRITELN;
  47.   WRITELN('3) SYSTEM.ATTACH    ==> Version 1.2');
  48.   WRITELN('4) SYSTEM.ATTACH    ==> Restore original version bytes.');
  49.   WRITELN;
  50.   WRITE('Option ? ');
  51. END;
  52.  
  53. BEGIN
  54.   EXPLAIN;
  55.   READLN(OPTION);
  56.   IF (OPTION>4) OR (OPTION<1) THEN EXIT(PROGRAM);
  57.   WRITE('File is on which Volume (e.g. #4: )?  ');
  58.   READLN(FILENAME);
  59.   IF (OPTION=1) OR (OPTION=2)
  60.     THEN BEGIN
  61.            (*$I-*)
  62.            RESET(F,CONCAT(FILENAME,'SYSTEM.COMPILER'));
  63.            IF IORESULT<>0 THEN BEGIN WRITELN('Not found');EXIT(PROGRAM) END;
  64.            IF BLOCKREAD(F,SEGDIC,1,0)<>1 THEN BEGIN
  65.                                                 WRITELN('IO-Error');
  66.                                                 EXIT(PROGRAM)
  67.                                               END;
  68.            (*$I+*)
  69.            IF SEGDIC.SEGNAME[1]<>'FORTRAN:'
  70.              THEN BEGIN
  71.                     WRITELN('This is not the FORTRAN COMPILER!!');
  72.                     EXIT(PROGRAM)
  73.                   END;
  74.            IF OPTION=1
  75.              THEN BEGIN
  76.                     SEGDIC.SEGINFO[1].VERSION := 5;
  77.                     FOR J:= 7 TO 14 DO SEGDIC.SEGINFO[J].VERSION := 5;
  78.                   END
  79.              ELSE BEGIN
  80.                     SEGDIC.SEGINFO[1].VERSION := 1;
  81.                     FOR J:= 7 TO 14 DO SEGDIC.SEGINFO[J].VERSION :=1;
  82.                   END;
  83.              IF BLOCKWRITE(F,SEGDIC,1,0)<>1 THEN BEGIN
  84.                                                    WRITELN('IO-Error');
  85.                                                    EXIT(PROGRAM)
  86.                                                  END
  87.                                             ELSE WRITELN('Ready');
  88.          END;
  89.   IF (OPTION=3) OR (OPTION=4)
  90.     THEN BEGIN
  91.            (*$I-*)
  92.            RESET(F,CONCAT(FILENAME,'SYSTEM.ATTACH'));
  93.            IF IORESULT<>0 THEN BEGIN WRITELN('Not found');EXIT(PROGRAM) END;
  94.            IF BLOCKREAD(F,SEGDIC,1,0)<>1 THEN BEGIN
  95.                                                 WRITELN('IO-Error');
  96.                                                 EXIT(PROGRAM)
  97.                                               END;
  98.            (*$I+*)
  99.            IF SEGDIC.SEGNAME[1]<>'SYSATCH '
  100.              THEN BEGIN
  101.                     WRITELN('This is not SYSTEM.ATTACH!!');
  102.                     EXIT(PROGRAM)
  103.                   END;
  104.            IF OPTION=3
  105.              THEN BEGIN
  106.                     SEGDIC.SEGINFO[0].VERSION := 5;
  107.                     SEGDIC.SEGINFO[1].VERSION := 5;
  108.                   END
  109.              ELSE BEGIN
  110.                     SEGDIC.SEGINFO[0].VERSION := 0;
  111.                     SEGDIC.SEGINFO[1].VERSION := 2;
  112.                   END;
  113.              IF BLOCKWRITE(F,SEGDIC,1,0)<>1 THEN BEGIN
  114.                                                    WRITELN('IO-Error');
  115.                                                    EXIT(PROGRAM)
  116.                                                  END
  117.                                             ELSE WRITELN('Ready');
  118.          END;
  119. END.
  120.