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!
If you would like to pursue on-line assembler training with me starting Fall, 2019, check out the Marist University IDCP program here: http://idcp.marist.edu/enterprisesystemseducation/zosprogramoverview.html
You can explore their main website here: http://idcp.marist.edu/
I have been away from the website for quite a while, but I’m trying to get back to it again. Over the past year, I’ve been busy writing a novel (mystery), and I also added a second grandson this year. And of course, there’s golf to play.
If you are looking for online assembler training or other z/OS training, you might consider the Marist College Institute for Data Center Professionals (IDCP) program. The program starts in late August and there will be an online assembler course starting in December. I have taught the assembler course over the last few years. They have also added a security certificate. Here is a link to the Marist site: Marist IDCP
I cut the following graphic from their latest blurb which describes the programs they offer.
Are you catching all the overflows that occur when you perform packed decimal arithmetic? Not sure? Read about the Set Program Mask instruction (SPM) that controls how decimal overflows (as well as a few others) are handled inside your program. Learn all about it here.
Learn one new instruction today – Compare and Branch – CRB. You can tighten your code just a bit with CRB, an instruction that combines a comparison operation on two registers with a branch operation – all in one line. It comes with some extended mnemonics that make it easy to use. Learn all about it here in the time it takes to finish a cup of coffee.
I envisioned VisibleZ as a teaching tool for assembly language – I wanted to force students to deal with object code as a way to learn the assembly language. With VisibleZ, after writing a few bytes of object code, you can watch the effects of a given instruction on the state of the machine, and in the process learn a thing or two. Or, you can simply step through the hundreds of pre-written program snippets that comes with it. I’ve tried to make it easy to write program snippets – two hex characters represent a byte, with bytes separated by spaces – all in a text file. No need to write a large program to get some experience with an instruction.
A few months ago, James Cray, one of the contributors to z390, the Portable Assembler and Emulator Project , suggested it would be nice to be able to load z390 object modules into VisibleZ. If you’re not familiar with that project, and you don’t have access to a mainframe, you should check it out. Using z390 you can write large, well-developed assembler programs and run them on your pc. It also supports Cobol and CICS!
I didn’t want to want to change my original file format, but I decided to take James’ advice by providing some support for z390. I’ve just posted an experimental version (executable jar / codes.zip -code snippets) of VisibleZ that will take the assembler listings produced by z390 and scrape off the object code and format it it to run in VisibleZ. You will have to install z390 separately and tell VisibleZ where it lives on your machine. After that you can assemble a program and run your program, all within VisibleZ.
The experimental version runs on Windows only. If there is any interest in getting this to run on Linux, let me know. I’ll remind you that VisibleZ still has limited support for QSAM files – 80 byte records and a limit of three input and three output files.
The ability to load an address in assembler is a powerful tool. Working with an object from a distance (Load Address) rather than directly (Load) gives us the power of pointers and opens up the possibility of creating data structures. LA, an RX instruction, was the traditional instruction for working with addresses. LAY, an RXY-a instruction, offers some advantages over LA that you should consider. Read about the differences in these instructions here.
I’m in the process of revising lecture videos and notes for the entire site. The beginning videos (Starting Assembler 1 and 2) are now revisions of older ones that correct typos, misspeakings, etc., and include some new material on System/z. I’ve also added a third video that walks through the architectural components mentioned in the first two videos using VisibleZ as a demonstration tool – a good introduction for beginners.
If you are generating a binary result in a register and converting the result back to packed-decimal, you need to be keenly aware of the limitations of each of these data types. For large binary values, you will need some conversion techniques that aren’t found in Principles of Operation. This article discusses several approaches for converting double-precision binary back to packed-decimal.
This update in VisualZ corrects a flaw in the packed decimal arithmetic instructions that occurred when using large values. You should also download codes.zip which includes many new packed decimal test programs. To get the latest versions, click the Download VZ tab on the homepage.