|
|
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: »testio«
└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system
└─⟦72244f0ef⟧
└─⟦this⟧ »testio«
process testio ( pname: alfa; sv: system_vector );
const
version = 2;
empty = "############";
stop = "stop########";
type
opbuffer = record
first, last, next: integer;
name: alfa;
chars: array (6+12..6+12+80-1) of char
end;
ktable = array (1..10) of integer;
var
stat, i, num : integer;
name, txt : alfa;
t: char;
oppool: pool 3 of opbuffer;
mainsem: semaphore;
kb,
z: zone;
k: ktable:= ktable( 0, 1, 12, 123, 1234, 12345,
32767, -32768, -12345, -1 );
begin
own.incname:= pname;
openopzone ( z, sv(operatorsem), ref(z.free),
2, oppool, 2,0,0,0 );
outtext ( z, pname);
outfill ( z, ".", 3);
outnumber ( z, version, 8);
outchar ( z, nl);
outend ( z);
outhex ( z, #h0123, 2);
outhex ( z, #h4567, 3);
outhex ( z, -30293, 4); (* 89ab *)
outhex ( z, -12817, 6); (* cdef *)
outtext( z, " out.#hidde");
outchar ( z, nl);
outend ( z);
for i:= 32 to 127 do outchar ( z, chr(i));
outchar ( z, nl);
outend ( z);
for i:= 57 downto 0 do outchar ( z, chr(i));
outchar ( z, nl);
outend ( z);
txt:= "programtest.";
outtext ( z, txt);
outchar ( z, nl);
for i:= 1 to 12 do
begin
txt(13-i):= "#"; (* stop mark *)
outtext ( z, txt);
outfill ( z, "-", i);
outchar ( z, nl)
end;
outend( z);
for i:= 1 to 10 do
begin
num:= -3;
repeat
outnumber ( z, k(i), num); outchar ( z, ",");
outhex ( z, k(i), num); outchar ( z, ",");
num:= num+3
until num=9;
outchar ( z, nl);
end;
outend ( z);
openopzone ( kb, sv(operatorsem), ref(mainsem),
1, oppool, 1, 1, 1, 1);
outtext ( z, "readinteger:");
outchar ( z, nl);
outend ( z);
outtext ( z, "ready: # ");
outchar ( z, bel);
outend ( z);
repeat
readinteger ( kb, num);
if kb.readstate < 0 then
begin
opin ( kb);
opwait ( kb, oppool);
readinteger ( kb, num);
end;
stat:= kb.readstate;
outnumber ( z, num, 6);
outfill ( z, sp, 2);
readchar ( kb, t);
outchar ( z, t);
outnumber ( z, stat, 4);
outchar ( z, nl);
if t = nl then outchar ( z, bel);
outend ( z)
until num = -1 ;
outchar ( z, nl);
outtext ( z, "readhex: ");
outchar ( z, nl);
outend ( z);
repeat
readhex ( kb, num);
if kb.readstate = -1 then (* buffer empty *)
begin
opin ( kb);
opwait ( kb, oppool);
readhex ( kb, num)
end;
stat:= kb.readstate;
outnumber ( z, num, 6);
outhex ( z, num, 6);
outfill ( z, sp, 2);
readchar ( kb, t);
outchar ( z, t);
outnumber ( z, stat, 4);
outchar ( z, nl);
if t = nl then outchar ( z, bel);
outend ( z)
until num = -1 ;
outchar ( z, nl);
outtext ( z, "readname: ");
outchar ( z, nl);
outend ( z);
repeat
name:= empty;
readname ( kb, name);
if kb.readstate = -1 then (* buffer empty *)
begin
opin ( kb);
opwait ( kb, oppool);
readname ( kb, name)
end;
stat:= kb.readstate;
outtext ( z, name);
outfill ( z, sp, 2);
readchar ( kb, t);
outchar ( z, t);
outnumber ( z, stat, 4);
outchar ( z, nl);
if t = nl then outchar ( z, bel);
outend ( z)
until name = stop ;
for num:= -32768 to 32767 do
begin
outnumber ( z, num, 6);
outhex ( z, num, 6);
outchar ( z, nl)
end;
outend ( z)
end .
▶EOF◀