deucalion0 wrote: ... What is the smallest Assembler program I can write that covers all or most of the fundamentals of a Mainframe Assembler program? ...
You can always replicate IEFBR14:
IEFBR14 CSECT
SR 15,15
BR 14
END IEFBR14
IEFBR14 has quite a lot of assumptions.
- Register 14 specifies the address of the next instruction to execute when the program completes.
- When the program is finished, register 15 has the binary return code for the program.
... Once I have this code, is it going to be in a dataset and then I run some JCL using HLASM to link edit the code into a load module?...
You've been around long enough to know this. By definition your program must be in a data set, because all Assembler programs I know about require their source to be in a data set. In this JCL, the data set is included in the JCL.
//A EXEC HLASMC
//SYSIN DD *
IEFBR14 CSECT
SR 15,15
BR 14
END IEFBR14
You can also store your program text in a regular data set, depending on what you are comfortable doing. Back when I started we used punched cards, so more often than not the program text was in the JCL. These days punched cards are rather rare and, at least for me, program text is in a regular data set.
...then I run some JCL using HLASM to link edit the code into a load module?
Sigh. HLASM just assembles a program. It does not then prepare a load module. This is exactly like C++ on the mainframe. After the assembler completes, the object output for the program is then processed by a program now called the Binder to prepare a load module, just like C++ on the mainframe. For example -
//A EXEC HLASMCL
//SYSIN DD *
IEFBR14 CSECT
SR 15,15
BR 14
END IEFBR14
//L.SYSLMOD DD -- data set where you want to store the load module for your program --
HLASM V1R6 Programmer's Guide will discuss this in more detail. The Binder is discussed in
MVS Program Management User's Guide and Reference for your z/OS release.
... Once I have the load module how can I execute it and see it do something in order to see the code has run? ...
Since we have no idea what your program is doing, how can we help you with that??? z/OS does not have an IDE like toy machines; attempts to devise a checkout environment for mainframes, such as the PL/I checkout compiler in the 1970s, did not work out very well.
I use TSO TEST as described in
TSO/E Command Reference for your z/OS release quite a lot, despite its many flaws. TEST, at least is available everywhere. Another popular tool is DBC, which I have never used because it, too, has many flaws.
... I want to learn how CSECTS come together and how I can zap code to make it abend and then read the dump to track down where it abended. ...
The Linkage Conventions chapter in
MVS Assembler Services Guide for your z/OS release discusses this better than we could here.
We rarely "zap" code on a mainframe to make it ABEND. It usually ABENDs all by itself. Of course, you can easily insert
DC H'0'
into your program to make it ABEND at a location of your choosing. Another option is to use the ABEND macro, but this is rarely done for testing.
Dump analysis is too complex and difficult for this forum.