home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
ucsdappleii
/
attach.upd.text
< prev
next >
Wrap
Text File
|
1986-04-07
|
5KB
|
120 lines
>>>>>>>>>>>>>>>>>>>> ATTACH.UPD.TEXT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
PROGRAM ATTACHUPD ;
TYPE SD = RECORD
DISKINFO : ARRAY[0..15] OF RECORD
CODELENG, CODEADDR : INTEGER
END;
SEGNAME : ARRAY[0..15] OF PACKED ARRAY[0..7] OF CHAR;
SEGKIND : ARRAY[0..15] OF ( LS, HS, SP, US, SS, UI, LI, DS );
TEXTADDR : ARRAY[0..15] OF INTEGER;
SEGINFO : PACKED ARRAY[0..15] OF PACKED RECORD
SEGNUM : 0..255;
MTYPE : 0..015;
UNUSED : 0..001;
VERSION: 0..007
END;
INTRINSEG: SET OF 0..31;
INFO : PACKED ARRAY[0..219] OF 0..255;
END;
VAR SEGDIC : SD;
FILENAME : STRING;
F : FILE;
OPTION,J : INTEGER;
PROCEDURE EXPLAIN;
BEGIN
WRITELN('This program patches the FORTRAN compiler or SYSTEM.ATTACH (V1.1).');
WRITELN('They can then be used with the UCSD Pascal Version 1.2.');
WRITELN('The "Segment Version Numbers" in the SEGMENT-DICTIONARY of');
WRITELN('these files will be changed to 5.');
WRITELN('( Operating system reference manual pp. 266-269 )');
WRITELN;
WRITELN('Version 1.1 also accepts these patched files.');
WRITELN;
WRITELN('I cannot guarantee that this patch will work for all cases!');
WRITELN('( P. Terpstra, Dept. Biochemistry, Groningen )');
WRITELN;
WRITELN('Choose option 1,2,3 or 4');
WRITELN;
WRITELN('1) FORTRAN COMPILER ==> Version 1.2');
WRITELN('2) FORTRAN COMPILER ==> Restore original version bytes.');
WRITELN;
WRITELN('3) SYSTEM.ATTACH ==> Version 1.2');
WRITELN('4) SYSTEM.ATTACH ==> Restore original version bytes.');
WRITELN;
WRITE('Option ? ');
END;
BEGIN
EXPLAIN;
READLN(OPTION);
IF (OPTION>4) OR (OPTION<1) THEN EXIT(PROGRAM);
WRITE('File is on which Volume (e.g. #4: )? ');
READLN(FILENAME);
IF (OPTION=1) OR (OPTION=2)
THEN BEGIN
(*$I-*)
RESET(F,CONCAT(FILENAME,'SYSTEM.COMPILER'));
IF IORESULT<>0 THEN BEGIN WRITELN('Not found');EXIT(PROGRAM) END;
IF BLOCKREAD(F,SEGDIC,1,0)<>1 THEN BEGIN
WRITELN('IO-Error');
EXIT(PROGRAM)
END;
(*$I+*)
IF SEGDIC.SEGNAME[1]<>'FORTRAN:'
THEN BEGIN
WRITELN('This is not the FORTRAN COMPILER!!');
EXIT(PROGRAM)
END;
IF OPTION=1
THEN BEGIN
SEGDIC.SEGINFO[1].VERSION := 5;
FOR J:= 7 TO 14 DO SEGDIC.SEGINFO[J].VERSION := 5;
END
ELSE BEGIN
SEGDIC.SEGINFO[1].VERSION := 1;
FOR J:= 7 TO 14 DO SEGDIC.SEGINFO[J].VERSION :=1;
END;
IF BLOCKWRITE(F,SEGDIC,1,0)<>1 THEN BEGIN
WRITELN('IO-Error');
EXIT(PROGRAM)
END
ELSE WRITELN('Ready');
END;
IF (OPTION=3) OR (OPTION=4)
THEN BEGIN
(*$I-*)
RESET(F,CONCAT(FILENAME,'SYSTEM.ATTACH'));
IF IORESULT<>0 THEN BEGIN WRITELN('Not found');EXIT(PROGRAM) END;
IF BLOCKREAD(F,SEGDIC,1,0)<>1 THEN BEGIN
WRITELN('IO-Error');
EXIT(PROGRAM)
END;
(*$I+*)
IF SEGDIC.SEGNAME[1]<>'SYSATCH '
THEN BEGIN
WRITELN('This is not SYSTEM.ATTACH!!');
EXIT(PROGRAM)
END;
IF OPTION=3
THEN BEGIN
SEGDIC.SEGINFO[0].VERSION := 5;
SEGDIC.SEGINFO[1].VERSION := 5;
END
ELSE BEGIN
SEGDIC.SEGINFO[0].VERSION := 0;
SEGDIC.SEGINFO[1].VERSION := 2;
END;
IF BLOCKWRITE(F,SEGDIC,1,0)<>1 THEN BEGIN
WRITELN('IO-Error');
EXIT(PROGRAM)
END
ELSE WRITELN('Ready');
END;
END.