William "Chops" Westfield mac.com> writes: > (I suppose if something like this is IMPLEMENTED in m4, that would be > fine. I just didn't find m4 particularly nice on its own the one time > I used it...) There is probably two of *everything* implemented in m4, but I agree about m4 being a little off flavor for 2007. And I always considered it byzantine. Together with sendmail configuration files and termcap and printcap files. Searching the web for assembly+preprocessor yielded a few hits: http://savannah.nongnu.org/project/memberlist.php?group=masp http://www.myri.com/scs/L3/doc/gasp_3.html and then, there is Olin L.'s PREPIC (sp?) Anyway I think that you expect a preprocessor that works in cpp style but can cope with the mysterious storage classes implied (!) by certain assembly language constructs. I don't think that there is such a thing. But I think that it could be duplicated by using C style storage classes in the first place and writing the source such that the cpp generates actual assembly. Another approach would be to perform an extra pass with a loophole optimizer style tool on generated assembly (extracted from a listing) and reassemble it. That tool would be in a position to fix-up most things in the manner you have specified. I am sure that you know more about cpp than many, still it is instructive to take a look at what gcc cpp can do today just to have an idea of the size of the tool you are looking for: http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp So, I don't think that there is an easy small and free tool out there that can do what you need. It looks like a full time job imho. Anyway it is common knowledge that all C flow control structures can be emulated in pure cpp (with very few exceptions). F.ex. you iterated over the length of a string when the sizeof() operator would have been useful in your example. I think that there is more than one way to do what you need and that pushing the preprocessor to do things the assembly way is not the way I would look at. I would prefer to keep everything on the 'input' side in C flavor and translate to assembly as late as possible. Peter P. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist