1 This directory contains test programs for EM implementations.
2 The test programs are all part of the file "tests".
3 Each individual test program looks like:
6 ... ; data declarations etc.
8 ... ; part of the body of MAIN
10 ... ; subroutines used by this test
12 The PROC part is optional, so the smallest test program looks like:
17 The keywords used by "select", like TEST, MAIN, PROC, HOL, OK and ERRLAB,
18 all consist of upper case letters and start in column one.
19 A convention for test numbers is to use 3 digit numbers, possibly left
22 A program, called "select", is provided to combine a range of tests
23 into a single test program.
24 "Select" expects a range as argument, like 0-127, or -127, or 0-.
25 Tests that have a TEST number in that range are included.
26 "Select" also expects the file from which the tests should
27 be selected as an argument.
28 If no argument is given, or only a range argument, select expects
29 the tests to slect from on standard input.
31 To prevent name clashes, some rules must be obeyed:
32 - data label names, procedure names and instruction label numbers
33 must be unique over all tests. A good habit is to use the
34 three digit test number as suffix.
35 - only keyword of "select" may start with uppercase letters in column
36 one, to allow for expansion in the future.
37 - because only a single 'hol' pseudo is allowed, "select" must
38 generate the 'hol' pseudo. An individual test may request
39 some 'hol' space by a special HOL line, starting in column one
40 and followed by a single number, the number of bytes needed.
41 This number must consists of digits only, no constant symbols,
42 because "select" must compute the maximum, so before the
43 preprocessor has replaced the constant symbols by their values.
44 - a similar problem is caused by the number of bytes of local
45 storage for 'main'. An individual test may specify the number
46 of bytes it needs as parameter to the MAIN line.
47 Again, the number must consist of digits only.
49 Test programs print a sequence of integers greater than 1.
50 This sequence is terminated by the number 1 as soon as an error is detected.
51 If all tests are performed correctedly the number 0 is printed.
53 To allow test programs to print integers without the full machinery of
54 conversion and i/o routines, the EM instruction 'nop' is used.
55 Each time this instruction is executed, the current line number as
56 maintained by the 'lin' instruction must be printed, followed by a
57 newline, at least during debugging.
59 The following abbrevation may be used in test programs:
64 Numbers are automatically assigned in order of static appearance.
65 As soon as an error is detected you must branch to label 1, by instructions
66 like 'bra *1' and 'zne *1'.
67 Label 1 is automatically provided in the main routine.
68 If you jump to label 1 in a subroutine, then that subroutine must
69 end with ERRLAB, like in:
80 An option to "select" is to generate 'fil' instructions whenever a
82 This is useful if 'nop' prints the 'fil' string as well as the 'lin' number.
83 This 'f' option is on by default, off if a '-f' flag is given.
85 The EM file generated by "select" includes "test.h".
86 "test.h" may contain definitions of the following symbols:
87 W2S: the size of double precision integers, if implemented.
88 FS: the size of single precision floats, if implemented.
89 F2S: the size of double precision floats, if implemented.
90 The value of these symbols, if defined, must be the size of the object involved.
92 Two other symbols are used:
93 EM_PSIZE: pointer size
95 The machine dependent translation program, like 8086 and vax2, give
96 definitions of these symbols while calling the EM encode program.
97 Because these size names occur quite often, they may be abbreviated:
101 Before running the tests in the file "tests", it is wise to test
102 the necessary basic functions with some simple tests like
123 The first two of these are part of "tests" as well. The last two are
124 not included in "tests" intensionally, because they would fail.
125 The last tests fails because it references the ABS block which is
126 inaccessable after an 'hol' pseudo.
127 Proceed as follows for each of these basic tests:
128 - make a file called 'basic' containing the test
130 select basic >basic.e
135 where machine should be replaced by the name of program
136 used to compile EM programs for the current machine.