|
|
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: 2304 (0x900)
Types: TextFile
Names: »tbuflengthi «
└─⟦01e83a425⟧ Bits:30008166 Bånd med SW8010 og SW8500 source code
└─⟦75ff9bef3⟧
└─⟦this⟧ »tbuflengthi «
external
integer procedure buflengthi (filename, fullinsert);
string filename; boolean fullinsert;
comment yields the needed buflength for the indexed sequential
file which is stored in the backing storage area with the name
given by filename.
the test for legal bufrefrel or the last assignment to buflengthi
may have to be changed if the definitions of f16 or the i-names in
the file-i-procedures are changed, see below;
begin
zone z(256,1,stderror); integer array ia(1:10);
integer bufrefrel, doublewords, bytes, i0, i1, i2, i3, i4, i5, i6, i7, i8, i10;
integer procedure word(byteno);
value byteno; integer byteno;
comment yields the word in the zone z with the even bytenumber
byteno+bufrefrel, first word having byte number zero;
word:= z((bufrefrel+byteno+4)//4) shift
(if (bufrefrel+byteno) mod 4 = 0 then -24 else 0) extract
24;
i0:= 0;
i10:= 18;
i1:= i0 +14;
i2:= i1 +20;
i3:= i2 +26;
i4:= i3 +i10;
i5:= i4 +i10;
i6:= i5 +i10 +2;
i7:= i6 +30;
i8:= i7 +30;
buflengthi:=0; open(z,4,filename,0); monitor(42,z,0,ia);
comment ia(1):= numberofsegments in area;
inrec6(z, 1024);
bytes:= bufrefrel:= z(1) shift (-24) extract 24 - 1;
if bufrefrel<38 or bufrefrel>2046 or bufrefrel mod 2 <> 0 then
goto exit;
if bufrefrel > 512 then
begin
setposition(z,0,bufrefrel//512);
bufrefrel:= bufrefrel mod 512; inrec6(z, 1024);
end;
doublewords:=
(bytes + i8 + ia(1)//word(i2+2)*word(i3+4) + word(i4) + word(i5) +
(if fullinsert then word(i5) else 0) + 3) // 4;
buflengthi:= if doublewords < 384 then 384 else doublewords;
exit: close(z, false);
end buflengthi;
end;
\f
▶EOF◀