Gen2Impl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Jean Gastinel August 10, 1987 6:44:50 pm PDT
Oracle Generation number 2
DIRECTORY
FS, IO, Rope, OracleGen;
Gen2Impl: CEDAR PROGRAM
IMPORTS FS, IO, OracleGen, Rope
~ BEGIN
OPEN OracleGen;
outf: IO.STREAM;
k : INT;
c : LONG CARDINAL;
s,s0,s1,s2,s3,r,t: Rope.ROPE;
Create or Append the file
r ← "Gen.oracle";
outf ← FS.StreamOpen[r, $create];
outf.PutF["-- Begining of the text : \n"];
s ← "00000000 00000000";
t ← "XXXXXXXX XXXXXXXX";
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
c ← 0;
s1 ← "XXXXXXXX";
s2 ← "XXXXXXXX";
s3 ← "";
FOR k IN [0..3)
DO
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat["00000000 ",s];
t ← "XXXXXXXX XXXXXXXX";
s3 ← s2;
s2 ← s1;
s1 ← s0;
IF c=0 THEN c 𡤁 ELSE c ← 2*c;
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
ENDLOOP;
FOR k IN [3..32)
DO
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat["00000000 ",s];
t ← Rope.Concat["00000000 ",s3];
s3 ← s2;
s2 ← s1;
s1 ← s0;
c ← 2*c;
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
ENDLOOP;
c ← 0;
FOR k IN [32..36)
DO
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat[s," 00000000"];
t ← Rope.Concat["00000000 ",s3];
s3 ← s2;
s2 ← s1;
s1 ← s0;
IF c=0 THEN c 𡤁 ELSE c ← 2*c;
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
ENDLOOP;
FOR k IN [36..64)
DO
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat[s," 00000000"];
t ← Rope.Concat[s3," 00000000"];
s3 ← s2;
s2 ← s1;
s1 ← s0;
IF c=0 THEN c 𡤁 ELSE c ← 2*c;
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
ENDLOOP;
outf.Close[];
END.