Modern Assembler Programming for z/OS
When I started at Rocket in 2003, I was migrating from a 20-year career as an MVS Systems Programmer who dabbled in writing assembler tools to a fully-fledged software engineer. At the time, the style of assembler that I used and the tools at my disposal were based on what had been in existence for decades; ISPF for edit, SCLM for source control, and 1970s-style assembler full of branch labels and “spaghetti logic”.
The first notable change to my personal development style occurred in 2005 with the adoption of assembler Structured Programming Macros (SPMs). The IBM variety, offered as an optional feature on top of High Level Assembler, had been around for several years before I became convinced that SPMs could greatly improve the readability, reliability and serviceability of the code that I was writing. Gone forever was the “spaghetti logic” of traditional assembler programming with its strangely-named branch labels. I had now entered a single-entry, single-exit style of coding, full of “IF”, “DO” and “SELECT” clauses that could be more easily understood by developers unfamiliar with assembler, and let’s be honest here, even by me at “zero dark thirty” several weeks/months after originally writing the code.
This new way of coding did, however, come with a frustrating side effect that I found increasingly annoying. The minute you start to use clauses such as “IF” and “DO”, there is an instinctive desire to indent the code to reflect the current nesting level of logic. This need butted heads with the assembler’s rigid statement continuation rules of a non-blank character in column 72 and the next statement starting in column 16. All my attempts at code beautification collapsed against these archaic punched-card-based restrictions. When I wanted to use a macro with several parameters and it had to be continued on the next line, the logic indent could force the next line to start in a column further towards the left side of the screen than the owning macro. Anyone who knows me could safely predict the ensuing wringing of hands that this would cause.
My sanity was saved when I came across Ed Jaffe’s FLOWASM exit for IBM High Level Assembler. This exit relaxed the rigid continuation rules so that you could code more naturally, indicating continuation by a trailing comma and then beginning the next statement in ANY column. I could now line up my macro parameter keywords underneath each other anywhere within the logic nest indent.
FLOWASM coupled with the IBM SPMs transformed the style of assembler I use into something more akin to a “power user 3GL” and as Ed says in the presentation, “This isn’t your father’s assembler language”.
I have never looked back.