Sunday, September 28, 2008

Never code another unconditional branch in macro or assembler code

With the availability of both Structured Programing Extension (SPE's) for conditional macro code and Structured Programming Macros (SPM's) for assembler code, there is no reason to ever code another unconditional branch again! The z390 SPE and SPM support is free, and the benefits are easier to read and maintain code resulting in higher quality code and less cost to maintain the code. For more details on SPE's and SPM's visit:

http://www.z390.org/z390_ZSTRMAC_Structured_Macro_Support.htm

z390 v1403b now includes the follow SPE's supported by the mz390 macro processor:

* AIF, AELSEIF, AELSE, AEND - alternate selection
* AWHILE, AEXIT, AEND - iteration
* AUNTIL, AEXIT, AEND - iteration
* ACASE, AWHEN, AELSE, AEXIT, AEND - multiple selection using branch table
* ACALL, AENTRY, AEXIT, AEND - perform block of code and return

z390 v1403b now includes the following SPM's written in structured macro code using SPE's:

* IF, ELSEIF, ELSE, ENDIF - alternate selection
* DO, ENDDO - iteration
* SELECT, WHEN, OTHRWISE, ENDSEL - multiple compare selection
* CASENTRY, CASE, ENDCASE - branch table selection
* PM, PENTRY, PEXIT - perform block of code and return

There is also a translator included to translate the structured SPM macros to standard HLASM for use on systems which do not yet support the SPE's in the macro processor. The structured macros can be viewed in the ptf\z390\mac directory and the translated standard versions can be viewed in the ptf\z390\mac\spm directory in the following z390 PTF zip file for v1403b:

http://downloads.sourceforge.net/z390/z390_v1403b_ptf.zip

I believe most mainframe assembler developers are in favor of structured programming, but some are equally opposed ot it. Either way, your comments, suggestions, enhancement requests, and bug reports are welcome.

Don Higgins
don@higgins.net

No comments: