🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.asm370
Article #323

Re: Assembly coding guidelines

#323
From: Mike Kerford-Byrnes
Date: Mon, 05 Sep 2005 19:34
111 lines
6385 bytes
Two small additions and one heartfelt plea

When SMP came out it was not the most reliable of products, a situation
compounded at least once when a fix for itself was distributed in SMP format
which provoked the error being corrected!  SMP was followed by SMP/E, a
chargeable product which invited the comment that using it would be like
paying somebody to mug you!  Since then, it seems to have evolved into a
reliable product which, like most, takes some getting used to .  The value
of the learning curve will depend on the amount to which it will be put by
the vendor.  I have heard of one very small vendor (not many left these
days) who will provide an SMP/E version of the software  ---- for an
additional $250,000.  This is on the grounds that actually starting from
scratch and getting it right, having climbed the learning curve, will be
very costly in employee time spent more productively evolving the products.
That is an interpretation of the value from the low end of the market -
doubtless others will jump in and decry such luddite attitudes.  But it is a
perception as to its usefulness in a small ISV, and just 'cos it is small
does not mean its commercial decisions are necessarily wrong, even if they
conflict with those of the larger players in the market.

Secondly, on a high level, I have always regarded assembler as a series of
instructions that manipulate data into a form that is suitable for the
(mainly) IBM macros - which do all the hard work.  A bit simplistic, but it
helps to explain why I usually code all macro invocations starting in column
7, so that they stand out in the code.  Also keeping names to 8 chars -
surely enough for a single module? - and op codes in column 10 keeps things
tidy.  Combined with the "col 7 macro", the code becomes familiar and (to a
lot of folk) acceptably easy to read.

The Plea      However you code, be CONSISTENT in the techniques.  Having
spent  a lot of time examining the code of others, it is a delight to open
up some source and recognise the "handwriting" of a consistent coder.  This
means that both debugging and maintenance will be more predictable, more
straightforward and less frustrating - and that should  be a good thing for
all parties.

I doubt if this will be the last posting on the subject

Mike Kerford-Byrnes


-----Original Message-----
From:   IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
On Behalf Of David Cole
Sent:   02 September 2005 20:36
To:     ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject:        Re: Assembly coding guidelines

Good suggestions, Mike.

Let me also recommend my on contribution to this topic: "Considerate
Programming: Rules for Writing Quality, Maintainable, Assembler
Code". You can find a pdf at
"http://www.naspa.com/PDF/2005/0605/T0506001.pdf".

Dave Cole              REPLY TO: dbcole@colesoft.com
Cole Software          WEB PAGE: http://www.colesoft.com
736 Fox Hollow Road    VOICE:    540-456-8536
Afton, VA 22920        FAX:      540-456-6658






At 9/2/2005 02:56 PM, MShaw wrote:
>Ing:
>
>Section 1.1 in Chapter 1 of Carmine A. Cannatello's Book _Advanced
>Assembler Language and MVS Interfaces_ has 18 good guidelines.  The
>book is hard to find, but it is excellent.
>
>Here's the URL to it on Amazon:
>
>http://www.amazon.com/exec/obidos/tg/detail/-/0471361763/qid=1125686728/sr=
1-1/ref=sr_1_1/104-6665684-2410350?v=glance&s=books
>
>Mr. Cannatello says that good Assembler language programs have these
>characteristics:
>
>1) simple, easy to understand logic
>2) use mostly simple instructions
>3) use no relative addressing (he means things like  B *+4+8+6  etc.)
>4) use subroutines
>5) use DSECTs
>6) have efficient code
>7) do not modify instructions 'on the fly'
>8) do not ABEND due to a user error
>9) request and check feedback from macro instructions
>10) use internal tables that are easily expanded
>11) issue meaningful error messages
>12) use only standard interfaces
>13) let the Assembler determine lengths
>14) have op-codes, operands, and comments aligned
>15) contain meaningful comments
>16) use meaningful labels
>17) use meaningful DS instructions
>18) do not specify BLKSIZE for files in DCBs
>
>I would also recommend that you should always include PATCH areas
>[PATCH1 DC 120S(*)] for later use with AMASPZAP, and you should add
>debugging code that is gated by conditional assembly language driven
>via a SYSPARM. This lets you test with XDC or TSO TEST  or WTO
>messages easily, then reassemble one last time without the debugging
>code when you go into production.
>
>Also, DON'T run APF authorized if you don't have to...
>
>Mike Shaw
>MVS/QuickRef Support Group
>Chicago-Soft, Ltd.
Technical Details
Message-ID: <000101c5b251$09477420$2c0111ac@cnt.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!usenet.INS.cwru.edu!newsfeed.berkeley.edu!ucberkeley!sn-xit-03!sn-xit-10!sn-xit-01!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!hill-leys.com!mkb

Show Full Headers
Complete Article Headers
X-Google-Thread: fcdcb,b5f541d74f4633a6
X-Google-Attributes: gidfcdcb,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!usenet.INS.cwru.edu!newsfeed.berkeley.edu!ucberkeley!sn-xit-03!sn-xit-10!sn-xit-01!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!hill-leys.com!mkb
From: Mike Kerford-Byrnes <mkb@hill-leys.com>
Newsgroups: bit.listserv.asm370
Subject: Re: Assembly coding guidelines
Date: Mon, 5 Sep 2005 20:34:56 +0100
Organization: SAS Inc.
Lines: 111
Sender: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Message-ID: <000101c5b251$09477420$2c0111ac@cnt.com>
Reply-To: mkb@hill-leys.com
NNTP-Posting-Host: mozart.unx.sas.com
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: foggy.unx.sas.com 1125949827 697 10.19.150.41 (5 Sep 2005 19:50:27 GMT)
X-Complaints-To: usenet@unx.sas.com
NNTP-Posting-Date: Mon, 5 Sep 2005 19:50:27 +0000 (UTC)
Comments: Gated by NETNEWS@VM.SAS.COM
Return-Path: <owner-assembler-list@LISTSERV.UGA.EDU>
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Approved-By: Mike Kerford-Byrnes <mkb@HILL-LEYS.COM>
In-Reply-To: <6.2.3.4.2.20050902153002.05a0c800@mail.swcp.com>
Return-Path: owner-assembler-list@LISTSERV.UGA.EDU
X-OriginalArrivalTime: 05 Sep 2005 19:50:23.0738 (UTC)
                       FILETIME=[0E0845A0:01C5B253]
Originator: daemon@mozart.unx.sas.com