DataMuseum.dk

Presents historical artifacts from the history of:

RC3500

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC3500

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦a204b164d⟧ TextFileVerbose

    Length: 5376 (0x1500)
    Types: TextFileVerbose
    Names: »testpsk«

Derivation

└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system
    └─⟦72244f0ef⟧ 
        └─⟦this⟧ »testpsk« 

TextFileVerbose

process test(testname    : alfa; semvector: system_vector);

const
opbufsize= 80; (*bytes*)
messbufsize= 50; (*words*)
noofmodules= 6;
noofsemaphores= 100;
st= 300; (* storage requirements *)
pu= 0; (* processing unit number *)
pr= 1; (* priority *)
 
type
opbuftype= record
first,
top,
last: integer;
name: array (1..4) of char;
data: array (1..80) of char
end;
 
messbuftype= array (1..messbufsize) of integer;
 
var
opbufpool: pool 3 of opbuftype;
messbufpool: pool 20 of messbuftype;
opbuf: opbuftype;
messbuf: messbuftype;

countsem,
wsem,
wrsem: semaphore;
opsem: ^semaphore;

countref,
opinref,
opoutref,
cur: reference;

sem: array (1..noofsemaphores) of semaphore; (*holds the user semaphores*)
sh: array (1..noofmodules) of shadow; (*ref. to process incarn.*)
params: array (1..50) of integer; (*holds parameters from operator*)

readok: boolean; (* indicates if last call of readinteger is ok *)

command: char;

base, (*number base*)
firstword, (*used by "o"-command*)
i,
incharsleft, (*no. of not yet read chars in opinbuffer*)
inputpoint, (*no. of next char to read*)
j,
lastword, (*used by "o"-command*)
moduleno, (*tested module*)
noofparams, (*no. of params in oldbase*)
oldbase, (*used by the "b" command*)
outputpoint, (*no. of next char to write*)
semno: integer; (*typed semaphore no.*)
 
procedure getinput;
(* reads input from console into opinref^.
"command" is set to first char in opinref^*) 
begin end;
 
procedure getparams;
(* reads integer parameters *)
begin end;
 
function readchar: char;
(* reads the next char from opinref^.
inputpoint is incremented *)
begin end;
 
function readinteger: integer;
(* reads the next integer from opinref^ starting at
"inputpoint". Upon return "inputpoint" will be
the position just after the last char read.

The global boolean "readok" will be true if an
integer was read and false otherwise *)
begin end;
 
procedure outinteger (int, positions: integer);
(* writes the integer "int" into opbuf starting at
"outputpoint", which is updated accordingly.
Max. no. of positions= 20 *)
begin end;
 
procedure outstring10 (text: array (1..10) of char);
(* writes the text into opbuf starting at outputpointer
which is updated accordingly *)
begin end;
 
procedure outstring20 (text: array (1..20) of char);
(* analogue to outstring10 *)
begin end;
 
procedure writenl;
(* prepares opbuf for output to the operator and signals
it to operator module *)
begin end;

begin
(* allocate and initialize two outputbuffers and one inputbuffer.
Answersem is wsem for outputbuffers and wrsem for inputbuffer *)
 
repeat
begin
(* read a line of input from the operator and execute it *)
getinput;
 
lock opinref as opbuf: opbuftype do
begin
getparams;

case command of
 
"a": (* alloc *)
(* a buffer is allocated from the messbufpool to the current
reference "cur".
1st param is the answersem *)
;
 
"b": (* base *)
(* defines the number base for input as well as output.
The base is always read decimally *)
;
 
"c": (* create *)
(* an incarnation of one of the predefined modules to be tested
are created and started.
params are nos. of the modules to be created and started *)
;
 
"e": (* execute *)
(* executes a number of routines, predefined by the user.
params state the routines in question *)
;
 
"f": (* fill *)
(* fills integers into current buffer.
1st param: first word to be filled,
following: values to be assigned *)
;
 
"h": (* help *)
(* lists legal commands and no. of parameters *)
;
 
"k": (* kill *)
(* removes the incarnation of tested module(s) 
params are nos. of modules to be removed *)
;
 
"o": (* output *)
(* outputs current buffer incl. user parameters
1st param is firstword
2nd param is lastword *)
;

"r": (* return *)
(* returns current buffer *)
;
 
"s": (* signal *)
(* signals current buffer to one of the predefined semaphores.
1st param is semno *)
;
 
"t": (* testsem *)
(* tests the status of the specified semaphores. 
If none is specified, the status of all the user
semaphores is given.
In both cases nothing will be written for a passive
semaphore *)
;
 
"u": (* user parameters *)
(* inserts user param into header of current buffer
1st param is u1
2nd param is u2
3rd param is u3
4th param is u4 *)
;
 
 
"w": (* wait *)
(* waits for semaphore semno.
1st param is semno *)
;
 
otherwise (* error *)
(* outputs 'what?' *)
end (* case *)
end; (* lock *)
  
writenl;
end

until false;
  
end.
«eof»