|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3840 (0xf00)
Types: TextFile
Names: »tstartdate«
└─⟦667bb35d6⟧ Bits:30007480 RC8000 Dump tape fra HCØ.
└─⟦4334b4c0b⟧
└─⟦this⟧ »tstartdate«
startdate = algol index.no
begin
message startdate dh 81.05.20 page ...01...;
message program for initializing the date and time in an
rc8000 according to operator input. the program is called:
startdate <input file>
it will then output the text 'initialize date: ' on the
input file and ask for input of 6 numbers representing
year, month, day, hour, minute, and second respectively.
the input syntax considers any non-digit to be a delimiter,
and requires a newline or an end-medium character as
terminating delimiter.
if the 6 numbers are considered to represent a legal
date, the clock will be initialized according to the date
and time given. if the syntax is violated or the date
is considered a non-legal one, the program will ask for
'initialize date' again;
comment the implementation of the central loop in the program
tries to read as many segments as possible into core before
the date is input. this may secure a short time between
the actual input and the setting of the clock, but it may
make the central loop appear awkward;
integer array days(0:4), tabel(0:127), corepic(1:6);
integer relvers, j, i, month5, year, month, day, hour, minute, second;
real time; long array field instname;
for i := 1 step 1 until 126 do tabel(i) := 7 shift 12 + i;
for i := 48 step 1 until 57 do tabel(i) := 2 shift 12 + i;
tabel(10) := tabel(25) := 8 shift 12 + 25;
tabel(0) := tabel(127) := 0;
days(0) := days(2) := days(4) := 31;
days(1) := days(3) := 30;
day := -1; time := -1;
j := year := month := hour := minute := second := 6;
intable(tabel);
system(5)move_core_from:(64)to:(corepic);
relvers := corepic(1)shift(-12)*100 + corepic(1)extract 12;
system(5)move_core_from:(1188)to:(corepic);
instname := 4;
systime(1, 1.3, 1.3); <*just for fun *>
\f
message startdate dh 81.05.20 page ...02...;
repeat
if j = 6 then
begin
if year < 100 then year := year + (if year < 69 then 2000 else 1900);
if year <= 2030 and year >= 1969 then
begin
year := year - 1968;
if month <= 12 and month >= 1 then
begin
if hour < 24 and minute < 60 and second < 60 then
begin
if month < 3 then
begin
month := month + 9; year := year - 1;
end else month := month - 3;
month5 := month mod 5;
if day <= days(month5) and day > 0 then
begin comment an extensive test of date in february omitted;
day := 59 + day + month//5*153
+ year//4*1461 + year mod 4 * 365;
for i := month5-1 step -1 until 0 do day := day + days(i);
time := ((hour*60 + minute)*60 + second) +
extend day * 86400;
end legal day in month else goto dateinput
end legal hour, minute, second else goto dateinput
end legal month in year else goto dateinput
end legal year else goto dateinput
end legal no of parameters read else
dateinput:
begin
setposition(in, 0, 0);
writeint(in, <:monitor version: :>, <<zd.dd>, relvers);
if corepic.instname(1) <> 0 then write(in, "sp", 4, corepic.instname);
if corepic(1) <> 0 then
write(in, <:<10>date of options: :>, <<zd dd dd>,
corepic(1), "sp", 2, corepic(2));
write(in, <:<10>initialize date: :>); setposition(in, 0, 0);
repeat <*this algorithm may be cheated!*>
j := read(in, year, month, day, hour, minute, second);
repeatchar(in);
while readchar(in, i) = 7 do;
until i = 25;
end;
until time > 0;
systime(3)set_clock:(time, 1.3);
end;
▶EOF◀