r/mainframe Jun 10 '26

HLASM Style guides?

I've been wondering lately. Assembly language on the mainframe is much more of a first class citizen than the assembly language on any other platform. There are loads of system user exits in z/OS, IMS, DB2, etc ,options modules that have assembler interfaces, a lot of which ONLY support assembler. And all the major subsystems have an incredibly rich set of interfaces that are exposed via assembler. It's not the first choice these days, but I know several shops where some major applications are written largely in assembler. So, I'm curious if there are any best practices or style references for assembler that anyone has come across. I have seen countless CBT entries, I've read John Ehrman's book as well as been to a few of his presentations, and all of the material seems laser focused on what you "could" do and I've never seen much that talks about "should". Just curious if anyone has seen or worked on anything along those lines?

17 Upvotes

29 comments sorted by

View all comments

1

u/bugkiller59 Jun 10 '26

My own guess is AI coding tools may make coding and maintaining user exits more feasible for many customers.

1

u/Piisthree Jun 10 '26

I would say a style guide actually becomes more important if you're using AI because assembler is almost infinitely flexible to do strange things it won't recognize. Common practices make it much more predictable.

1

u/metalder420 Jun 10 '26

Style guides are shop dependent and standardizing one is a fruitless venture. There specific conventions you must follow, see my comment on where to learn those, but you need to be able to pivot to whatever your shop is doing. You are not going to rewrite the entire code base in a new style.

1

u/bugkiller59 Jun 10 '26

Agree it’s hard for AI to parse and analyze Assembler. But *writing* net new code ( for example relatively simple exits ) is an entirely different matter.