ack.1.X 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. .\" $Header$
  2. .de SB
  3. .\" SuBheader
  4. .sp 1
  5. .nr Sf \\n(.f
  6. .ft B
  7. .PP
  8. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  9. .ft \\n(Sf
  10. .sp 1
  11. ..
  12. .TH ACK I
  13. .ad
  14. .SH NAME
  15. ack \- Amsterdam Compiler Kit
  16. .SH SYNOPSIS
  17. \fBack\fP arguments
  18. .br
  19. \fBacc\fP arguments
  20. .br
  21. \fBapc\fP arguments
  22. .br
  23. \fBabc\fP arguments
  24. .br
  25. \fImachine\fP arguments
  26. .SH DESCRIPTION
  27. This program transforms sources in several
  28. languages to load files for a variety of machines,
  29. internally using several phases.
  30. The transformation can be stopped at any phase.
  31. Combining sources from several languages is allowed.
  32. The run-time system of the first language mentioned,
  33. either in the program call name or in the arguments,
  34. is automatically included.
  35. The libraries of all other languages mentioned,
  36. containing most of the run-time systems,
  37. are also automatically included.
  38. Two types of load files can be distinguished,
  39. \fIa.out\fP files containing machine code and \fIe.out\fP
  40. files containing virtual EM machine code.
  41. The last type is designed for interpretation.
  42. Compilation time for interpretation is fast and gives many
  43. runtime checks,
  44. but execution is about seven times slower.
  45. Which combinations of languages and machines are allowed varies
  46. in time and depends on the installation.
  47. .PP
  48. The actions of \fIack\fP are to repeatedly transform files with a
  49. particular suffix into files with another suffix,
  50. finally combining the results into a single file.
  51. .PP
  52. Different machines can use different suffices,
  53. but the following are recognized by most machines:
  54. .IP .p
  55. Pascal program.
  56. .IP .c
  57. C module.
  58. .IP .b
  59. Basic program.
  60. .IP .e
  61. EM assembly module in human readable form.
  62. .IP .k
  63. Compact EM assembly code.
  64. .IP .m
  65. Optimized compact EM assembly code.
  66. .IP .s
  67. Machine assembly language code.
  68. .IP .o
  69. Object file.
  70. .PP
  71. \fIAck\fP accepts the following flags:
  72. .SB machine used
  73. .IP \-m\fImachine\fP
  74. This flag tells \fIack\fP to generate a load file for \fImachine\fP.
  75. \fIMachine\fP can also be used as the program call
  76. name, instead of \fIack\fP.
  77. e.g. \fIack \-mi86 file.p\fP is equivalent to \fIi86
  78. file.p\fP.
  79. .SB output files
  80. .IP \-o
  81. Use the next argument as the name of the resulting file.
  82. \fIAck\fP produces \fIa.out\fP or \fIe.out\fP by default.
  83. This flag can always be used when \fIack\fP produces a single output file,
  84. as in
  85. .br
  86. .ti +5
  87. \fBack -c.s main.c -o new.s\fP.
  88. .br
  89. The output is produced on \fInew.s\fP instead of \fImain.s\fP.
  90. .IP \-c\fI.suffix\fP
  91. .IP \-c
  92. \fIAck\fP tries to transform each source into a file with the \fIsuffix\fP.
  93. When no \fIsuffix\fP is specified \fIack\fP stops just
  94. before the phase where it combines all arguments into a load file,
  95. thereby transforming the sources into \fI.k\fP, \fI.s\fP,
  96. \&\fI.o\fP or \fI.m\fP files.
  97. One extra \fIsuffix\fP is recognized here, \fI.i\fP,
  98. this tells \fIack\fP to only preprocess all human readable sources,
  99. producing files with \fIsuffix\fP \fI.i\fP.
  100. .br
  101. Note: \fIack\fP refuses to overwrite argument \fI.e\fP files.
  102. .IP \-t
  103. Preserve all intermediate files.
  104. If two \fB\-t\fP are used,
  105. \fIack\fP also preserves core dumps and output of failed transformations.
  106. .SB messages
  107. .IP \-w
  108. Suppress all warning messages.
  109. .IP \-E
  110. Produce a complete listing of each Pascal source program.
  111. Normally for each error, one message,
  112. including the source line number, is given.
  113. .IP \-e
  114. List only the erroneous lines of each Pascal source program.
  115. .IP \-v
  116. Verbose.
  117. Print information while juggling with files.
  118. .SB preprocessing
  119. .IP \-I\fIdir\fP
  120. \&\`#include\' files whose names do not begin with \`/\' are
  121. always sought first in the directory of the \fIfile\fP argument,
  122. then in the directories named in \fB\-I\fP options,
  123. then in directories on a standard list.
  124. .IP \-D\fIname=def\fP
  125. .IP \-D\fIname\fP
  126. Define the \fIname\fP to the preprocessor,
  127. as if by \`#define\'.
  128. If no definition is given the \fIname\fP is defined as 1.
  129. .IP \-U\fIname\fP
  130. Remove any initial definition of \fIname\fP, before
  131. preprocessing.
  132. .SB debugging
  133. .IP \-p
  134. This flag tells both the Pascal and C front ends to include
  135. code enabling the user to do some monitoring/debugging.
  136. Each time a routine is entered the routine \fBprocentry\fP
  137. is called and just before each return \fBprocexit\fP is called.
  138. These routines are supplied with one parameter, a pointer
  139. to a string containing the name of the routine.
  140. .SB optimizing
  141. .IP \-O
  142. Use as many optimizers as possible.
  143. \fIAck\fP can almost always use the EM peephole optimizer.
  144. Sometimes the global optimizer or machine-dependent
  145. optimizers can be used.
  146. .IP \-L
  147. Disable the generation of code by the front ends to
  148. record line number and source file name at run-time.
  149. .SB libraries
  150. .IP \-l\fIname\fP
  151. Tells \fIack\fP to insert a library module at this point.
  152. For example: the library \fImon\fP contains the
  153. routines for systems calls needed by both C and Pascal.
  154. .IP \-.\fIsuffix\fP
  155. When linking multiple \fI.o\fP or \fI.m\fP files created by
  156. separate calls of \fIack\fP together, \fIack\fP cannot deduce
  157. the run-time system needed,
  158. unless called as \fIapc\fP or \fIacc\fP.
  159. This flag serves to tell \fIack\fP which runtime system is
  160. needed in such a case.
  161. For example: "ack \-c x.c ; ack \-.c x.o".
  162. .IP \-r.\fIsuffix\fP
  163. Most frontends and backends use one or
  164. more run-time libraries.
  165. These flags tell \fIack\fP to include the libraries needed when
  166. a file with \fIsuffix\fP would be included in the arguments.
  167. .IP \-LIB
  168. This flag tells the peephole optimizer
  169. .RF em_opt VI
  170. to add information about the visibility of the names used
  171. to each output module.
  172. This is needed by most
  173. assembler/linkers when these modules are to be inserted
  174. in libraries.
  175. .SB interpreter
  176. .IP \-{xxx}
  177. The string starting after \`{\' and terminated by a \`}\' is passed
  178. as an option string to the Pascal compiler and supersedes corresponding
  179. options given in the source file.
  180. See the ACK reference manual [4] for a list of options.
  181. .IP "\-+xxx, \-\-xxx"
  182. When you want to interpret your program, you may select some
  183. options during interpretation, like test, profile, flow, extra and count.
  184. A short description of these flags follows:
  185. .RS
  186. .IP " t(est)" 12
  187. test for undefined, overflow, array bound etc.
  188. .IP " f(low)"
  189. keep track of executed source lines.
  190. .IP " c(ount)"
  191. count the number of times a source line is executed.
  192. .IP " p(rofile)"
  193. count the memory cycles executed per source line.
  194. .RE
  195. .IP "" 5
  196. Test is on by default, the others are off. Normally, you give these
  197. flag options each time you run the interpreter.
  198. The EM assembler/linker gives you the opportunity to change
  199. the defaults per program.
  200. The changed options are recorded in the "e.out" header.
  201. These flags \-\- and \-+ are passed to the assembler for this purpose.
  202. So, \-\-t and \-+pfce invert the defaults.
  203. .SB general
  204. .IP \-R\fIprogram=xxx\fP
  205. Replace the \fIprogram\fP by the pathname \fIxxx\fP.
  206. The program names referred to later in this manual are allowed here.
  207. .IP \-R\fIprogram\-xxx\fP
  208. The flag argument \fI\-xxx\fP is given to \fIprogram\fP.
  209. .IP \-R\fIprogram:n\fP
  210. Set the priority of the indicated transformation to \fIn\fP.
  211. The default priority is 0, setting it to -1 makes it highly
  212. inlikely the the phase will be used, setting it to 1 makes
  213. it very likely that the phase will be used.
  214. .IP \-k
  215. Do not stop when an error occurs, but try to transform all
  216. other arguments as far as possible.
  217. .IP \-g
  218. Try to run the resulting load file.
  219. No arguments can be passed this way,
  220. so it is only useful in simple cases.
  221. .PP
  222. All arguments without a suffix or with an unrecognized suffix
  223. are passed to the loaders, as for flags.
  224. .SH PREPROCESSOR
  225. All C source programs are run through the preprocessor
  226. before they are fed to the compiler proper.
  227. Other human readable sources (Pascal programs and
  228. machine assembly) are only preprocessed when they start with a \`#\'.
  229. .PP
  230. \fIAck\fP adds a few macro definitions when it calls the
  231. preprocessor.
  232. These macro\'s contain the word- and pointer-size and the sizes
  233. of some basic types used by the Pascal and/or C compiler.
  234. All sizes are in bytes.
  235. .sp 1
  236. .TS
  237. tab(:);
  238. l l l l.
  239. EM_WSIZE:wordsize:EM_PSIZE:pointer size
  240. EM_SSIZE:size of shorts (C):EM_LSIZE:size of longs (C+Pascal)
  241. EM_FSIZE:size of floats (C):EM_DSIZE:size of doubles (C+Pascal)
  242. .TE
  243. .sp 1
  244. The name of the \fImachine\fP or something like it when
  245. the machine name is numeric is also defined (as 1).
  246. .PP
  247. The default directories searched for include files differ for each machine.
  248. Some machines do not even use \fI/usr/include\fP.
  249. .SH PROGRAMS
  250. \fIAck\fP uses one or more programs in each phase of the
  251. transformation.
  252. The table below gives the names \fIack\fP uses for these
  253. programs.
  254. Internally \fIack\fP maintains a mapping of these names to pathnames
  255. for load files.
  256. The table specifies which type of files are accepted by each
  257. program as input and the file type produced as output.
  258. .sp 1
  259. .in +2
  260. .TS
  261. tab(:);
  262. l l l l.
  263. input:name:output:description
  264. \&.c:cem:.k:C front end [4,5,6]
  265. \&.p:pc:.k:Pascal front end [2,3,6]
  266. \&.b:abc:.k:Basic front end [6,8]
  267. \&.e:encode:.k:Compactify EM assembly language [1]
  268. \&.k:opt:.m:EM peephole optimizer
  269. \&.k .m:decode:.e:Produce human readable EM assembly
  270. \&.k .m:emass:e.out:Linker producing EM machine code [1]
  271. \&.m:be:.s:backend
  272. \&.s:asld:a.out:Assembler/linker producing machine code
  273. \&.s:as:.o:Assembler
  274. \&.o:ld:a.out:Linker producing machine code
  275. .TE
  276. .in -2
  277. .SH "SEE ALSO"
  278. .PD 0
  279. em_opt(VI), em_ass(VI), em_cg(VI)
  280. .IP [1]
  281. A.S. Tanenbaum, Hans van Staveren, Ed Keizer and Johan
  282. Stevenson \fIDescription of a machine architecture for use with
  283. block structured languages\fP Informatica report IR-81.
  284. .IP [2]
  285. K. Jensen and N. Wirth
  286. \fIPASCAL, User manual and report\fP Springer Verlag.
  287. .IP [3]
  288. The ISO Pascal standard proposal ISO/TC97/SC5-N462.
  289. .IP [4]
  290. B.W. Kernighan and D.M. Ritchie, \fIThe C Programming
  291. language\fP, Prentice-Hall, 1978
  292. .IP [5]
  293. D.M. Ritchie, \fI C Reference Manual\fP
  294. .IP [6]
  295. Amsterdam Compiler Kit, reference manuals and UNIX manual pages.
  296. .IP [7]
  297. E.G. Keizer, Ack description file reference manual.
  298. .IP [8]
  299. M.L. Kersten, \fIThe ABC compiler\fP.
  300. .PD
  301. .SH DIAGNOSTICS
  302. .PD
  303. The diagnostics are intended to be self\-explanatory.
  304. .SH BUGS
  305. The -g flag is inoperative.
  306. .br
  307. Not all warning messages are superseded by \fB\-w\fP.
  308. .br
  309. Argument assembly files are not preprocessed when fed into the
  310. universal assembler.
  311. .SH AUTHOR
  312. Ed Keizer, Vrije Universiteit, Amsterdam