On 17 November 2017 at 11:22, John McKown <[email protected]> wrote: > Granted, this is most likely as silly thought. But I have gotten used to > some tools on Linux which "beautify" source code. I'm thinking of "indent" > which reformats C code to a number of different "standards". Or maybe > "tidy" which can "clean up" HTML, XHTML, and XML.
OK. I'm not opposed to such things, but are they something you run once or occasionally, or as part of every build? > So I was wondering if there is something to "clean up" HLASM code. Some > examples would be to change an instruction coded like: " L R1,0(R1) " to > be "more correct" with " L R1,0(,R1)". Of course, if R1 is supposed to be > in the index position, the "correct" way to code this would be "L > R1,0(R1,0) ". I think that goes way beyond beautifying; changing the code itself is not something I want a "cleanup" program to do. Maybe produce suggestions for some cases, but for this case HLASM is already quite capable of issuing a warning. > Another "clean up" might be to put opcodes and operands into > the "proper" columns of 10 & 16 respectively. Or maybe to rewrite macros so > that the "positional" parameters are, as much as possible, on the first > "card" and every keyword parameter is on a separate "card" and in > alphabetic order. I'd like to see macro-generated code put in the right place(s). When using structured macros, the macro invocation is often indented, but the generated code goes in the standard columns. A prettyfier (prettifyer? prettifier?) could do this, but better would be for the macro to be able to discover what column its own invocation is in, and be able to tell the assembler to generate in the right place. An enhancement to the assembler rather something that should need an external program, IMHO. And I assume you are anyway talking of processing the source code rather than the listing. Tony H.
