Bookmark and Share
RSS

Recent Posts

The Dance Between Machine and Its Language

July 14, 2014

In my previous series of posts, I went on an excursion into z/OS automation starting with Focusing on Usability and Automation: Message Processing Facility and continuing with z/OS Jewel Keeper: SYS1.PARMLIB, Automating From Start Up to Shut Down: NetView and finished with Building on NetView: Tivoli System Automation for z/OS. I hope that series was useful and interesting.

With this post, I want to discuss one of the most wonderful and challenging elements of z/OS—its Basic Assembler Language (BAL).

What came first, the machine or its assembler language? The designers who created the architecture of the mainframe always had the programmer in mind. BAL was part of their thinking but clearly the machine and its native instructions or operations came first.

What is the difference between machine language and assembler language? Lets take a simple example: 

Machine language     05EF

Assembler                  BALR 14,15

What does this mean? When a programmer sees 05EF in a hexadecimal dump of a BAL program, the programmers knows that the program coding included a branch and link register instruction involving registers 14 and 15. They know this because 05 is the operation code for branch and link register, E is 14 and F is 15 (in hexadecimal). Simply put, the program is branching to another routine whose address can be found in register 15 and when that routine is done, it will return to the address found in register 14. It is useful that the processor places the address of the byte following the BALR instruction, which is both the next sequential instruction address and the expected return address, in register 14. What is missing from this one-instruction example are the other instructions doing useful work including setting up register 15 with the address of the routine.

Isn’t it interesting that you can spend a paragraph discussing one instruction! This is an indication of the power of BAL and the reason it holds such interest with programmers.

I am going to explore this more deeply in the next few posts. Meantime, where can I find out more information? See The Assembler Language on z/OS.

Posted July 14, 2014 | Permalink

comments powered by Disqus