READ_ME 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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:
  4. TEST 004: test ...
  5. ... ; data declarations etc.
  6. MAIN nlocal
  7. ... ; part of the body of MAIN
  8. PROC
  9. ... ; subroutines used by this test
  10. The PROC part is optional, so the smallest test program looks like:
  11. TEST 000: null test
  12. MAIN 0
  13. The keywords used by "select", like TEST, MAIN, PROC, HOL, OK and ERRLAB,
  14. all consist of upper case letters and start in column one.
  15. A convention for test numbers is to use 3 digit numbers, possibly left
  16. padded with zero's.
  17. A program, called "select", is provided to combine a range of tests
  18. into a single test program.
  19. "Select" expects a range as argument, like 0-127, or -127, or 0-.
  20. Tests that have a TEST number in that range are included.
  21. To prevent name clashes, some rules must be obeyed:
  22. - data label names, procedure names and instruction label numbers
  23. must be unique over all tests. A good habit is to use the
  24. three digit test number as suffix.
  25. - only keyword of "select" may start with uppercase letters in column
  26. one, to allow for expansion in the future.
  27. - because only a single 'hol' pseudo is allowed, "select" must
  28. generate the 'hol' pseudo. An individual test may request
  29. some 'hol' space by a special HOL line, starting in column one
  30. and followed by a single number, the number of bytes needed.
  31. This number must consists of digits only, no constant symbols,
  32. because "select" must compute the maximum, so before the
  33. preprocessor has replaced the constant symbols by their values.
  34. - a similar problem is caused by the number of bytes of local
  35. storage for 'main'. An individual test may specify the number
  36. of bytes it needs as parameter to the MAIN line.
  37. Again, the number must consist of digits only.
  38. Test programs print a sequence of integers greater than 1.
  39. This sequence is terminated by the number 1 as soon as an error is detected.
  40. If all tests are performed correctedly the number 0 is printed.
  41. To allow test programs to print integers without the full machinery of
  42. conversion and i/o routines, the EM instruction 'nop' is used.
  43. Each time this instruction is executed, the current line number as
  44. maintained by the 'lin' instruction must be printed, followed by a
  45. newline, at least during debugging.
  46. The following abbrevation may be used in test programs:
  47. OK -> lin n
  48. nop
  49. Numbers are automatically assigned in order of static appearance.
  50. As soon as an error is detected you must branch to label 1, by instructions
  51. like 'bra *1' and 'zne *1'.
  52. Label 1 is automatically provided in the main routine.
  53. If you jump to label 1 in a subroutine, then that subroutine must
  54. end with ERRLAB, like in:
  55. PROC
  56. pro $test,0
  57. ...
  58. bra *1
  59. ...
  60. ret 0
  61. ERRLAB
  62. end
  63. An option to "select" is to generate 'fil' instructions whenever a
  64. new test starts.
  65. This is useful if 'nop' prints the 'fil' string as well as the 'lin' number.
  66. This 'f' option is on by default, off if a '-f' flag is given.
  67. The EM file generated by "select" includes "test.h".
  68. "Emtest.h" may contain definitions of the following symbols:
  69. W2S: the size of double precision integers, if implemented.
  70. FS: the size of single precision floats, if implemented.
  71. F2S: the size of double precision floats, if implemented.
  72. The value of these symbols, if defined, must be the size of the object involved.
  73. Two other symbols are used:
  74. EM_PSIZE: pointer size
  75. EM_WSIZE: word size
  76. The machine dependent translation program, like 8086 and vax2, give
  77. definitions of these symbols while calling the EM encode program.
  78. Because these size names occur quite often, they may be abbreviated:
  79. WS -> EM_WSIZE
  80. PS -> EM_PSIZE
  81. Before running the tests in the file "tests", it is wise to test
  82. the necessary basic functions with some simple tests like
  83. TEST 000: null
  84. MAIN 0
  85. and
  86. TEST 001: ok
  87. MAIN 0
  88. OK
  89. and
  90. TEST 998: error
  91. MAIN 0
  92. bra *1
  93. and
  94. TEST 999: test lni
  95. MAIN 0
  96. lin 1
  97. lni
  98. loe 0
  99. loc 2
  100. bne *1
  101. OK
  102. The first two of these are part of "tests" as well. The last two are
  103. not included in "tests" intensionally, because they would fail.
  104. The last tests fails because it references the ABS block which is
  105. inaccessable after an 'hol' pseudo.
  106. Proceed as follows for each of these basic tests:
  107. - make a file called 'basic' containing the test
  108. - run select:
  109. select basic >basic.e
  110. - compile by
  111. machine basic.e
  112. - and load and run
  113. where machine should be replaced by the name of program
  114. used to compile EM programs for the current machine.