gbs (02/07/83)
To All Smallc Users, Like some of you, we have been trying to bring up V2 of the Smallc Compiler on Unix (version 2.8) here at the Computer Based Laboratory at Harvard University. We have been successful, coming up with a very unix-like mutant of Smallc. However, we plan to use the compiler specifically as a tool to run on our system. It is not written with the intention of being downloaded to a micro, therefore it is not written to be run on itself. This made the debugging very advantageous. Changes: 1. There are certain places in the code where EOL is not being read. I suppose that on the original machine, a NULL character terminated a line. In blanks, therefore, it is necessary to check for EOL and not NULL to determine when to process another line. I found this problem also in preprocessing. When adding values for a #define statement to the macro table, the EOL character is ignored, and when the value of a symbol is replaced on a line, the EOL is written also. In addmac, simply doing a putmac until EOL is found, and then putmac'ing NULL will handle this. 2. If you are compiling the code on a Unix compiler rather than version 1 of Smallc (like we are) then there are places in the code where expressions are receiving warnings from the compiler. Putting spaces between (val)=*(ptr) will alleviate this annoy- ance. Improvements (I hope): 1 With this compiler, as with version1, I found undefined variables in function calls to be ignored. I have fixed this and while I won't post it here, I would be glad to post it to anyone who requests it. 2 Also, I have totally restructured the receiving of command line options. I found version 2's method rather unexpandable for those who wished to add many command line options (I had written it for version1 and I was simply to lazy to write getarg). The new version parses the command line with the help of a case statement corresponding to each option, so adding options is a much more attractive endeavor. 3 It was true what Mike Wagner said about the inability to do nested includes. I have fixed this also, implementing some stacks to hold current file descriptors, names, and line numbers which are useful not only for #including, but also for diagnostic messages. 4 Speaking of diagnostic messages, I have made version 2's error messages a command line option. I felt that they were impractical for programs with many errors (messages are scrolled up the screen as they appear. For those of us with dumb, no- scroll terminals, this is useless) so I implemented very a unix like diagnostic system which although doesn't supply a pointer to the unparsable object, it does supply file-names , line numbers where error occurred, and also undefined variable names. It works on includes as well. In the Planning Stages: We are working on adding structures to the smallc we are implementing. However, this is still in the development stages. Adding a command line user library which only compiles those functions who are unresolved in the inputs file(s) is also being added. It will be able to compile 8085 functions as well as smallc functions. This should be up by next week. As stated before, anyone who wishes to see these changes, let us know and we will be glad to post you a copy. There are probably more changes that I made, but right now they are hard to remember, so I will post important ones as I recall them. Gary B. Schermerhorn Computer Based Lab Harvard University