|
|
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: 96768 (0x17a00)
Types: TextFile
Names: »tstoslst«
└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system
└─⟦72244f0ef⟧
└─⟦this⟧ »tstoslst«
\f
tstoslst 81.02.26. 13.07. page 1
10 1
20 2
30 3
40 4 PROCESS tsopsys(VAR semvector: system_vector);
50 5
60 6 (***************************************************
70 7 *
80 8 * function: the test module is used to initialise buffers,
90 9 * signal them to semaphores, and to write their
100 10 * contents, when they have been handled by another
110 11 *
120 12 * externals: none
130 13 *
140 14 * var params: none
150 15 *
160 16 * semaphores: the module sends to the system semaphore
170 17 * "operatorsem".
180 18 *
190 19 *
200 20 * programmed may 1980 by wib and stb
210 21 *
220 22 ***************************************************)
230 23
240 24 CONST
250 25 version = "vers 3.16 /";
260 26
270 27
280 28
\f
tstoslst 81.02.26. 13.07. page 2
1010 29 CONST
1020 30 opbufsize = 80; (* no. of bytes in buffers to the operator module *)
1030 31 (*** bufs ***)
1040 32 messbufsize= size_listen; (*words*)
1050 33 testbufsize= size_listen*5;
1060 34 maxbufsize= size_listen*3;
1070 35 minbufsize= 1;
1080 36 noofmodules= 16;
1090 37 noofsemaphores= ts_sem_total;
1100 38 pu= 0; (* processing unit number *)
1110 39 pr= -1; (* timeslicing priority *)
1120 40
1130 41 valparam= "param val ";
1140 42 noparam= " no param ";
1150 43 alreadyexists= " already exists ";
1160 44 doesntexist= " doesn't exist ";
1170 45 illegalno= "illegal no";
1180 46 createerror= "error in createcall ";
1190 47
1200 48 linelength= 80;
1210 49 firstindex= 6 + alfalength;
1220 50 lastindex= firstindex + (linelength - 1);
1230 51 ok= 0; (* result from operator *)
1240 52
1250 53
1260 54 TYPE
1270 55 opbuftype=
1280 56 RECORD
1290 57 ! first,
1300 58 ! last,
1310 59 ! next: integer;
1320 60 ! name: alfa;
1330 61 ! data: ARRAY (firstindex..lastindex) OF char
1340 62 END;
1350 63
1360 64 (*** bufs ***)
1370 65 messbuftype= ARRAY (1..messbufsize) OF integer;
1380 66 testbuftype= ARRAY (1..testbufsize) OF integer;
1390 67 minbuftype = ARRAY (1.. minbufsize) OF integer;
1400 68 maxbuftype = ARRAY (1.. maxbufsize) OF integer;
1410 69
1420 70 createchtype=
1430 71 RECORD
1440 72 ! controlinfo, timeout: byte
1450 73 END;
1460 74
\f
tstoslst 81.02.26. 13.07. page 3
1470 75 atbuffer= ARRAY (0..1) OF byte;
1480 76
1490 77
1500 78 alfa10= ARRAY (1..10) OF char;
1510 79 alfa20= ARRAY (1..20) OF char;
1520 80
1530 81 (* type necessary to compare sempointers *)
1540 82 point_rec = RECORD
1550 83 ! a: sempointer;
1560 84 END;
1570 85
1580 86 VAR
1590 87 (********* pools *********)
1600 88 opbufpool: pool 3 OF opbuftype;
1610 89 (*** bufs ***)
1620 90 testbufpool: pool 12 OF testbuftype;
1630 91 messbufpool: pool no_listen OF messbuftype;
1640 92
1650 93 (********** semaphores **********)
1660 94 countsem, (* used by "t"-command *)
1670 95 wsem, (* buffers written by the operatormodule is
1680 96 returned here *)
1690 97 wrsem (* buffers with content read by the operator
1700 98 module is returned here *)
1710 99 : semaphore;
1720 100 ts_sem : ARRAY (1..ts_sem_total) OF semaphore;
1730 101
1740 102 (********** references **********)
1750 103 countref, (* used by "t"-command *)
1760 104 opinref, (* ref. to buffer from operator *)
1770 105 opoutref, (* ref. to buffer to operator *)
1780 106 cur (* ref. to current buffer *)
1790 107 : reference;
1800 108
1810 109 (********** pointers **********)
1820 110 opsem: sempointer;
1830 111 worksem: sempointer;
1840 112 sem : ts_pointer_vector;
1850 113
1860 114 (********** zones **********)
1870 115 z: zone;
1880 116
1890 117 (********** char **********)
1900 118 command: char; (* the first char the operator typed *)
1910 119
1920 120
\f
tstoslst 81.02.26. 13.07. page 4
1930 121 (********** integers **********)
1940 122 base, (* number base for input and output *)
1950 123 firstword, (* used by "o"-command *)
1960 124 i,
1970 125 incharsleft, (* no. of not yet read chars in opinbuffer *)
1980 126 j,
1990 127 k,
2000 128 lastword, (* used by "o"-command *)
2010 129 leftbyte, (* used by "p"-command *)
2020 130 moduleno, (* tested module *)
2030 131 noofparams, (* no. of params in operator line *)
2040 132 oldbase, (* used by the "b" command *)
2050 133 rightbyte, (* used by "p"-command *)
2060 134 semno, (* typed semaphore number *)
2070 135 curbufsize, (* in words *)
2080 136 curbuftype, (* 0 - 4 *)
2090 137 st (* storage requirements *)
2100 138 : integer;
2110 139
2120 140 (********** booleans **********)
2130 141 readok, (* indicates if the last call of readinteger
2140 142 yielded a result *)
2150 143 testmode
2160 144 : boolean;
2170 145
2180 146 (********** arrays **********)
2190 147 params: ARRAY(1..50) OF integer; (* holds parameters from operator *)
2200 148 sh: ARRAY(1..noofmodules) OF shadow; (* ref. to process incarn. *)
2210 149
2220 150 (********** param to use in create **********)
2230 151 dc_addr: macroaddr := macroaddr(7,0,0);
2240 152 nc_addr: macroaddr := macroaddr(7,5,0);
2250 153 ts_addr: macroaddr := macroaddr(7,5,4);
2260 154
2270 155 (*** auxiliary to compare sempointers ***)
2280 156 ap,bp : point_rec;
2290 157
\f
tstoslst 81.02.26. 13.07. page 5
3010 158 (********** externals **********)
3020 159 PROCESS tssuper(
3030 160 op: sempointer;
3040 161 VAR ts_sem : !ts_pointer_vector);
3050 162 EXTERNAL;
3060 163
3070 164 PROCESS at_handler(
3080 165 op: sempointer;
3090 166 VAR
3100 167 dc_addr,
3110 168 ts_addr: !macroaddr;
3120 169 VAR ts_sem : !ts_pointer_vector);
3130 170 EXTERNAL;
3140 171
3150 172 PROCESS vc_handler(
3160 173 op: sempointer;
3170 174 VAR
3180 175 dc_addr,
3190 176 ts_addr: !macroaddr;
3200 177 VAR ts_sem : !ts_pointer_vector);
3210 178 EXTERNAL;
3220 179
3230 180 PROCESS timeout(
3240 181 opsem: sempointer;
3250 182 VAR timeoutsem: !ts_pointer;
3260 183 ticklength, max: integer);
3270 184 EXTERNAL;
3280 185
3290 186 PROCESS atconnector(
3300 187 opsem: sempointer;
3310 188 VAR
3320 189 atcsem,
3330 190 quesem : !ts_pointer;
3340 191 VAR
3350 192 athsem,
3360 193 driversem,
3370 194 timsem,
3380 195 com_sem: !sempointer;
3390 196 VAR
3400 197 dc_addr,
3410 198 ts_addr: !macroaddr;
3420 199 ownaddr: integer;
3430 200 channelno: byte);
3440 201 EXTERNAL;
3450 202
3460 203 PROCESS vcc(
\f
tstoslst 81.02.26. 13.07. page 6
3470 204 opsem: sempointer;
3480 205 VAR
3490 206 messem,
3500 207 quesem : !ts_pointer;
3510 208 VAR
3520 209 vchsem,
3530 210 lamsem,
3540 211 timeoutsem,
3550 212 com_sem: !sempointer;
3560 213 VAR
3570 214 dcaddr,
3580 215 tsaddr: !macroaddr;
3590 216 micaddr: integer;
3600 217 channelno: byte);
3610 218 EXTERNAL;
3620 219
3630 220 PROCESS tsconnector(
3640 221 opsem: sempointer;
3650 222 VAR
3660 223 tsssem,
3670 224 dcsem,
3680 225 ncsem,
3690 226 lamsem,
3700 227 timeoutsem,
3710 228 com_sem: !sempointer;
3720 229 VAR
3730 230 inputsem,
3740 231 semint1,
3750 232 semint2,
3760 233 semint3,
3770 234 semint4: !ts_pointer);
3780 235 EXTERNAL;
3790 236
3800 237 PROCESS lam(
3810 238 opsem: sempointer;
3820 239 pu, level: integer;
3830 240 VAR inputsem: !ts_pointer);
3840 241 EXTERNAL;
3850 242
3860 243 PROCESS vagt(
3870 244 opsem: sempointer;
3880 245 VAR sem: !ts_pointer_vector);
3890 246 EXTERNAL;
3900 247
3910 248 PROCESS dcmodule(
3920 249 opsem: sempointer;
\f
tstoslst 81.02.26. 13.07. page 7
3930 250 VAR sem1,sem2,sem3,sem4: !sempointer;
3940 251 VAR sem5,sem6,sem7,sem8: !ts_pointer);
3950 252 EXTERNAL;
3960 253
3970 254 PROCESS tap(
3980 255 opsem: sempointer;
3990 256 VAR tab_sem: !ts_pointer);
4000 257 EXTERNAL;
4010 258
4020 259 PROCESS ncsup(
4030 260 opsem: sempointer;
4040 261 VAR
4050 262 main,
4060 263 free,
4070 264 done: !ts_pointer;
4080 265 VAR
4090 266 net_sem,
4100 267 timeoutsem: !sempointer);
4110 268 EXTERNAL;
4120 269
4130 270 PROCEDURE setoflowmask( oflow: boolean);
4140 271 EXTERNAL;
4150 272
4160 273
4170 274 (********** forwards **********)
4180 275
4190 276 PROCEDURE getparams;
4200 277 FORWARD;
4210 278
4220 279 PROCEDURE outdecimal(int,positions: integer);
4230 280 FORWARD;
4240 281
4250 282 PROCEDURE outinteger(int,positions: integer);
4260 283 FORWARD;
4270 284
4280 285 PROCEDURE outstring10(text: alfa10);
4290 286 FORWARD;
4300 287
4310 288 PROCEDURE outstring12(text: alfa);
4320 289 FORWARD;
4330 290
4340 291 PROCEDURE outstring20(text: alfa20);
4350 292 FORWARD;
4360 293
4370 294 FUNCTION readchar: char;
4380 295 FORWARD;
\f
tstoslst 81.02.26. 13.07. page 8
4390 296
4400 297 FUNCTION readinteger: integer;
4410 298 FORWARD;
4420 299
4430 300 PROCEDURE repeatchar;
4440 301 FORWARD;
4450 302
4460 303 PROCEDURE testmodeout (text: alfa20; i: integer);
4470 304 FORWARD;
4480 305
4490 306 PROCEDURE writenl;
4500 307 FORWARD;
4510 308
\f
tstoslst 81.02.26. 13.07. page 9
5010 309 PROCEDURE get_curbuftype;
5020 310 BEGIN
5030 311 1 ! IF cur^.size < minbufsize THEN
5040 312 2 ! curbuftype:= 0 ELSE
5050 313 3 ! IF cur^.size < messbufsize THEN
5060 314 4 ! curbuftype:= 1 ELSE
5070 315 5 ! IF cur^.size < maxbufsize THEN
5080 316 6 ! curbuftype:= 2 ELSE
5090 317 7 ! IF cur^.size < testbufsize THEN
5100 318 8 ! curbuftype:= 3 ELSE
5110 319 9 ! curbuftype:= 4;
5120 320 10 !
5130 321 11 ! CASE curbuftype OF
5140 322 12 ! ! 0: curbufsize:= 0;
5150 323 13 ! ! 1: curbufsize:= minbufsize;
5160 324 14 ! ! 2: curbufsize:= messbufsize;
5170 325 15 ! ! 3: curbufsize:= maxbufsize;
5180 326 16 ! ! 4: curbufsize:= testbufsize;
5190 327 17 ! END;
5200 328 18 END;
5210 329
\f
tstoslst 81.02.26. 13.07. page 10
6010 330 PROCEDURE getinput;
6020 331 (* reads input from console into opinref^ *)
6030 332 BEGIN
6040 333 1 !
6050 334 2 ! testmodeout ("getinput called ",0);
6060 335 3 !
6070 336 4 ! REPEAT
6080 337 5 ! ! LOCK opinref AS opbuf: opbuftype DO
6090 338 6 ! ! opbuf.next:= firstindex;
6100 339 7 ! ! signal (opinref, opsem^);
6110 340 8 ! ! wait (opinref, wrsem);
6120 341 9 ! UNTIL opinref^.u2= ok (* 0*);
6130 342 10 !
6140 343 11 ! LOCK opinref AS opbuf: opbuftype DO
6150 344 12 ! WITH opbuf DO
6160 345 13 ! BEGIN
6170 346 14 ! ! incharsleft:= next - first;
6180 347 15 ! ! next:= firstindex;
6190 348 16 ! END;
6200 349 17 ! command:= readchar;
6210 350 18 !
6220 351 19 ! testmodeout ("command read: ",ord(command));
6230 352 20 !
6240 353 21 ! getparams;
6250 354 22 END (* getinput *);
6260 355
\f
tstoslst 81.02.26. 13.07. page 11
7010 356 PROCEDURE getparams;
7020 357 (* reads integer parameters *)
7030 358 VAR newbase: boolean;
7040 359 BEGIN
7050 360 1 ! testmodeout ("getparams called ",0);
7060 361 2 !
7070 362 3 ! noofparams:= 0;
7080 363 4 !
7090 364 5 ! IF command IN (."a","b","c","e","f","k","o","p","s","t","w","x".)
7100 365 6 ! THEN
7110 366 7 ! BEGIN (* change to decimal *)
7120 367 8 ! ! oldbase:= base;
7130 368 9 ! ! base:= 10;
7140 369 10 ! ! newbase:= true;
7150 370 11 ! END
7160 371 12 ! ELSE
7170 372 13 ! newbase:= false;
7180 373 14 !
7190 374 15 ! REPEAT
7200 375 16 ! ! noofparams:= noofparams + 1;
7210 376 17 ! ! params(noofparams):= readinteger;
7220 377 18 ! ! testmodeout ("parameter read: ",params(noofparams));
7230 378 19 ! ! IF (noofparams=1) THEN
7240 379 20 ! ! IF command IN (."f","p".) THEN
7250 380 21 ! ! BEGIN (* change to old *)
7260 381 22 ! ! ! base:= oldbase;
7270 382 23 ! ! ! newbase:= false;
7280 383 24 ! ! END;
7290 384 25 ! !
7300 385 26 ! UNTIL (NOT readok) OR (noofparams= 50);
7310 386 27 !
7320 387 28 ! noofparams:= noofparams - 1;
7330 388 29 !
7340 389 30 ! IF newbase THEN
7350 390 31 ! (* change back to old base *)
7360 391 32 ! base:= oldbase;
7370 392 33 END (* getparams *);
7380 393
\f
tstoslst 81.02.26. 13.07. page 12
8010 394 PROCEDURE init_proc(
8020 395 index: integer;
8030 396 name,
8040 397 inc_name : alfa;
8050 398 p : processrec;
8060 399 size,
8070 400 prio : integer);
8080 401 VAR
8090 402 okl,
8100 403 ok : integer;
8110 404 BEGIN
8120 405 1 ! IF NOT nil(sh(index)) THEN
8130 406 2 ! outstring20(alreadyexists) ELSE
8140 407 3 ! BEGIN
8150 408 4 ! ! IF noofparams<2 THEN st:= size;
8160 409 5 ! ! okl:= link(name,p.processref^);
8170 410 6 ! ! ok:= create(inc_name,p,sh(index),st);
8180 411 7 ! ! IF ok=0 THEN
8190 412 8 ! ! start(sh(index),prio) ELSE
8200 413 9 ! ! BEGIN
8210 414 10 ! ! ! ok:= ok*100+okl;
8220 415 11 ! ! ! outstring20(createerror);
8230 416 12 ! ! ! outstring12(inc_name);
8240 417 13 ! ! ! outdecimal(ok,5);
8250 418 14 ! ! ! writenl;
8260 419 15 ! ! ! okl:= unlink(p.processref^);
8270 420 16 ! ! END;
8280 421 17 ! END;
8290 422 18 END;
8300 423
\f
tstoslst 81.02.26. 13.07. page 13
9010 424 PROCEDURE init_modul(index: integer);
9020 425 CONST
9030 426 n1 = "tssupervisor";
9040 427 n2 = "at_handler ";
9050 428 n3 = "vc_handler ";
9060 429 n4 = "timeout ";
9070 430 n5 = "atconnector ";
9080 431 n6 = "vcatc ";
9090 432 n7 = "tsconnector ";
9100 433 n8 = "atvagtsim ";
9110 434 n9 = "lam ";
9120 435 n10= "tap ";
9130 436 n11= "dcmodule ";
9140 437 n13= "ncsupervisor";
9150 438 n14= "vcitc ";
9160 439 n15= "itvagtsim ";
9170 440 n16= "alc ";
9180 441 BEGIN
9190 442 1 ! CASE index OF
9200 443 2 ! ! 1: (* tssup *)
9210 444 3 ! ! init_proc(index, n1, n1,
9220 445 4 ! ! tssuper( opsem, sem),
9230 446 5 ! ! tss_size,tss_pri);
9240 447 6 ! ! 2: (* ath *)
9250 448 7 ! ! init_proc(index, n2, n2,
9260 449 8 ! ! at_handler( opsem, dc_addr, ts_addr, sem),
9270 450 9 ! ! ath_size,ath_pri);
9280 451 10 ! ! 3: (* vch *)
9290 452 11 ! ! init_proc(index, n3, n3,
9300 453 12 ! ! vc_handler( opsem, dc_addr, ts_addr, sem),
9310 454 13 ! ! vch_size,vch_pri);
9320 455 14 ! ! 4: (* timeout *)
9330 456 15 ! ! init_proc(index, n4, n4,
9340 457 16 ! ! timeout( opsem, sem(timeout_sem_no), time_out_unit, 40),
9350 458 17 ! ! tim_size,tim_pri);
9360 459 18 ! ! 5: (* atc *)
9370 460 19 ! ! init_proc(index, n5, n5,
9380 461 20 ! ! atconnector( opsem, sem(atc_sem_no), sem(atc_sem_no+1),
9390 462 21 ! ! sem(ath_sem_no).s, sem(lam_sem_no).s, sem(timeout_sem_no).s,
9400 463 22 ! ! sem(com_pool).w, dc_addr, ts_addr, 257, 7),
9410 464 23 ! ! atc_size,atc_pri);
9420 465 24 ! ! 6: (* vcatc *)
9430 466 25 ! ! init_proc(index, n6, n6,
9440 467 26 ! ! vcc( opsem, sem(vcc_sem_no), sem(vcc_sem_no+1),
9450 468 27 ! ! sem(vch_sem_no).s, sem(vas_sem_no).s, sem(timeout_sem_no).s,
9460 469 28 ! ! sem(com_pool).w, dc_addr, ts_addr, 63, 2),
\f
tstoslst 81.02.26. 13.07. page 14
9470 470 29 ! ! vac_size, vcc_pri);
9480 471 30 ! ! 7: (* tsc *)
9490 472 31 ! ! init_proc(index, n7, n7,
9500 473 32 ! ! tsconnector( opsem, sem(tssup_sem_no).s,
9510 474 33 ! ! sem(dc_sem_no).s,
9520 475 34 ! ! sem(nc_sem_no).s, sem(lam_sem_no).s, sem(timeout_sem_no).s,
9530 476 35 ! ! sem(com_pool).w, sem(netc_sem_no),
9540 477 36 ! ! sem(net_int1), sem(net_int2),
9550 478 37 ! ! sem(net_int3), sem(net_int4)),
9560 479 38 ! ! tsc_size, tsc_pri);
9570 480 39 ! ! 8: (* atvagtsim *)
9580 481 40 ! ! init_proc(index, n8, n8,
9590 482 41 ! ! vagt( opsem, sem),
9600 483 42 ! ! vas_size, vc_sim_pri);
9610 484 43 ! ! 9: (* lam *)
9620 485 44 ! ! init_proc(index, n9, n9,
9630 486 45 ! ! lam( opsem, pu, 5, sem(lam_sem_no)),
9640 487 46 ! ! lam_size, lam_pri);
9650 488 47 ! ! 10: (* tap *)
9660 489 48 ! ! init_proc(index, n10, n10,
9670 490 49 ! ! tap( opsem, sem(tap_sem_no)),
9680 491 50 ! ! 512, 0);
9690 492 51 ! ! 11: (* dc *)
9700 493 52 ! ! init_proc(index, n11, n11,
9710 494 53 ! ! dcmodule( opsem, sem(lam_sem_no).s, sem(netc_sem_no).s,
9720 495 54 ! ! sem(com_pool).w, sem(timeout_sem_no).s,
9730 496 55 ! ! sem(dc_sem_no), sem(dc_int1), sem(dc_int2), sem(dc_int3)),
9740 497 56 ! ! dc_sim_size, dc_sim_pri);
9750 498 57 ! ! 12: (* tap01 *)
9760 499 58 ! ! init_proc(index, n10, "tap01 ",
9770 500 59 ! ! tap ( opsem, sem(tap1_sem_no)),
9780 501 60 ! ! 512, 0);
9790 502 61 ! ! 13: (* ncsupervisor *)
9800 503 62 ! ! init_proc(index, n13, n13,
9810 504 63 ! ! ncsup( opsem, sem(nc_sem_no), sem(ncsup_int1), sem(ncsup_int2),
9820 505 64 ! ! sem(netc_sem_no).s, sem(timeout_sem_no).s),
9830 506 65 ! ! nc_sup_size, tss_pri);
9840 507 66 ! ! 14: (* vcitc *)
9850 508 67 ! ! init_proc(index, n14, n14,
9860 509 68 ! ! vcc( opsem, sem(vcc_sem_no+2), sem(vcc_sem_no+3),
9870 510 69 ! ! sem(vch_sem_no).s, sem(vis_sem_no).s, sem(timeout_sem_no).s,
9880 511 70 ! ! sem(com_pool).w, dc_addr, ts_addr, 64, 3),
9890 512 71 ! ! vic_size, vcc_pri);
9900 513 72 ! ! 15: (* itvagtsim *)
9910 514 73 ! ! init_proc(index, n15, n15,
9920 515 74 ! ! vagt( opsem, sem),
\f
tstoslst 81.02.26. 13.07. page 15
9930 516 75 ! ! vis_size, vc_sim_pri);
9940 517 76 ! ! OTHERWISE
9950 518 77 ! ! BEGIN
9960 519 78 ! ! ! outdecimal(index,4);
9970 520 79 ! ! ! outstring10(illegalno);
9980 521 80 ! ! END;
9990 522 81 ! END (* case *)
10000 523 82 END;
10010 524
\f
tstoslst 81.02.26. 13.07. page 16
11010 525 FUNCTION moduleready(moduleno: integer): boolean;
11020 526 (* tests if an incarnation of the module is existing
11030 527 and writes an errormessage if so *)
11040 528 BEGIN
11050 529 1 ! IF nil( sh( moduleno) ) THEN moduleready:=true
11060 530 2 ! ELSE
11070 531 3 ! BEGIN (* module is already existing *)
11080 532 4 ! ! outdecimal(moduleno,4);
11090 533 5 ! ! outstring20(alreadyexists);
11100 534 6 ! ! moduleready:=false;
11110 535 7 ! END;
11120 536 8 END (* module ready *);
11130 537
11140 538
11150 539
\f
tstoslst 81.02.26. 13.07. page 17
12010 540 PROCEDURE outchar(ch:char);
12020 541 (* writes ch into the output buffer *)
12030 542 BEGIN
12040 543 1 ! LOCK opoutref AS opbuf: opbuftype DO
12050 544 2 ! WITH opbuf DO
12060 545 3 ! BEGIN
12070 546 4 ! ! last:= last + 1;
12080 547 5 ! ! data (last):= ch;
12090 548 6 ! END;
12100 549 7 END (* outchar *);
12110 550
\f
tstoslst 81.02.26. 13.07. page 18
13010 551 PROCEDURE outdecimal (int, positions: integer);
13020 552 (* writes the integer "int" decimally into opbuf starting
13030 553 at "last", which is updated accordingly *)
13040 554
13050 555 BEGIN
13060 556 1 ! oldbase:= base;
13070 557 2 ! base:= 10;
13080 558 3 ! outinteger(int,positions);
13090 559 4 ! base:= oldbase;
13100 560 5 END (* outdecimal *);
13110 561
\f
tstoslst 81.02.26. 13.07. page 19
14010 562 PROCEDURE outinteger(int,positions:integer);
14020 563 (* writes the integer "int" into opbuf starting at
14030 564 "last", which is updated accordingly *)
14040 565 CONST
14050 566 maxpos = 20; (* max number of positions in layout *)
14060 567
14070 568 VAR
14080 569 bits: ARRAY(0..15) OF bit;
14090 570 digits:ARRAY(1..maxpos) OF char;
14100 571 curdigit, (* current pos. in digits-array to be filled out *)
14110 572 curpos, (* cur. pos. in the nunber being computed *)
14120 573 h, i,
14130 574 m, newm,
14140 575 noofdig, (* no. of digits in the resulting number *)
14150 576 noofpos, (* no. of pos. from bits-array for one number *)
14160 577 res, (* resulting number *)
14170 578 used: integer;
14180 579
14190 580 negative, zeroes: boolean;
14200 581
14210 582 BEGIN
14220 583 1 ! used:= 1;
14230 584 2 !
14240 585 3 ! (* first we initialise the digits array *)
14250 586 4 ! FOR i:=1 TO maxpos DO digits(i):=sp;
14260 587 5 !
14270 588 6 ! IF base= 10 THEN
14280 589 7 ! BEGIN
14290 590 8 ! ! i:=maxpos;
14300 591 9 ! !
14310 592 10 ! ! negative:= int<0;
14320 593 11 ! !
14330 594 12 ! ! REPEAT
14340 595 13 ! ! ! (* now we unpack the digits backwards and put them
14350 596 14 ! ! ! into the digits array *)
14360 597 15 ! ! !
14370 598 16 ! ! ! digits(i):= chr (abs(int MOD base) + ord("0"));
14380 599 17 ! ! ! int:=int DIV base;
14390 600 18 ! ! ! i:=i-1;
14400 601 19 ! ! UNTIL (i=1) OR (int=0);
14410 602 20 ! !
14420 603 21 ! ! IF negative THEN
14430 604 22 ! ! BEGIN
14440 605 23 ! ! ! digits(i):="-";
14450 606 24 ! ! ! i:=i-1;
14460 607 25 ! ! END;
\f
tstoslst 81.02.26. 13.07. page 20
14470 608 26 ! !
14480 609 27 ! ! used:=maxpos-i;
14490 610 28 ! !
14500 611 29 ! ! IF int <> 0 THEN digits(1):= "*";
14510 612 30 ! END (* if base= 10 *)
14520 613 31 !
14530 614 32 ! ELSE (* base= 2, 8, or 16 *)
14540 615 33 ! BEGIN
14550 616 34 ! ! (* initialise bits-array *)
14560 617 35 ! ! IF int>=0 THEN
14570 618 36 ! ! BEGIN
14580 619 37 ! ! ! FOR i:= 15 DOWNTO 1 DO
14590 620 38 ! ! ! BEGIN
14600 621 39 ! ! ! ! bits(i):= int MOD 2;
14610 622 40 ! ! ! ! int:= int DIV 2;
14620 623 41 ! ! ! END;
14630 624 42 ! ! ! bits(0):= int MOD 2;
14640 625 43 ! ! ! int:= int DIV 2;
14650 626 44 ! ! END
14660 627 45 ! ! ELSE
14670 628 46 ! ! (* int<0 *)
14680 629 47 ! ! BEGIN
14690 630 48 ! ! ! (* subtract abs(int) from 1111111...1 *)
14700 631 49 ! ! ! FOR i:= 15 DOWNTO 1 DO
14710 632 50 ! ! ! BEGIN
14720 633 51 ! ! ! ! bits(i):= 1+(int MOD 2);
14730 634 52 ! ! ! ! int:= int DIV 2;
14740 635 53 ! ! ! END;
14750 636 54 ! ! ! bits(0):= 1+(int MOD 2);
14760 637 55 ! ! ! int:= int DIV 2;
14770 638 56 ! ! !
14780 639 57 ! ! ! (* add 1 *)
14790 640 58 ! ! ! m:= 1;
14800 641 59 ! ! ! FOR i:= 15 DOWNTO 1 DO
14810 642 60 ! ! ! BEGIN
14820 643 61 ! ! ! ! newm:= (bits(i)+m) DIV 2;
14830 644 62 ! ! ! ! bits(i):= (bits(i)+m) MOD 2;
14840 645 63 ! ! ! ! m:= newm;
14850 646 64 ! ! ! END;
14860 647 65 ! ! ! newm:= (bits(0)+m) DIV 2;
14870 648 66 ! ! ! bits(0):= (bits(0)+m) MOD 2;
14880 649 67 ! ! ! m:= newm;
14890 650 68 ! ! END (*int<0*);
14900 651 69 ! !
14910 652 70 ! ! (* compute digits-array *)
14920 653 71 ! ! CASE base OF
\f
tstoslst 81.02.26. 13.07. page 21
14930 654 72 ! ! ! 2: BEGIN
14940 655 73 ! ! ! ! noofpos:= 1;
14950 656 74 ! ! ! ! noofdig:= 16;
14960 657 75 ! ! ! END;
14970 658 76 ! ! !
14980 659 77 ! ! ! 8: BEGIN
14990 660 78 ! ! ! ! noofpos:= 3;
15000 661 79 ! ! ! ! noofdig:= 6;
15010 662 80 ! ! ! END;
15020 663 81 ! ! !
15030 664 82 ! ! ! 16: BEGIN
15040 665 83 ! ! ! ! noofpos:= 4;
15050 666 84 ! ! ! ! noofdig:= 4;
15060 667 85 ! ! ! END;
15070 668 86 ! ! END (* case *);
15080 669 87 ! !
15090 670 88 ! ! curdigit:= maxpos -noofdig +1;
15100 671 89 ! !
15110 672 90 ! ! IF base= 8
15120 673 91 ! ! THEN curpos:= 3
15130 674 92 ! ! ELSE curpos:= 1;
15140 675 93 ! ! res:= 0;
15150 676 94 ! ! zeroes:= true;
15160 677 95 ! !
15170 678 96 ! ! FOR h:= 0 TO 15 DO
15180 679 97 ! ! BEGIN
15190 680 98 ! ! ! res:= res*2 + bits(h);
15200 681 99 ! ! ! IF curpos= noofpos THEN
15210 682 100 ! ! ! BEGIN (* time to fill out a pos. in digits-array *)
15220 683 101 ! ! ! ! IF zeroes AND (res=0) THEN
15230 684 102 ! ! ! ! BEGIN
15240 685 103 ! ! ! ! ! IF curdigit=maxpos
15250 686 104 ! ! ! ! ! THEN digits(curdigit):= "0"
15260 687 105 ! ! ! ! ! (*else digits (curdigit):= " "*);
15270 688 106 ! ! ! ! END
15280 689 107 ! ! ! ! ELSE
15290 690 108 ! ! ! ! IF res<=9
15300 691 109 ! ! ! ! THEN digits(curdigit):= chr (res + ord ("0"))
15310 692 110 ! ! ! ! ELSE digits(curdigit):= chr (res + ord ("7"));
15320 693 111 ! ! ! ! IF (res<>0) AND zeroes THEN
15330 694 112 ! ! ! ! BEGIN
15340 695 113 ! ! ! ! ! zeroes:= false;
15350 696 114 ! ! ! ! ! used:= maxpos - curdigit + 1;
15360 697 115 ! ! ! ! END;
15370 698 116 ! ! ! ! res:= 0;
15380 699 117 ! ! ! ! curpos:= 0;
\f
tstoslst 81.02.26. 13.07. page 22
15390 700 118 ! ! ! ! curdigit:= curdigit + 1;
15400 701 119 ! ! ! END;
15410 702 120 ! ! ! curpos:= curpos + 1;
15420 703 121 ! ! END;
15430 704 122 ! END (* base= 2, 8, of 16 *);
15440 705 123 !
15450 706 124 ! IF positions<used THEN outchar(sp);
15460 707 125 !
15470 708 126 ! IF (NOT (positions IN (. 1 .. maxpos .)) )
15480 709 127 ! OR (positions < used) THEN
15490 710 128 ! positions:=used;
15500 711 129 !
15510 712 130 ! FOR i:=maxpos+1-positions TO maxpos DO
15520 713 131 ! BEGIN
15530 714 132 ! ! outchar( digits(i) );
15540 715 133 ! END
15550 716 134 !
15560 717 135 END (* out integer *);
15570 718
15580 719
15590 720
\f
tstoslst 81.02.26. 13.07. page 23
16010 721 PROCEDURE outstring10(text: alfa10);
16020 722 (* writes the text into opbuf starting at outputpointer
16030 723 which is updated accordingly *)
16040 724 VAR
16050 725 i: integer;
16060 726 BEGIN
16070 727 1 ! FOR i:=1 TO 10 DO
16080 728 2 ! outchar( text(i) );
16090 729 3 END (* out string 10 *);
16100 730
16110 731 PROCEDURE outstring12(text: alfa);
16120 732 VAR
16130 733 i: integer;
16140 734 BEGIN
16150 735 1 ! FOR i:=1 TO 12 DO
16160 736 2 ! outchar(text(i));
16170 737 3 END;
16180 738
\f
tstoslst 81.02.26. 13.07. page 24
17010 739 PROCEDURE outstring20(text: alfa20);
17020 740 (* analogue to outstring10 *)
17030 741 VAR
17040 742 i: integer;
17050 743 BEGIN
17060 744 1 ! FOR i:=1 TO 20 DO
17070 745 2 ! outchar( text(i) );
17080 746 3 END (* out string 20 *);
17090 747
17100 748
17110 749
17120 750
\f
tstoslst 81.02.26. 13.07. page 25
18010 751 FUNCTION readchar: char;
18020 752 (* reads the next char from opinref^.
18030 753 next is incremented and charsleft is
18040 754 decremented *)
18050 755 BEGIN
18060 756 1 ! LOCK opinref AS opbuf: opbuftype DO
18070 757 2 ! WITH opbuf DO
18080 758 3 ! BEGIN
18090 759 4 ! ! readchar:= data(next);
18100 760 5 ! ! next:= next + 1;
18110 761 6 ! END;
18120 762 7 ! incharsleft:=incharsleft-1;
18130 763 8 END (* readchar *);
18140 764
18150 765
18160 766
18170 767
\f
tstoslst 81.02.26. 13.07. page 26
19010 768 FUNCTION readinteger : integer;
19020 769 (* reads the next integer from opinref^ starting
19030 770 at "inputpoint". upon return "inputpoint" will be
19040 771 the position just after the last char read.
19050 772
19060 773 the global boolean "readok" will be true if an
19070 774 integer was read and false otherwise *)
19080 775
19090 776 CONST
19100 777 digits = (. "0" .. "9" .);
19110 778 hexdigits = (. "a" .. "f" .);
19120 779 signs = (. "+" , "-" .);
19130 780
19140 781 VAR
19150 782 negative, digit: boolean;
19160 783
19170 784 curdigit, noofdigit,
19180 785 result: integer;
19190 786
19200 787 ch,lastchar: char;
19210 788
19220 789
19230 790 BEGIN
19240 791 1 ! readok:=false;
19250 792 2 ! lastchar:=nul;
19260 793 3 ! ch:=nul;
19270 794 4 ! digit:=false;
19280 795 5 !
19290 796 6 ! (* now skip until a digit is encountered *)
19300 797 7 !
19310 798 8 ! IF incharsleft > 0 THEN
19320 799 9 ! REPEAT
19330 800 10 ! ! lastchar:=ch;
19340 801 11 ! ! ch:=readchar;
19350 802 12 ! ! digit:= (ch IN digits) OR
19360 803 13 ! ! ((base= 16) AND (ch IN hexdigits))
19370 804 14 ! UNTIL digit OR (incharsleft<=0);
19380 805 15 !
19390 806 16 ! result:=0;
19400 807 17 ! IF base= 10 THEN
19410 808 18 ! negative:= lastchar= "-"
19420 809 19 ! ELSE negative:= false;
19430 810 20 !
19440 811 21 !
19450 812 22 ! IF digit THEN
19460 813 23 ! BEGIN
\f
tstoslst 81.02.26. 13.07. page 27
19470 814 24 ! ! IF ch IN digits
19480 815 25 ! ! THEN result:= ord (ch) - ord ("0")
19490 816 26 ! ! ELSE result:= ord (ch) - 87 (*ord ("W")*);
19500 817 27 ! ! readok:=true;
19510 818 28 ! END;
19520 819 29 !
19530 820 30 ! IF base=10 THEN
19540 821 31 ! BEGIN
19550 822 32 ! ! WHILE digit AND (incharsleft>0) DO
19560 823 33 ! ! BEGIN (* read the digits *)
19570 824 34 ! ! ! ch:= readchar;
19580 825 35 ! ! !
19590 826 36 ! ! ! digit:= (ch IN digits) OR
19600 827 37 ! ! ! ((base= 16) AND (ch IN hexdigits));
19610 828 38 ! ! ! IF digit THEN
19620 829 39 ! ! ! BEGIN
19630 830 40 ! ! ! ! IF negative AND (result=3276) AND (ch="8")
19640 831 41 ! ! ! ! THEN BEGIN
19650 832 42 ! ! ! ! ! result:= -32768;
19660 833 43 ! ! ! ! ! negative:= false;
19670 834 44 ! ! ! ! END
19680 835 45 ! ! ! ! ELSE
19690 836 46 ! ! ! ! BEGIN
19700 837 47 ! ! ! ! ! IF ch IN digits
19710 838 48 ! ! ! ! ! THEN result:= result*base+(ord(ch)-ord("0"))
19720 839 49 ! ! ! ! ! ELSE result:= result*base+(ord(ch)-87(*ord("W")*));
19730 840 50 ! ! ! ! END;
19740 841 51 ! ! ! END;
19750 842 52 ! ! END (* while *);
19760 843 53 ! !
19770 844 54 ! ! IF negative THEN result:= - result;
19780 845 55 ! !
19790 846 56 ! END (* base= 10 *)
19800 847 57 !
19810 848 58 ! ELSE
19820 849 59 ! BEGIN (* base= 2, 8, or 16 *)
19830 850 60 ! !
19840 851 61 ! ! CASE base OF
19850 852 62 ! ! ! 2:BEGIN
19860 853 63 ! ! ! ! IF ch="1" THEN negative:= true;
19870 854 64 ! ! ! ! noofdigit:= 16;
19880 855 65 ! ! ! END;
19890 856 66 ! ! !
19900 857 67 ! ! ! 8: BEGIN
19910 858 68 ! ! ! ! IF ch="1" THEN negative:= true;
19920 859 69 ! ! ! ! noofdigit:= 6;
\f
tstoslst 81.02.26. 13.07. page 28
19930 860 70 ! ! ! END;
19940 861 71 ! ! !
19950 862 72 ! ! ! 16: BEGIN
19960 863 73 ! ! ! ! IF ch>="8" THEN negative:= true;
19970 864 74 ! ! ! ! noofdigit:= 4;
19980 865 75 ! ! ! END;
19990 866 76 ! ! END (*case*);
20000 867 77 ! ! curdigit:= 1;
20010 868 78 ! !
20020 869 79 ! ! WHILE digit AND (incharsleft>0) DO
20030 870 80 ! ! BEGIN
20040 871 81 ! ! ! ch:= readchar;
20050 872 82 ! ! ! digit:= (ch IN digits) OR
20060 873 83 ! ! ! ((base=16) AND (ch IN hexdigits));
20070 874 84 ! ! ! IF digit
20080 875 85 ! ! ! THEN BEGIN
20090 876 86 ! ! ! ! curdigit:= curdigit+1;
20100 877 87 ! ! ! ! IF (curdigit=noofdigit) AND negative THEN
20110 878 88 ! ! ! ! BEGIN
20120 879 89 ! ! ! ! ! CASE base OF
20130 880 90 ! ! ! ! ! ! 2: result:= result - 16384 (*2^14*);
20140 881 91 ! ! ! ! ! ! 8: result:= result - 4096 (*2^12*);
20150 882 92 ! ! ! ! ! ! 16:result:= result - 2048 (*2^11*);
20160 883 93 ! ! ! ! ! END (*case*)
20170 884 94 ! ! ! ! END;
20180 885 95 ! ! ! ! IF ch IN digits THEN
20190 886 96 ! ! ! ! result:= result*base + (ord(ch)-ord("0"))
20200 887 97 ! ! ! ! ELSE
20210 888 98 ! ! ! ! result:= result*base + (ord(ch)-87 (*ord("W")*));
20220 889 99 ! ! ! ! IF (curdigit=noofdigit) AND negative
20230 890 100 ! ! ! ! THEN BEGIN
20240 891 101 ! ! ! ! ! IF result=0
20250 892 102 ! ! ! ! ! THEN result:= -32768
20260 893 103 ! ! ! ! ! ELSE result:= -((32767-result)+1);
20270 894 104 ! ! ! ! END;
20280 895 105 ! ! ! END (*if digit*);
20290 896 106 ! ! END (*while digit*);
20300 897 107 ! END (* base= 2, 8, or 16 *);
20310 898 108 ! IF incharsleft > 0 THEN
20320 899 109 ! (* we read one char too many - spit it out *)
20330 900 110 ! repeatchar;
20340 901 111 !
20350 902 112 ! readinteger:=result;
20360 903 113 END (* read integer *);
20370 904
\f
tstoslst 81.02.26. 13.07. page 29
21010 905 PROCEDURE repeatchar;
21020 906 BEGIN
21030 907 1 ! LOCK opinref AS opbuf: opbuftype DO
21040 908 2 ! opbuf.next:= opbuf.next - 1;
21050 909 3 ! incharsleft:= incharsleft + 1;
21060 910 4 END;
21070 911
\f
tstoslst 81.02.26. 13.07. page 30
22010 912 FUNCTION testinterval (i,first,last: integer): boolean;
22020 913 (* true if first<=i<=last *)
22030 914 BEGIN
22040 915 1 ! IF (i<first) OR (i>last) THEN
22050 916 2 ! BEGIN
22060 917 3 ! ! outstring10(illegalno);
22070 918 4 ! ! outinteger(i,4);
22080 919 5 ! ! writenl;
22090 920 6 ! ! testinterval:= false
22100 921 7 ! END
22110 922 8 ! ELSE
22120 923 9 ! testinterval:= true;
22130 924 10 END;
22140 925
\f
tstoslst 81.02.26. 13.07. page 31
23010 926 PROCEDURE testmodeout (text: alfa20; i: integer);
23020 927 BEGIN
23030 928 1 ! IF testmode THEN
23040 929 2 ! BEGIN
23050 930 3 ! ! outstring20 (text);
23060 931 4 ! ! outinteger (i, 4);
23070 932 5 ! ! writenl;
23080 933 6 ! END;
23090 934 7 END (* testout *);
23100 935
\f
tstoslst 81.02.26. 13.07. page 32
24010 936 PROCEDURE testsem(i: integer);
24020 937 (* test the semaphore "sem( semno)", and
24030 938 writes its status on the console if it is
24040 939 non-passive *)
24050 940 VAR more: boolean;
24060 941 BEGIN
24070 942 1 !
24080 943 2 ! ap.a := sem(i).s;
24090 944 3 ! bp.a := sem(i).w;
24100 945 4 ! IF open (ts_sem(i)) THEN
24110 946 5 ! BEGIN (* user semaphore no. i is open *)
24120 947 6 ! ! IF ap=bp THEN
24130 948 7 ! ! outchar(" ") ELSE outchar("^");
24140 949 8 ! ! outdecimal(i,3);
24150 950 9 ! ! outchar(":");
24160 951 10 ! ! more:= true;
24170 952 11 ! !
24180 953 12 ! ! (* now count the no. of buffers on this semaphore *)
24190 954 13 ! ! j:=0; (* j is the counter *)
24200 955 14 ! ! WHILE more DO
24210 956 15 ! ! BEGIN
24220 957 16 ! ! ! sensesem(countref, ts_sem(i));
24230 958 17 ! ! ! IF nil(countref) THEN
24240 959 18 ! ! ! more:= false
24250 960 19 ! ! ! ELSE
24260 961 20 ! ! ! BEGIN
24270 962 21 ! ! ! ! signal(countref,countsem);
24280 963 22 ! ! ! ! j:=j+1;
24290 964 23 ! ! ! END
24300 965 24 ! ! END;
24310 966 25 ! !
24320 967 26 ! ! outdecimal(j,3);
24330 968 27 ! ! WHILE open(countsem) DO
24340 969 28 ! ! BEGIN (* return the buffers to sem(i) *)
24350 970 29 ! ! ! wait(countref,countsem);
24360 971 30 ! ! ! signal(countref, ts_sem(i));
24370 972 31 ! ! END;
24380 973 32 ! !
24390 974 33 ! ! writenl;
24400 975 34 ! END (* open *)
24410 976 35 ! ELSE
24420 977 36 ! IF locked( ts_sem(i)) THEN
24430 978 37 ! BEGIN (* user semaphore no. i is locked *)
24440 979 38 ! ! IF ap=bp THEN
24450 980 39 ! ! outchar(" ") ELSE outchar("^");
24460 981 40 ! ! outdecimal(i,3);
\f
tstoslst 81.02.26. 13.07. page 33
24470 982 41 ! ! outchar(":");
24480 983 42 ! ! outstring10(" locked ");
24490 984 43 ! ! writenl;
24500 985 44 ! END;
24510 986 45 END (* testsem *);
24520 987
24530 988
24540 989
24550 990
24560 991
\f
tstoslst 81.02.26. 13.07. page 34
25010 992 PROCEDURE writenl;
25020 993 (* prepares opbuf for output to the operator and signals
25030 994 it to operator module *)
25040 995 BEGIN
25050 996 1 ! IF NOT nil(opoutref) THEN
25060 997 2 ! BEGIN
25070 998 3 ! ! outchar(nl);
25080 999 4 ! ! signal(opoutref, opsem^)
25090 1000 5 ! END;
25100 1001 6 ! wait(opoutref, wsem);
25110 1002 7 ! LOCK opoutref AS opbuf: opbuftype DO
25120 1003 8 ! opbuf.last:= firstindex;
25130 1004 9 END (* writenl *);
25140 1005
25150 1006
\f
tstoslst 81.02.26. 13.07. page 35
26010 1007
26020 1008
26030 1009
26040 1010 (****************************************
26050 1011 * *
26060 1012 * m a i n p r o g r a m *
26070 1013 * *
26080 1014 ****************************************)
26090 1015
26100 1016
26110 1017
26120 1018
26130 1019
26140 1020
26150 1021 BEGIN
26160 1022 1 !
26170 1023 2 ! opsem:= semvector(operatorsem);
26180 1024 3 ! testmode:= false;
26190 1025 4 ! testopen (z,"test-opsys ",opsem);
26200 1026 5 ! testout(z,version,al_env_version);
26210 1027 6 !
26220 1028 7 ! (* initialise pointers *)
26230 1029 8 ! FOR i:=1 TO ts_sem_total DO
26240 1030 9 ! BEGIN
26250 1031 10 ! ! sem(i).s:= ref(ts_sem(i));
26260 1032 11 ! ! sem(i).w:= sem(i).s;
26270 1033 12 ! END;
26280 1034 13 !
26290 1035 14 ! (* initialise buffers *)
26300 1036 15 ! FOR i:= 1 TO 2 DO
26310 1037 16 ! BEGIN
26320 1038 17 ! ! alloc (opoutref, opbufpool, wsem);
26330 1039 18 ! ! opoutref^.u1:=2; (* write *)
26340 1040 19 ! ! LOCK opoutref AS opbuf: opbuftype DO
26350 1041 20 ! ! WITH opbuf DO
26360 1042 21 ! ! BEGIN
26370 1043 22 ! ! ! first:= firstindex;
26380 1044 23 ! ! ! name:= "test ";
26390 1045 24 ! ! ! data(firstindex):= "!";
26400 1046 25 ! ! END;
26410 1047 26 ! ! return (opoutref);
26420 1048 27 ! END;
26430 1049 28 ! writenl;
26440 1050 29 !
26450 1051 30 ! alloc(opinref, opbufpool, wrsem);
26460 1052 31 !
\f
tstoslst 81.02.26. 13.07. page 36
26470 1053 32 ! opinref^.u1:=1; (* read *)
26480 1054 33 !
26490 1055 34 ! LOCK opinref AS opbuf: opbuftype DO
26500 1056 35 ! WITH opbuf DO
26510 1057 36 ! BEGIN
26520 1058 37 ! ! first:= firstindex;
26530 1059 38 ! ! last:= lastindex;
26540 1060 39 ! ! name:= "test ";
26550 1061 40 ! END;
26560 1062 41 !
26570 1063 42 ! FOR i:= 1 TO no_listen DO
26580 1064 43 ! BEGIN
26590 1065 44 ! ! alloc(cur,messbufpool,sem(com_pool).s^);
26600 1066 45 ! ! return(cur);
26610 1067 46 ! END;
26620 1068 47 ! st:= 1024;
26630 1069 48 ! base:= 10;
26640 1070 49 ! firstword:= 1;
26650 1071 50 ! lastword:= 10;
26660 1072 51 !
26670 1073 52 ! setoflowmask(true);
26680 1074 53 !
26690 1075 54 ! noofparams:= 0;
26700 1076 55 ! (* insert auto create with edit here *)
26710 1077 56 !
26720 1078 57 ! REPEAT
26730 1079 58 ! ! (* read a line of input from the operator and execute it *)
26740 1080 59 ! !
26750 1081 60 ! ! getinput;
26760 1082 61 ! !
26770 1083 62 ! ! CASE command OF
26780 1084 63 ! ! !
26790 1085 64 ! ! ! ";": (* comment command *)
26800 1086 65 ! ! ! BEGIN
26810 1087 66 ! ! ! END;
26820 1088 67 ! ! !
\f
tstoslst 81.02.26. 13.07. page 37
27010 1089 68 ! ! ! "a": (* alloc *)
27020 1090 69 ! ! ! (* a buffer is allocated from the messbufpool to the current
27030 1091 70 ! ! ! reference "cur".
27040 1092 71 ! ! ! 1st param is the answersem *)
27050 1093 72 ! ! ! BEGIN
27060 1094 73 ! ! ! ! semno:= params(1);
27070 1095 74 ! ! ! !
27080 1096 75 ! ! ! ! IF noofparams >= 1 THEN
27090 1097 76 ! ! ! ! IF nil(cur) THEN
27100 1098 77 ! ! ! ! IF (1<=semno) AND (semno<=noofsemaphores) THEN
27110 1099 78 ! ! ! ! BEGIN
27120 1100 79 ! ! ! ! ! alloc (cur, testbufpool, sem(semno).s^);
27130 1101 80 ! ! ! ! ! WITH cur^ DO
27140 1102 81 ! ! ! ! ! BEGIN
27150 1103 82 ! ! ! ! ! ! u1:= 0;
27160 1104 83 ! ! ! ! ! ! u2:= 0;
27170 1105 84 ! ! ! ! ! ! u3:= 0;
27180 1106 85 ! ! ! ! ! ! u4:= 0;
27190 1107 86 ! ! ! ! ! END;
27200 1108 87 ! ! ! ! ! get_curbuftype;
27210 1109 88 ! ! ! ! ! outstring10(" bufsize ");
27220 1110 89 ! ! ! ! ! outinteger(curbufsize, 5);
27230 1111 90 ! ! ! ! ! outinteger(cur^.size, 5)
27240 1112 91 ! ! ! ! END
27250 1113 92 ! ! ! ! ELSE outstring10(illegalno)
27260 1114 93 ! ! ! ! ELSE outstring20("you already have one")
27270 1115 94 ! ! ! ! ELSE outstring10(noparam)
27280 1116 95 ! ! ! END (* alloc*);
27290 1117 96 ! ! !
\f
tstoslst 81.02.26. 13.07. page 38
28010 1118 97 ! ! ! "b": (* base *)
28020 1119 98 ! ! ! (* defines the number base for input as well as output *)
28030 1120 99 ! ! ! (* the base is always read decimally *)
28040 1121 100 ! ! ! BEGIN
28050 1122 101 ! ! ! ! IF noofparams < 1 THEN
28060 1123 102 ! ! ! ! BEGIN
28070 1124 103 ! ! ! ! ! base:= oldbase;
28080 1125 104 ! ! ! ! ! outstring10(noparam)
28090 1126 105 ! ! ! ! END
28100 1127 106 ! ! ! ! ELSE
28110 1128 107 ! ! ! !
28120 1129 108 ! ! ! ! IF NOT (params(1) IN (. 2, 8, 10, 16 .) ) THEN
28130 1130 109 ! ! ! ! BEGIN (* illegal base *)
28140 1131 110 ! ! ! ! ! outstring20("illegal base ");
28150 1132 111 ! ! ! ! ! base:= oldbase;
28160 1133 112 ! ! ! ! END
28170 1134 113 ! ! ! ! ELSE
28180 1135 114 ! ! ! ! base:= params(1);
28190 1136 115 ! ! ! END;
28200 1137 116 ! ! !
\f
tstoslst 81.02.26. 13.07. page 39
29010 1138 117 ! ! ! "c": (* create *)
29020 1139 118 ! ! ! (* an incarnation of each of the predefined modules to be tested
29030 1140 119 ! ! ! is created and started.
29040 1141 120 ! ! ! params are nos. of the modules to be created and started *)
29050 1142 121 ! ! !
29060 1143 122 ! ! ! IF noofparams >= 1 THEN
29070 1144 123 ! ! !
29080 1145 124 ! ! ! BEGIN
29090 1146 125 ! ! ! ! moduleno:= params(1);
29100 1147 126 ! ! ! !
29110 1148 127 ! ! ! ! IF noofparams>1 THEN st:= params(2);
29120 1149 128 ! ! ! !
29130 1150 129 ! ! ! ! IF (moduleno<1) OR (moduleno > noofmodules) THEN
29140 1151 130 ! ! ! ! BEGIN (* illegal no *)
29150 1152 131 ! ! ! ! ! outdecimal(moduleno,4);
29160 1153 132 ! ! ! ! ! outstring10(illegalno);
29170 1154 133 ! ! ! ! END
29180 1155 134 ! ! ! ! ELSE
29190 1156 135 ! ! ! ! IF moduleready(moduleno) THEN init_modul(moduleno);
29200 1157 136 ! ! ! END (* if noofparams >= 1 *)
29210 1158 137 ! ! ! ELSE outstring10 (noparam);
29220 1159 138 ! ! ! (* end create *)
29230 1160 139 ! ! !
\f
tstoslst 81.02.26. 13.07. page 40
30010 1161 140 ! ! ! "f": (* fill *)
30020 1162 141 ! ! ! (* fills integers into current buffer.
30030 1163 142 ! ! ! 1st param: first word no. to be filled,
30040 1164 143 ! ! ! following: values to be assigned *)
30050 1165 144 ! ! ! BEGIN
30060 1166 145 ! ! ! ! IF noofparams < 2 THEN
30070 1167 146 ! ! ! ! outstring10("param ")
30080 1168 147 ! ! ! ! ELSE
30090 1169 148 ! ! ! ! IF (params(1) < 1) THEN
30100 1170 149 ! ! ! ! outstring20("illegal start ")
30110 1171 150 ! ! ! ! ELSE
30120 1172 151 ! ! ! ! IF nil(cur) THEN
30130 1173 152 ! ! ! ! outstring10("no buffer ")
30140 1174 153 ! ! ! ! ELSE
30150 1175 154 ! ! ! ! BEGIN (* params are ok *)
30160 1176 155 ! ! ! ! ! i:= params(1); (* i points into the messbuf *)
30170 1177 156 ! ! ! ! !
30180 1178 157 ! ! ! ! ! FOR j:= 2 TO noofparams DO
30190 1179 158 ! ! ! ! ! (* j points into the param list *)
30200 1180 159 ! ! ! ! ! IF i <= curbufsize THEN
30210 1181 160 ! ! ! ! ! BEGIN
30220 1182 161 ! ! ! ! ! ! CASE curbuftype OF
30230 1183 162 ! ! ! ! ! ! ! 1: LOCK cur AS minbuf: minbuftype DO
30240 1184 163 ! ! ! ! ! ! ! minbuf(i):= params(j);
30250 1185 164 ! ! ! ! ! ! ! 2: LOCK cur AS messbuf: messbuftype DO
30260 1186 165 ! ! ! ! ! ! ! messbuf(i):= params(j);
30270 1187 166 ! ! ! ! ! ! ! 3: LOCK cur AS maxbuf: maxbuftype DO
30280 1188 167 ! ! ! ! ! ! ! maxbuf(i):= params(j);
30290 1189 168 ! ! ! ! ! ! ! 4: LOCK cur AS testbuf: testbuftype DO
30300 1190 169 ! ! ! ! ! ! ! testbuf(i):= params(j);
30310 1191 170 ! ! ! ! ! ! ! OTHERWISE
30320 1192 171 ! ! ! ! ! ! END;
30330 1193 172 ! ! ! ! ! ! i:= i + 1;
30340 1194 173 ! ! ! ! ! END;
30350 1195 174 ! ! ! ! !
30360 1196 175 ! ! ! ! END (* params ok *)
30370 1197 176 ! ! ! END (* fill *);
30380 1198 177 ! ! !
\f
tstoslst 81.02.26. 13.07. page 41
31010 1199 178 ! ! ! "h": (* help *)
31020 1200 179 ! ! ! (* lists possible commands and no. of parameters *)
31030 1201 180 ! ! ! BEGIN
31040 1202 181 ! ! ! ! outstring20("comm and no of param"); writenl;
31050 1203 182 ! ! ! ! outstring20("a: allocate 1 "); writenl;
31060 1204 183 ! ! ! ! outstring20("b: base 1 "); writenl;
31070 1205 184 ! ! ! ! outstring20("c: create >=1 "); writenl;
31080 1206 185 ! ! ! ! outstring20("e: execute 1 "); writenl;
31090 1207 186 ! ! ! ! outstring20("f: fill 2 "); writenl;
31100 1208 187 ! ! ! ! outstring20("h: help 0 "); writenl;
31110 1209 188 ! ! ! ! outstring20("i: init point 0 "); writenl;
31120 1210 189 ! ! ! ! outstring20("k: kill >=1 "); writenl;
31130 1211 190 ! ! ! ! outstring20("o: output 0 to 2"); writenl;
31140 1212 191 ! ! ! ! outstring20("p: partial >=3 "); writenl;
31150 1213 192 ! ! ! ! outstring20("r: return 0 "); writenl;
31160 1214 193 ! ! ! ! outstring20("s: signal 1 "); writenl;
31170 1215 194 ! ! ! ! outstring20("t: test 0 or 1"); writenl;
31180 1216 195 ! ! ! ! outstring20("u: user param 1 to 4"); writenl;
31190 1217 196 ! ! ! ! outstring20("w: wait 1 "); writenl;
31200 1218 197 ! ! ! ! outstring20("x: exch point 2 "); writenl;
31210 1219 198 ! ! ! ! outstring20(";: comment ");
31220 1220 199 ! ! ! END;
31230 1221 200 ! ! !
\f
tstoslst 81.02.26. 13.07. page 42
32010 1222 201 ! ! ! "i": (* initialise pointers *)
32020 1223 202 ! ! ! IF noofparams=0 THEN
32030 1224 203 ! ! ! FOR i:=1 TO noofsemaphores DO sem(i).w:= sem(i).s ELSE
32040 1225 204 ! ! ! IF (params(1)>0) AND (params(1)<=noofsemaphores) THEN
32050 1226 205 ! ! ! sem(params(1)).w:= sem(params(1)).s ELSE
32060 1227 206 ! ! ! outstring10(valparam);
32070 1228 207 ! ! !
\f
tstoslst 81.02.26. 13.07. page 43
33010 1229 208 ! ! ! "e", (* exception *)
33020 1230 209 ! ! ! (* call of exception routine in one or more incarnations *)
33030 1231 210 ! ! ! "k": (* kill *)
33040 1232 211 ! ! ! (* removes incarnation of tested module(s)
33050 1233 212 ! ! ! params are nos. of modules to be removed *)
33060 1234 213 ! ! !
33070 1235 214 ! ! ! IF noofparams >= 1 THEN
33080 1236 215 ! ! ! FOR i:= 1 TO noofparams DO
33090 1237 216 ! ! ! BEGIN
33100 1238 217 ! ! ! ! moduleno:= params(i);
33110 1239 218 ! ! ! ! IF (1<=moduleno) AND (moduleno<=noofmodules) THEN
33120 1240 219 ! ! ! ! IF NOT nil(sh(moduleno)) THEN
33130 1241 220 ! ! ! ! IF command="e" THEN
33140 1242 221 ! ! ! ! break(sh(moduleno),#h2f) ELSE
33150 1243 222 ! ! ! ! remove (sh(moduleno))
33160 1244 223 ! ! ! ! ELSE
33170 1245 224 ! ! ! ! BEGIN
33180 1246 225 ! ! ! ! ! outdecimal (moduleno, 4);
33190 1247 226 ! ! ! ! ! outstring10(" not alive");
33200 1248 227 ! ! ! ! ! writenl;
33210 1249 228 ! ! ! ! END
33220 1250 229 ! ! ! ! ELSE
33230 1251 230 ! ! ! ! BEGIN
33240 1252 231 ! ! ! ! ! outdecimal (moduleno, 4);
33250 1253 232 ! ! ! ! ! outstring10(illegalno);
33260 1254 233 ! ! ! ! ! writenl;
33270 1255 234 ! ! ! ! END
33280 1256 235 ! ! ! END
33290 1257 236 ! ! ! ELSE outstring10("no params ");
33300 1258 237 ! ! !
\f
tstoslst 81.02.26. 13.07. page 44
34010 1259 238 ! ! ! "m": (* testmode *)
34020 1260 239 ! ! ! testmode:= NOT testmode;
34030 1261 240 ! ! !
\f
tstoslst 81.02.26. 13.07. page 45
35010 1262 241 ! ! ! "o": (* output *)
35020 1263 242 ! ! ! (* outputs current buffer incl. user parameters
35030 1264 243 ! ! ! 1st param is firstword,
35040 1265 244 ! ! ! 2nd param is lastword *)
35050 1266 245 ! ! ! BEGIN
35060 1267 246 ! ! ! ! IF nil(cur) THEN
35070 1268 247 ! ! ! ! outstring10 ("no buffer ")
35080 1269 248 ! ! ! ! ELSE
35090 1270 249 ! ! ! ! BEGIN
35100 1271 250 ! ! ! ! ! outchar("u");
35110 1272 251 ! ! ! ! ! outchar(":");
35120 1273 252 ! ! ! ! !
35130 1274 253 ! ! ! ! ! outinteger(cur^.u1,4);
35140 1275 254 ! ! ! ! ! outinteger(cur^.u2,4);
35150 1276 255 ! ! ! ! ! outinteger(cur^.u3,4);
35160 1277 256 ! ! ! ! ! outinteger(cur^.u4,4);
35170 1278 257 ! ! ! ! ! writenl;
35180 1279 258 ! ! ! ! !
35190 1280 259 ! ! ! ! ! IF (noofparams>=1) AND (params(1)>=1)
35200 1281 260 ! ! ! ! ! AND (params(1)<= curbufsize) THEN
35210 1282 261 ! ! ! ! ! firstword:= params(1);
35220 1283 262 ! ! ! ! !
35230 1284 263 ! ! ! ! ! IF (noofparams>=2) AND (params(2)<=curbufsize) THEN
35240 1285 264 ! ! ! ! ! lastword:= params(2);
35250 1286 265 ! ! ! ! ! IF lastword>curbufsize THEN
35260 1287 266 ! ! ! ! ! lastword:= curbufsize;
35270 1288 267 ! ! ! ! !
35280 1289 268 ! ! ! ! ! IF cur^.size<curbufsize THEN
35290 1290 269 ! ! ! ! ! outstring20("too small buffer ") ELSE
35300 1291 270 ! ! ! ! ! FOR i:= firstword TO lastword DO
35310 1292 271 ! ! ! ! ! BEGIN
35320 1293 272 ! ! ! ! ! ! outdecimal(i,3);
35330 1294 273 ! ! ! ! ! ! outchar(":");
35340 1295 274 ! ! ! ! ! ! CASE curbuftype OF
35350 1296 275 ! ! ! ! ! ! ! 1: LOCK cur AS minbuf: minbuftype DO
35360 1297 276 ! ! ! ! ! ! ! j:= minbuf(i);
35370 1298 277 ! ! ! ! ! ! ! 2: LOCK cur AS messbuf: messbuftype DO
35380 1299 278 ! ! ! ! ! ! ! j:= messbuf(i);
35390 1300 279 ! ! ! ! ! ! ! 3: LOCK cur AS maxbuf: maxbuftype DO
35400 1301 280 ! ! ! ! ! ! ! j:= maxbuf(i);
35410 1302 281 ! ! ! ! ! ! ! 4: LOCK cur AS testbuf: testbuftype DO
35420 1303 282 ! ! ! ! ! ! ! j:= testbuf(i);
35430 1304 283 ! ! ! ! ! ! ! OTHERWISE
35440 1305 284 ! ! ! ! ! ! ! j:= 0;
35450 1306 285 ! ! ! ! ! ! END;
35460 1307 286 ! ! ! ! ! ! IF base= 2 THEN
\f
tstoslst 81.02.26. 13.07. page 46
35470 1308 287 ! ! ! ! ! ! outinteger(j,17)
35480 1309 288 ! ! ! ! ! ! ELSE
35490 1310 289 ! ! ! ! ! ! outinteger(j,7);
35500 1311 290 ! ! ! ! ! ! writenl;
35510 1312 291 ! ! ! ! ! END;
35520 1313 292 ! ! ! ! END (* ok *);
35530 1314 293 ! ! ! END (* output *);
35540 1315 294 ! ! !
\f
tstoslst 81.02.26. 13.07. page 47
36010 1316 295 ! ! ! "p": (* partial words *)
36020 1317 296 ! ! ! (* fills partial words i.e. bytes into current buffer.
36030 1318 297 ! ! ! 1st param: word no. in which to start
36040 1319 298 ! ! ! 2nd param: byte no. (of 1st word) in which to start:
36050 1320 299 ! ! ! - 0: left byte
36060 1321 300 ! ! ! - 1: right byte
36070 1322 301 ! ! ! following: byte values to be assigned *)
36080 1323 302 ! ! ! BEGIN
36090 1324 303 ! ! ! ! IF noofparams<2 THEN
36100 1325 304 ! ! ! ! outstring10("param ")
36110 1326 305 ! ! ! ! ELSE
36120 1327 306 ! ! ! ! IF (params(1)<1) THEN
36130 1328 307 ! ! ! ! outstring20("illegal start-word ")
36140 1329 308 ! ! ! ! ELSE
36150 1330 309 ! ! ! ! IF NOT (params(2) IN (.0,1.)) THEN
36160 1331 310 ! ! ! ! outstring20 ("2nd must be 0 or 1 ")
36170 1332 311 ! ! ! ! ELSE
36180 1333 312 ! ! ! ! IF nil (cur) THEN
36190 1334 313 ! ! ! ! outstring10 ("no buffer ")
36200 1335 314 ! ! ! ! ELSE
36210 1336 315 ! ! ! ! BEGIN (* params are ok *)
36220 1337 316 ! ! ! ! ! i:= params(1); (* i points into current buffer *)
36230 1338 317 ! ! ! ! ! j:= params(2);
36240 1339 318 ! ! ! ! !
36250 1340 319 ! ! ! ! ! IF cur^.size<messbufsize THEN
36260 1341 320 ! ! ! ! ! outstring20("too small buffer ") ELSE
36270 1342 321 ! ! ! ! ! LOCK cur AS messbuf: messbuftype DO
36280 1343 322 ! ! ! ! ! BEGIN
36290 1344 323 ! ! ! ! ! ! IF messbuf(i)<0 THEN
36300 1345 324 ! ! ! ! ! ! leftbyte:= (messbuf(i)+255) DIV 256
36310 1346 325 ! ! ! ! ! ! ELSE
36320 1347 326 ! ! ! ! ! ! leftbyte:= messbuf(i) DIV 256;
36330 1348 327 ! ! ! ! ! !
36340 1349 328 ! ! ! ! ! ! FOR k:= 3 TO noofparams DO
36350 1350 329 ! ! ! ! ! ! (* k points into the parameter list *)
36360 1351 330 ! ! ! ! ! ! IF i<= messbufsize THEN
36370 1352 331 ! ! ! ! ! ! BEGIN
36380 1353 332 ! ! ! ! ! ! ! CASE j OF
36390 1354 333 ! ! ! ! ! ! ! ! 0:
36400 1355 334 ! ! ! ! ! ! ! ! BEGIN (* left *)
36410 1356 335 ! ! ! ! ! ! ! ! ! rightbyte:= abs(messbuf(i) MOD 256);
36420 1357 336 ! ! ! ! ! ! ! ! ! leftbyte := params (k);
36430 1358 337 ! ! ! ! ! ! ! ! END;
36440 1359 338 ! ! ! ! ! ! ! ! 1:
36450 1360 339 ! ! ! ! ! ! ! ! BEGIN (* right *)
36460 1361 340 ! ! ! ! ! ! ! ! ! rightbyte:= params (k);
\f
tstoslst 81.02.26. 13.07. page 48
36470 1362 341 ! ! ! ! ! ! ! ! ! IF leftbyte>=128 THEN
36480 1363 342 ! ! ! ! ! ! ! ! ! BEGIN
36490 1364 343 ! ! ! ! ! ! ! ! ! ! messbuf(i):= (leftbyte-128)*256 + rightbyte;
36500 1365 344 ! ! ! ! ! ! ! ! ! ! IF messbuf(i)>0 THEN
36510 1366 345 ! ! ! ! ! ! ! ! ! ! messbuf(i):= -((32767-messbuf(i))+1)
36520 1367 346 ! ! ! ! ! ! ! ! ! ! ELSE messbuf(i):= -32768;
36530 1368 347 ! ! ! ! ! ! ! ! ! END
36540 1369 348 ! ! ! ! ! ! ! ! ! ELSE
36550 1370 349 ! ! ! ! ! ! ! ! ! messbuf(i):= leftbyte*256 + rightbyte;
36560 1371 350 ! ! ! ! ! ! ! ! ! i:= i+1;
36570 1372 351 ! ! ! ! ! ! ! ! END;
36580 1373 352 ! ! ! ! ! ! ! !
36590 1374 353 ! ! ! ! ! ! ! END (* case *);
36600 1375 354 ! ! ! ! ! ! !
36610 1376 355 ! ! ! ! ! ! ! j:= 1-j;
36620 1377 356 ! ! ! ! ! ! END;
36630 1378 357 ! ! ! ! ! !
36640 1379 358 ! ! ! ! ! ! IF (j=1) AND (i<=messbufsize) THEN
36650 1380 359 ! ! ! ! ! ! IF leftbyte>=128 THEN
36660 1381 360 ! ! ! ! ! ! BEGIN
36670 1382 361 ! ! ! ! ! ! ! IF messbuf(i)>0 THEN
36680 1383 362 ! ! ! ! ! ! ! messbuf(i):= (leftbyte-128)*256 + rightbyte
36690 1384 363 ! ! ! ! ! ! ! ELSE messbuf(i):= - 32768;
36700 1385 364 ! ! ! ! ! ! ! messbuf(i):= -((32767-messbuf(i))+1);
36710 1386 365 ! ! ! ! ! ! END
36720 1387 366 ! ! ! ! ! ! ELSE
36730 1388 367 ! ! ! ! ! ! messbuf(i):= leftbyte*256 + rightbyte;
36740 1389 368 ! ! ! ! ! END (* lock *);
36750 1390 369 ! ! ! ! END (* params ok *);
36760 1391 370 ! ! ! END (* partial *);
36770 1392 371 ! ! !
\f
tstoslst 81.02.26. 13.07. page 49
37010 1393 372 ! ! ! "r": (* return *)
37020 1394 373 ! ! ! (* returns current buffer *)
37030 1395 374 ! ! ! IF nil(cur)
37040 1396 375 ! ! ! THEN outstring10("no buffer ")
37050 1397 376 ! ! ! ELSE return(cur);
37060 1398 377 ! ! !
\f
tstoslst 81.02.26. 13.07. page 50
38010 1399 378 ! ! ! "s": (* signal *)
38020 1400 379 ! ! ! (* signals current buffer to one of the predefined semaphores.
38030 1401 380 ! ! ! 1st param is semno *)
38040 1402 381 ! ! ! BEGIN
38050 1403 382 ! ! ! ! semno:= params(1);
38060 1404 383 ! ! ! !
38070 1405 384 ! ! ! ! IF noofparams >= 1 THEN
38080 1406 385 ! ! ! ! IF (1<=semno) AND (semno<=noofsemaphores) THEN
38090 1407 386 ! ! ! ! IF NOT nil(cur) THEN
38100 1408 387 ! ! ! ! signal (cur,sem(semno).s^)
38110 1409 388 ! ! ! ! ELSE outstring10("no buffer ")
38120 1410 389 ! ! ! ! ELSE outstring10(illegalno)
38130 1411 390 ! ! ! ! ELSE outstring10(noparam)
38140 1412 391 ! ! ! END (* signal *);
38150 1413 392 ! ! !
\f
tstoslst 81.02.26. 13.07. page 51
39010 1414 393 ! ! ! "t": (* testsem *)
39020 1415 394 ! ! ! (* tests the status of the specified semaphores.
39030 1416 395 ! ! ! if none is specified, the status of all the
39040 1417 396 ! ! ! user semaphores is given.
39050 1418 397 ! ! ! in both cases nothing will be written for a semaphore
39060 1419 398 ! ! ! if it is passive. *)
39070 1420 399 ! ! ! BEGIN
39080 1421 400 ! ! ! ! IF noofparams=0 THEN
39090 1422 401 ! ! ! ! BEGIN (* test all semaphores *)
39100 1423 402 ! ! ! ! !
39110 1424 403 ! ! ! ! ! FOR i:=1 TO noofsemaphores DO
39120 1425 404 ! ! ! ! ! testsem(i)
39130 1426 405 ! ! ! ! END (* test all *)
39140 1427 406 ! ! ! ! ELSE
39150 1428 407 ! ! ! ! BEGIN (* test the specified semaphores *)
39160 1429 408 ! ! ! ! !
39170 1430 409 ! ! ! ! ! FOR i:=1 TO noofparams DO
39180 1431 410 ! ! ! ! ! IF (params(i)<1) OR (params(i)>noofsemaphores) THEN
39190 1432 411 ! ! ! ! ! BEGIN (* illegal no. *)
39200 1433 412 ! ! ! ! ! ! outstring20("illegal no.: ");
39210 1434 413 ! ! ! ! ! ! outdecimal(params(i),3);
39220 1435 414 ! ! ! ! ! ! writenl;
39230 1436 415 ! ! ! ! ! END (* illegal no *)
39240 1437 416 ! ! ! ! ! ELSE
39250 1438 417 ! ! ! ! ! testsem( params(i) );
39260 1439 418 ! ! ! ! END (* test the specified semaphores *)
39270 1440 419 ! ! ! END (* testsem *);
39280 1441 420 ! ! !
39290 1442 421 ! ! !
\f
tstoslst 81.02.26. 13.07. page 52
40010 1443 422 ! ! ! "u": (* user parameters *)
40020 1444 423 ! ! ! (* inserts user param into header of current buffer
40030 1445 424 ! ! ! 1st param is u1
40040 1446 425 ! ! ! 2nd param is u2
40050 1447 426 ! ! ! 3rd param is u3
40060 1448 427 ! ! ! 4th param is u4 *)
40070 1449 428 ! ! ! BEGIN
40080 1450 429 ! ! ! ! IF nil(cur)
40090 1451 430 ! ! ! ! THEN outstring10("no buffer ")
40100 1452 431 ! ! ! ! ELSE
40110 1453 432 ! ! ! ! IF noofparams = 0 THEN
40120 1454 433 ! ! ! ! outstring10(noparam)
40130 1455 434 ! ! ! ! ELSE
40140 1456 435 ! ! ! ! WITH cur^ DO
40150 1457 436 ! ! ! ! BEGIN
40160 1458 437 ! ! ! ! ! IF testinterval (params(1),0,255) THEN u1:= params(1);
40170 1459 438 ! ! ! ! ! IF (noofparams>=2) THEN IF testinterval(params(2),0,255) THEN
40180 1460 439 ! ! ! ! ! u2:= params(2);
40190 1461 440 ! ! ! ! ! IF (noofparams>=3) THEN IF testinterval(params(3),0,255) THEN
40200 1462 441 ! ! ! ! ! u3:= params(3);
40210 1463 442 ! ! ! ! ! IF (noofparams>=4) THEN IF testinterval(params(4),0,255) THEN
40220 1464 443 ! ! ! ! ! u4:= params(4);
40230 1465 444 ! ! ! ! END
40240 1466 445 ! ! ! END; (* end user parameters *)
40250 1467 446 ! ! !
40260 1468 447 ! ! !
\f
tstoslst 81.02.26. 13.07. page 53
41010 1469 448 ! ! ! "w": (* wait *)
41020 1470 449 ! ! ! (* waits for semaphore semno.
41030 1471 450 ! ! ! 1st param is semno *)
41040 1472 451 ! ! ! BEGIN
41050 1473 452 ! ! ! ! semno:= params(1);
41060 1474 453 ! ! ! !
41070 1475 454 ! ! ! ! IF noofparams >= 1 THEN
41080 1476 455 ! ! ! ! IF nil(cur) THEN
41090 1477 456 ! ! ! ! IF (1<=semno) AND (semno<=noofsemaphores) THEN
41100 1478 457 ! ! ! ! BEGIN
41110 1479 458 ! ! ! ! ! sensesem( cur, sem(semno).w^);
41120 1480 459 ! ! ! ! ! IF nil(cur) THEN
41130 1481 460 ! ! ! ! ! outstring20("semaphore not open ")
41140 1482 461 ! ! ! ! ! ELSE
41150 1483 462 ! ! ! ! ! BEGIN
41160 1484 463 ! ! ! ! ! ! get_curbuftype;
41170 1485 464 ! ! ! ! ! ! outstring10(" bufsize ");
41180 1486 465 ! ! ! ! ! ! outinteger(curbufsize, 5);
41190 1487 466 ! ! ! ! ! ! outinteger(cur^.size, 5)
41200 1488 467 ! ! ! ! ! END;
41210 1489 468 ! ! ! ! END
41220 1490 469 ! ! ! ! ELSE outstring10(illegalno)
41230 1491 470 ! ! ! ! ELSE outstring20("you already have one")
41240 1492 471 ! ! ! ! ELSE outstring10(noparam)
41250 1493 472 ! ! ! END (* wait *);
41260 1494 473 ! ! !
\f
tstoslst 81.02.26. 13.07. page 54
42010 1495 474 ! ! ! "x": (* exchange pointer *)
42020 1496 475 ! ! ! BEGIN
42030 1497 476 ! ! ! ! IF noofparams >= 2 THEN
42040 1498 477 ! ! ! ! IF (params(1)>0) AND (params(1)<=noofsemaphores) THEN
42050 1499 478 ! ! ! ! IF (params(2)>0) AND (params(2)<=noofsemaphores) THEN
42060 1500 479 ! ! ! ! BEGIN
42070 1501 480 ! ! ! ! ! worksem:= sem(params(1)).w;
42080 1502 481 ! ! ! ! ! sem(params(1)).w:= sem(params(2)).w;
42090 1503 482 ! ! ! ! ! sem(params(2)).w:= worksem;
42100 1504 483 ! ! ! ! END
42110 1505 484 ! ! ! ! ELSE outstring10(valparam)
42120 1506 485 ! ! ! ! ELSE outstring10(valparam)
42130 1507 486 ! ! ! ! ELSE outstring10(noparam)
42140 1508 487 ! ! ! END (* exchange pointer *);
42150 1509 488 ! ! !
42160 1510 489 ! ! !
42170 1511 490 ! ! ! OTHERWISE (* error *)
42180 1512 491 ! ! ! outstring20 ("illegal comm. type h");
42190 1513 492 ! ! END (* case *);
42200 1514 493 ! !
42210 1515 494 ! ! IF command<>";" THEN
42220 1516 495 ! ! writenl;
42230 1517 496 ! !
42240 1518 497 ! UNTIL false;
42250 1519 498 !
42260 1520 499 END.
42270 1521
42280 1522
42290 1523
42300 1524
\f
tstoslst 81.02.26. 13.07. page 55
0 38* 51* 75* 151* 151* 152* 312 322: 322 334 360 362 411 491 501
569* 592 601 611 617 624 636 647 648 648 675 678 683 693 698
699 798 804 806 822 869 891 898 954 1075 1103 1104 1105 1106 1223
1225 1305 1330 1344 1354: 1365 1382 1421 1453 1458 1459 1461 1463 1498 1499
1 35* 39* 50* 65* 66* 67* 68* 75* 78* 79* 100* 147* 148* 314 323:
375 378 387 443: 461 467 546 570* 583 586 600 601 606 611 619
631 633 636 640 641 655 670 674 696 700 702 708 712 727 735
744 760 762 867 876 893 908 909 963 1029 1036 1053 1063 1070 1094
1096 1098 1122 1129 1135 1143 1146 1148 1150 1169 1169 1176 1183: 1193 1224
1225 1225 1226 1226 1235 1236 1239 1280 1280 1280 1281 1282 1296: 1327 1327
1330 1337 1359: 1366 1371 1376 1379 1385 1403 1405 1406 1424 1430 1431 1458
1458 1473 1475 1477 1498 1498 1501 1502
2 316 324: 408 447: 469 509 621 622 624 625 633 634 636 637 643
644 647 648 654: 680 852: 880: 1036 1039 1129 1148 1166 1178 1185: 1284
1284 1285 1298: 1307 1324 1330 1338 1459 1459 1460 1497 1499 1499 1502 1503
3 34* 88* 318 325: 451: 509 511 660 673 949 967 981 1187: 1293 1300:
1349 1434 1461 1461 1462
4 153* 319 326: 455: 519 532 665 666 864 918 931 1152 1189: 1246 1252
1274 1275 1276 1277 1302: 1463 1463 1464
5 33* 152* 153* 417 459: 486 1110 1111 1486 1487
6 49* 465: 661 859
7 151* 152* 153* 463 471: 1310
8 480: 659: 672 857: 881: 1129
9 484: 690
10 78* 368 488: 557 588 727 807 820 1069 1071 1129
11 492:
12 90* 498: 735
13 502:
14 507:
15 513: 569* 619 631 641 678
16 36* 656 664: 803 827 854 862: 873 882: 1129
17 1308
20 79* 566* 744
40 457
50 147* 385
63 469
64 511
80 30* 48*
87 816 839 888
100 414
128 1362 1364 1380 1383
255 1345 1458 1459 1461 1463
256 1345 1347 1356 1364 1370 1383 1388
257 463
\f
tstoslst 81.02.26. 13.07. page 56
512 491 501
1024 1068
2048 882
3276 830
4096 881
16384 880
32767 893 1366 1385
32768 832 892 1367 1384
a 83* 943= 944=
abs 598 1356
alfa 60* 288* 397* 731*
alfa10 78* 285* 721*
alfa20 79* 291* 303* 739* 926*
alfalength 49*
alloc 1038 1051 1065 1100
alreadyexists <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
43* 406 533
al_env_version <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1026
ap 156* 943 947 979
as 337: 343: 543: 756: 907: 1002: 1040: 1055: 1183: 1185: 1187: 1189: 1296: 1298: 1300:
1302: 1342:
atbuffer 75*
atconnector 186* 461
atcsem 189*
atc_pri 464
atc_sem_no 461 461
atc_size 464
athsem 192*
ath_pri 450
ath_sem_no 462
ath_size 450
at_handler 164* 449
base 122* 367 368= 381= 391= 556 557= 559= 588 598 599 653 672 803 807
820 827 838 839 851 873 879 886 888 1069= 1124= 1132= 1135= 1307
bit 569*
bits 569* 621= 624= 633= 636= 643 644= 644 647 648= 648 680
boolean 144* 270* 358* 525* 580* 782* 912* 940*
bp 156* 944 947 979
break 1242
byte 72* 75* 200* 217*
ch 540* 547 787* 793= 800 801= 802 803 814 815 816 824= 826 827 830
837 838 839 853 858 863 871= 872 873 885 886 888
channelno 200* 217*
\f
tstoslst 81.02.26. 13.07. page 57
char 61* 78* 79* 118* 294* 540* 570* 751* 787*
chr 598 691 692
command 118* 349= 351 364 379 1083 1241 1515
com_pool 463 469 476 495 511 1065
com_sem 195* 212* 228*
controlinfo 72*
countref 103* 957 958 962 970 971
countsem 94* 962 968 970
create 410
createchtype 70*
createerror 46* 415
cur 106* 311 313 315 317 1065 1066 1097 1100 1101 1111 1172 1183: 1185: 1187:
1189: 1267 1274 1275 1276 1277 1289 1296: 1298: 1300: 1302: 1333 1340 1342: 1395
1397 1407 1408 1450 1456 1476 1479 1480 1487
curbufsize 135* 322= 323= 324= 325= 326= 1110 1180 1281 1284 1286 1287 1289 1486
curbuftype 136* 312= 314= 316= 318= 319= 321 1182 1295
curdigit 571* 670= 685 686 691 692 696 700= 700 784* 867= 876= 876 877 889
curpos 572* 673= 674= 681 699= 702= 702
data 61* 547= 759 1045=
dcaddr 214*
dcmodule 248* 494
dcsem 224*
dc_addr 151* 167* 175* 197* 449 453 463 469 511
dc_int1 496
dc_int2 496
dc_int3 496
dc_sem_no 474 496
dc_sim_pri 497
dc_sim_size 497
digit 782* 794= 802= 804 812 822 826= 828 869 872= 874
digits 570* 586= 598= 605= 611= 686= 691= 692= 714 777* 802 814 826 837 872
885
doesntexist 44*
done 264*
driversem 193*
external 162* 170* 178* 184* 201* 218* 235* 241* 246* 252* 257* 268* 271*
false 372 382 534 695 791 794 809 833 920 959 1024 1518
first 57* 346 912* 915 1043= 1058=
firstindex 49* 50* 61* 338 347 1003 1043 1045 1058
firstword 123* 1070= 1282= 1291
free 263*
getinput 330* 1081
getparams 276* 353 356*
get_curbuftype <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
309* 1108 1484
\f
tstoslst 81.02.26. 13.07. page 58
h 573* 678= 680
h2f 1242
hexdigits 778* 803 827 873
i 124* 303* 573* 586= 586 590= 598 600= 600 601 605 606= 606 609 619=
621 631= 633 641= 643 644 644 712= 714 725* 727= 728 733* 735= 736
742* 744= 745 912* 915 915 918 926* 931 936* 943 944 945 949 957
971 977 981 1029= 1031 1031 1032 1032 1036= 1063= 1176= 1180 1184 1186 1188
1190 1193= 1193 1224= 1224 1224 1236= 1238 1291= 1293 1297 1299 1301 1303 1337=
1344 1345 1347 1351 1356 1364 1365 1366 1366 1367 1370 1371= 1371 1379 1382
1383 1384 1385 1385 1388 1424= 1425 1430= 1431 1431 1434 1438
illegalno 45* 520 917 1113 1153 1253 1410 1490
incharsleft 125* 346= 762= 762 798 804 822 869 898 909= 909
inc_name 397* 410 416
index 395* 405 410 412 424* 442 444 448 452 456 460 466 472 481 485
489 493 499 503 508 514 519
init_modul 424* 1156
init_proc 394* 444 448 452 456 460 466 472 481 485 489 493 499 503 508
514
inputsem 230* 240*
int 279* 282* 551* 558 562* 592 598 599= 599 601 611 617 621 622= 622
624 625= 625 633 634= 634 636 637= 637
integer 59* 65* 66* 67* 68* 138* 147* 183* 199* 216* 239* 279* 282* 297* 303*
395* 400* 403* 424* 525* 551* 562* 578* 725* 733* 742* 768* 785* 912* 926*
936*
j 126* 954= 963= 963 967 1178= 1184 1186 1188 1190 1297= 1299= 1301= 1303= 1305=
1308 1310 1338= 1353 1376= 1376 1379
k 127* 1349= 1357 1361
lam 237* 486
lamsem 210* 226*
lam_pri 487
lam_sem_no 462 475 486 494
lam_size 487
last 58* 546= 546 547 912* 915 1003= 1059=
lastchar 787* 792= 800= 808
lastindex 50* 61* 1059
lastword 128* 1071= 1285= 1286 1287= 1291
leftbyte 129* 1345= 1347= 1357= 1362 1364 1370 1380 1383 1388
level 239*
linelength 48* 50*
link 409
lock 337: 343: 543: 756: 907: 1002: 1040: 1055: 1183: 1185: 1187: 1189: 1296: 1298: 1300:
1302: 1342:
locked 977
m 574* 640= 643 644 645= 647 648 649=
\f
tstoslst 81.02.26. 13.07. page 59
macroaddr 151* 151* 152* 152* 153* 153* 168* 176* 198* 215*
main 262*
max 183*
maxbuf 1187: 1188= 1300: 1301
maxbufsize 34* 68* 315 325
maxbuftype 68* 1187 1300
maxpos 566* 570* 586 590 609 670 685 696 708 712 712
messbuf 1185: 1186= 1298: 1299 1342: 1344 1345 1347 1356 1364= 1365 1366= 1366 1367= 1370=
1382 1383= 1384= 1385= 1385 1388=
messbufpool 91* 1065
messbufsize 32* 65* 313 324 1340 1351 1379
messbuftype 65* 91* 1185 1298 1342
messem 206*
micaddr 216*
minbuf 1183: 1184= 1296: 1297
minbufsize 35* 67* 311 323
minbuftype 67* 1183 1296
moduleno 130* 525* 529 532 1146= 1150 1150 1152 1156 1156 1238= 1239 1239 1240 1242
1243 1246 1252
moduleready 525* 529= 534= 1156
more 940* 951= 955 959=
n1 426* 444 444
n10 435* 489 489 499
n11 436* 493 493
n13 437* 503 503
n14 438* 508 508
n15 439* 514 514
n16 440*
n2 427* 448 448
n3 428* 452 452
n4 429* 456 456
n5 430* 460 460
n6 431* 466 466
n7 432* 472 472
n8 433* 481 481
n9 434* 485 485
name 60* 396* 409 1044= 1060=
ncsem 225*
ncsup 259* 504
ncsup_int1 504
ncsup_int2 504
nc_addr 152*
nc_sem_no 475 504
nc_sup_size 506
\f
tstoslst 81.02.26. 13.07. page 60
negative 580* 592= 603 782* 808= 809= 830 833= 844 853= 858= 863= 877 889
netc_sem_no 476 494 505
net_int1 477
net_int2 477
net_int3 478
net_int4 478
net_sem 266*
newbase 358* 369= 372= 382= 389
newm 574* 643= 645 647= 649
next 59* 338= 346 347= 759 760= 760 908= 908
nl 998
noofdig 575* 656= 661= 666= 670
noofdigit 784* 854= 859= 864= 877 889
noofmodules 36* 148* 1150 1239
noofparams 131* 362= 375= 375 376 377 378 385 387= 387 408 1075= 1096 1122 1143
1148 1166 1178 1223 1235 1236 1280 1284 1324 1349 1405 1421 1430 1453 1459
1461 1463 1475 1497
noofpos 576* 655= 660= 665= 681
noofsemaphores <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
37* 1098 1224 1225 1406 1424 1431 1477 1498 1499
noparam 42* 1115 1125 1158 1411 1454 1492 1507
no_listen 91* 1063
nul 792 793
oflow 270*
ok 51* 341 403* 410= 411 414= 414 417
okl 402* 409= 414 419=
oldbase 132* 367= 381 391 556= 559 1124 1132
op 160* 165* 173*
opbuf 337: 338 343: 344 543: 544 756: 757 907: 908 908 1002: 1003 1040: 1041
1055: 1056
opbufpool 88* 1038 1051
opbufsize 30*
opbuftype 55* 88* 337 343 543 756 907 1002 1040 1055
open 945 968
operatorsem 1023
opinref 104* 337: 339 340 341 343: 756: 907: 1051 1053 1055:
opoutref 105* 543: 996 999 1001 1002: 1038 1039 1040: 1047
opsem 110* 181* 187* 204* 221* 238* 244* 249* 255* 260* 339 445 449 453 457
461 467 473 482 486 490 494 500 504 509 515 999 1023= 1025
ord 351 598 691 692 815 815 816 838 838 839 886 886 888
outchar 540* 706 714 728 736 745 948 948 950 980 980 982 998 1271 1272
1294
outdecimal 279* 417 519 532 551* 949 967 981 1152 1246 1252 1293 1434
outinteger 282* 558 562* 918 931 1110 1111 1274 1275 1276 1277 1308 1310 1486 1487
\f
tstoslst 81.02.26. 13.07. page 61
outstring10 285* 520 721* 917 983 1109 1113 1115 1125 1153 1158 1167 1173 1227 1247
1253 1257 1268 1325 1334 1396 1409 1410 1411 1451 1454 1485 1490 1492 1505
1506 1507
outstring12 288* 416 731*
outstring20 291* 406 415 533 739* 930 1114 1131 1170 1202 1203 1204 1205 1206 1207
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1290 1328 1331
1341 1433 1481 1491 1512
ownaddr 199*
p 398* 409 410 419
params 147* 376= 377 1094 1129 1135 1146 1148 1169 1176 1184 1186 1188 1190 1225
1225 1226 1226 1238 1280 1281 1282 1284 1285 1327 1330 1337 1338 1357 1361
1403 1431 1431 1434 1438 1458 1458 1459 1460 1461 1462 1463 1464 1473 1498
1498 1499 1499 1501 1502 1502 1503
point_rec 82* 156*
pool 88* 90* 91*
positions 279* 282* 551* 558 562* 706 708 709 710= 712
pr 39*
prio 400* 412
process 4* 159* 164* 172* 180* 186* 203* 220* 237* 243* 248* 254* 259*
processrec 398*
processref 409 419
pu 38* 239* 486
quesem 190* 207*
readchar 294* 349 751* 759= 801 824 871
readinteger 297* 376 768* 902=
readok 141* 385 791= 817=
ref 1031
reference 107*
remove 1243
repeatchar 300* 900 905*
res 577* 675= 680= 680 683 690 691 692 693 698=
result 785* 806= 815= 816= 830 832= 838= 838 839= 839 844= 844 880= 880 881=
881 882= 882 886= 886 888= 888 891 892= 893= 893 902
return 1047 1066 1397
rightbyte 133* 1356= 1361= 1364 1370 1383 1388
s 462 462 462 468 468 468 473 474 475 475 475 494 494 495 505
505 510 510 510 943 1031= 1032 1065 1100 1224 1226 1408
sem 112* 245* 445 449 453 457 461 461 462 462 462 463 467 467 468
468 468 469 473 474 475 475 475 476 476 477 477 478 478 482
486 490 494 494 495 495 496 496 496 496 500 504 504 504 505
505 509 509 510 510 510 511 515 943 944 1031 1032 1032 1065 1100
1224 1224 1226 1226 1408 1479 1501 1502 1502 1503
sem1 250*
sem2 250*
\f
tstoslst 81.02.26. 13.07. page 62
sem3 250*
sem4 250*
sem5 251*
sem6 251*
sem7 251*
sem8 251*
semaphore 99* 100*
semint1 231*
semint2 232*
semint3 233*
semint4 234*
semno 134* 1094= 1098 1098 1100 1403= 1406 1406 1408 1473= 1477 1477 1479
sempointer 83* 110* 111* 160* 165* 173* 181* 187* 195* 204* 212* 221* 228* 238* 244*
249* 250* 255* 260* 267*
semvector 4* 1023
sensesem 957 1479
setoflowmask 270* 1073
sh 148* 405 410 412 529 1240 1242 1243
shadow 148*
signal 339 962 971 999 1408
signs 779*
size 311 313 315 317 399* 408 1111 1289 1340 1487
size_listen 32* 33* 34*
sp 586 706
st 137* 408= 410 1068= 1148=
start 412
system_vector <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
4*
tab_sem 256*
tap 254* 490 500
tap1_sem_no 500
tap_sem_no 490
testbuf 1189: 1190= 1302: 1303
testbufpool 90* 1100
testbufsize 33* 66* 317 326
testbuftype 66* 90* 1189 1302
testinterval 912* 920= 923= 1458 1459 1461 1463
testmode 143* 928 1024= 1260= 1260
testmodeout 303* 334 351 360 377 926*
testopen 1025
testout 1026
testsem 936* 1425 1438
text 285* 288* 291* 303* 721* 728 731* 736 739* 745 926* 930
ticklength 183*
\f
tstoslst 81.02.26. 13.07. page 63
timeout 72* 180* 457
timeoutsem 182* 211* 227* 267*
timeout_sem_no <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
457 462 468 475 495 505 510
time_out_unit <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
457
timsem 194*
tim_pri 458
tim_size 458
true 369 529 676 817 853 858 863 923 951 1073
tsaddr 215*
tsconnector 220* 473
tsc_pri 479
tsc_size 479
tsopsys 4*
tsssem 223*
tssuper 159* 445
tssup_sem_no 473
tss_pri 446 506
tss_size 446
ts_addr 153* 168* 176* 198* 449 453 463 469 511
ts_pointer 182* 190* 207* 234* 240* 251* 256* 264*
ts_pointer_vector <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
112* 161* 169* 177* 245*
ts_sem 100* 161* 169* 177* 945 957 971 977 1031
ts_sem_total 37* 100* 1029
u1 1039= 1053= 1103= 1274 1458=
u2 341 1104= 1275 1460=
u3 1105= 1276 1462=
u4 1106= 1277 1464=
unlink 419
used 578* 583= 609= 696= 706 709 710
vac_size 470
vagt 243* 482 515
valparam 41* 1227 1505 1506
vas_sem_no 468
vas_size 483
vcc 203* 467 509
vcc_pri 470 512
vcc_sem_no 467 467 509 509
vchsem 209*
vch_pri 454
vch_sem_no 468 510
vch_size 454
\f
tstoslst 81.02.26. 13.07. page 64
vc_handler 172* 453
vc_sim_pri 483 516
version 25* 1026
vic_size 512
vis_sem_no 510
vis_size 516
w 463 469 476 495 511 944 1032= 1224= 1226= 1479 1501 1502= 1502 1503=
wait 340 970 1001
worksem 111* 1501= 1503
writenl 306* 418 919 932 974 984 992* 1049 1202 1203 1204 1205 1206 1207 1208
1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1248 1254 1278 1311 1435
1516
wrsem 97* 340 1051
wsem 95* 1001 1038
z 115* 1025 1026
zeroes 580* 676= 683 693 695=
zone 115*
\f
tstoslst 81.02.26. 13.07. page 65
AND 22
ARRAY 13
BEGIN 111
CASE 9
CONST 5
DIV 9
DO 47
DOWNTO 3
ELSE 69
END 123
FOR 19
FORWARD 11
FUNCTION 6
IF 110
IN 14
MOD 8
NIL 14
NOT 9
OF 25
OR 10
OTHERWISE 4
PROCEDURE 25
RECORD 3
REPEAT 5
THEN 110
TO 16
TYPE 1
UNTIL 5
VAR 31
WHILE 4
WITH 7
\f
jg7 1981.02.26 13.09
tstos program
81.02.26. 13.10. pascal80 version 1981.02.09
name headline beginline endline appetite(words)
get_curbufty 309 312 328 : 2
getinput 330 334 354 : 21
getparams 356 360 392 : 25
init_proc 400 406 422 : 29
init_modul 424 443 523 : 57
moduleready 525 529 536 : 19
outchar 540 543 549 : 9
outdecimal 551 556 560 : 10
outinteger 562 583 717 : 47
outstring10 721 727 729 : 17
outstring12 731 735 737 : 17
outstring20 739 744 746 : 17
readchar 751 756 763 : 11
readinteger 768 791 903 : 17
repeatchar 905 907 910 : 8
testinterval 912 916 924 : 13
testmodeout 926 929 934 : 18
testsem 936 943 986 : 15
writenl 992 997 1004 : 11
tsopsys 24 1023 1520 : 1176
code: 5 . 248 = 15248 bytes
end of PASCAL80 compilation
end
blocksread = 53
▶EOF◀