Category Archives: IBM Mainframe Assembler

Videos and word documents that cover how to program in IBM mainframe assembler language.

Test Yourself – and help me out

I’ve added a plugin to the website that will allow me to create tests or quizzes, grade them, and send you the results. I’m in the early stages of implementing a database of assembler questions on a variety of topics. So far, I’ve created the first test that asks questions about character data and instructions. I could use your help trying out the test system to see how it works. There is a box at the bottom of the test where you can report any problems with the test. Will you give it a try and let me know what you think?

Go to the Test Yourself tab on the home page and select the Character Data #1 test. To get the results, you will have to provide an email address. I make no money from this site, so I will not use your email for commercial purposes.

My goal is to build a database to help you prepare for job interviews, or just to brush up on various aspects of this large language.


Filed under IBM Mainframe Assembler

Search String – SRST

Anubha Agarwal wrote and asked for a video covering Search String (SRST). I don’t have a video quite yet, but here are my notes on this instruction. It’s an interesting one that can be used to search for the first occurrence of a single character in a given area of storage. It was probably added to the instruction set to help compiler writers who needed to search for C strings which are terminated with X’00’.

The interesting feature of the instruction is that it can be interrupted by the CPU for efficiency reasons when searching large areas of storage. The programmer can then decide whether to continue searching or not.

I stumbled over the examples given in the Principles of Operation, until I realized the code is flawed. A BC 1,LOOP instruction should be BC 3,LOOP, so pay close attention to those two examples.

Now that I’ve written down my thoughts, I’ll put together a video soon and provide some program examples you can experiment with. This instruction is definitely worth a look.


Filed under Fans of IBM z, IBM Mainframe Assembler

14th Marist ECC Conference, June 12-14, 2022

Marist College

The Marist Enterprise Computing conference (ECC) confernce is one of the best IBM mainframe conferences going: Great speakers, food, location, and no conference fee. This year it’s meeting face-to-face again on the beautiful Marist College campus, Poughkeepsie, NY. There is even an opportunity to give a presention of your own.

Check out the conference website here:


Filed under Fans of IBM z, IBM Mainframe Assembler

Shifty Shifts

Perhaps you’re like me, and as a fledgling assembler programmer, you learned the Shift and Round Decimal instruction (SRP) from a handful of choice examples.  Something like this one,


If you were lucky, maybe someone showed you the 64-N trick for computing a right shift by N digits like this one,




After trying this out and getting it to work in a few programs, I committed the ideas to memory and didn’t give it much thought for a few years. At some point though, I figured out that that second parameter in these instructions is a base/displacement address, and not just a decimal number that somehow gets converted to 2’s complement. Looking up the explicit format for the instruction I found this,

         SRP    D1(L1,B1),D2(B2),I3   

The second parameter is a base/displacement, so the 3, or 64-3, or 61 we coded above, is treated as a displacement by the assembler and the base register is assumed to be 0. So, what’s going on with that address? The Principles of Operation solved the mystery for me. The base/displacement address is converted to an effective address, the effective address is then truncated to the rightmost 6 bits, and the remaining value is treated as a 2’s complement binary integer. With that value, we can shift 32 digits to the right or 31 digits to the left.

Never one to miss a trick (albeit rather slowly), it finally dawned on me, that if operand 2 is a base/displacement address, we could put the shift factor in a register and make the displacement 0 like this,

       L      R6,=F’-3’        SHIFT FACTOR GOES IN R3


Not much of an improvement, if any, but it does open the possibility of changing the shift factor on the fly by manipulating the register dynamically instead of hard-coding it into the instruction at assembly time – a technique you might occasionally find useful.

The same technique (but with a different interpretation of those 6 bits) works on all shift operations. For example, SRA, SRDA, SLL, …  The 6-bit shift factor for these shifts is treated as a plain binary number (instead of 2’s complement) because the direction of the shift is baked into the instruction. In all cases, you can put the shift factor in the register, and use it to control the shift factor on the fly – very shifty!

You can watch that happen in this short Viziblez demo video here.


Filed under IBM Mainframe Assembler

Re-write/ update of Chapters 1-4 of “The Book”

I’m in full assembler mode these days, preparing to teach an assembler class for Marist College that starts on Monday. It’s playing havoc with my golf game, but the upside is I’m getting a lot done. I’ve recently updated chapters 1-4 of the assembler book. That includes a complete re-write of Chapter 4, trying to provide explanations of addressing on IBM mainframes. I’m also adding a problem set to the end of each chapter, trying to make the book function better as a textbook.

I will always provide access to the individual chapters online, but my plan is to self-publish an ebook and a printed version that can be ordered. More about that later.

I want to thank everyone who has pointed out errors or suggested improvements in the text. I am listening and making the changes you suggested.


Filed under Fans of IBM z, IBM Mainframe Assembler

Nominate an IBM Champion/ IBM Community Festival

It has been fun to be part of the IBM Champions program this year – an honor! The IBM Champions program is taking currently taking nominations through November 30. Is there someone who helps you or answers your questions? Say thank you by nominating them to be an #IBMChampion. Tell their story to help them earn their star. You can even nominate yourself.

The IBM Community Festival is back soon – well worth a look. And it’s free. 5 days. 3 different geographies. IBM Community Festival 2021. Where all the experts will be:

Leave a comment

Filed under Fans of IBM z, IBM Enterprise Cobol, IBM Mainframe Assembler

Rewrite of Chapter 10 – DSECTs and more

I have just finished an extensive rewrite of book chapter 10. I’ve added much more material on USING and DROP. Besides an introduction to DSECTs, You’ll find a discussion of ordinary, labeled, dependent, and labeled dependent USING statements. There is an explanation of what the assembler is doing in pass one, and how the USING table is processed in pass two as you issue USING and DROP directives. I’ll probably come back and add some programming exercises, but for the moment, I’m done.

Many thanks to Ajith Thankappan for his helpful suggestions. You can find that chapter here and on the website.

Leave a comment

Filed under IBM Mainframe Assembler


Just a reminder that today is IBM Z day. The conference is free and going on now. Check out what is available here.

Leave a comment

Filed under IBM Mainframe Assembler

Update to Chapter 4

Writing a book takes years – at least it does for me. Writing a book about a computer that is still evolving is difficult. The evolution of IBM System/z machines over the last twenty years is amazing. The things I wrote years ago are often dated now – mostly correct, but dated – newer instructions, newer techniques have come along. I’ll keep working at this – editing chapters and changing the content. Today I reposted Chapter 4. Kudos to Les Kelley for some good suggestions that got me thinking.


Filed under IBM Mainframe Assembler

A New Assembler Book: Mine

I’ve been working on a new assembler book for a while – writing new material and organizing the old material I’ve written into a coherent whole. I think there is a need for a book aimed at beginning assembler programmers, and this is my best attempt. I love John Erhman’s assembler text, Assembler Language Programming for IBM z System Servers –  Version 2.00. It’s hard to beat John’s book for the wealth of material it contains. But I would characterize that book as a reference book, rather than a textbook. What I’m aiming for is a text that an instructor could use for a class, or a book that an interested reader could use on their own to learn IBM assembly language. So the book introduces topics in an order I found helpful for teaching beginners. I hope that together these two books will help you master this language.

Here is where you come in: I could use your help. I’m publishing each of the completed chapters on the website for you to use. If you find errors or have suggestions for making it better, let me know. You see, I’m not punctilious. I try to be – it’s a goal – but I’m not, and I need your help finding errors. At some point, I’ll put all the chapters together into a physical book and make it available to you. In the meantime, help me make this better now.


Filed under IBM Mainframe Assembler