I never got to meet John Erhman but we corresponded a little. He was kind enough to get me included on the program at a Share conference in Anaheim. John wrote an excellent Assembler reference titled Assembler Language Programming for IBM z System Servers . Even a seasoned assembler programmer can learn a lot from this book – it’s packed with many interesting assembler goodies. I keep a link to it nearby and you should, too. I was browsing through it today and came across a suggestion he had for a program to write:
Programming Problem 41.3.(3)+ Write a program with a program interruption exit that generates each of the 15 possible interruption types in turn. For each interruption, generate a message describing the interruption type and the address of the interrupted instruction. Then, return to the mainline program to generate the next interruption.
The program suggestion comes after a section of the book that covers how to handle program interruptions using ESPIE. It wasn’t too hard to get a basic version of the program going. You do have to write some “bad” code to generate the 15 possible program interruptions. As I began to write this code, it struck me as funny that this would be the worst program ever. That’s when I thought it would be fun to enlist your help. Many of the interruptions are easy to generate – we’ve all sinned. But I did scratch my head on how to generate a S0C5. I can’t remember ever getting that interruption, but then my memory isn’t as good as it used to be.
Here’s how you can help: If you have a favorite way to generate one of the 15 possible program interrupts in just a few lines (the fewer the better) send it in. I’ll pick the ones I like best and include them in my program and give you credit. The program will appear in a future post or article on recovering from program interrupts. The program I’m writing does have an input file (FILEIN) and an output file (FILEOUT). That might help you with some of the interrupts. Be sure to include the definitions of any fields you need. As a small tribute to John, we’ll commit every possible error. Help me write the worst program ever!