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.