Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!dog.ee.lbl.gov!ucbvax!NASVM.BITNET!SWH From: SWH@NASVM.BITNET ("Steven W. Huggins") Newsgroups: comp.lang.asm370 Subject: Re: programming style Message-ID: <9103050154.AA17222@ucbvax.Berkeley.EDU> Date: 4 Mar 91 18:56:45 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: IBM 370 Assembly Programming Discussion List Distribution: inet Organization: The Internet Lines: 48 On Wed, 27 Feb 91 08:22:00 EST Philip Harshman 3697 said: >On Tue, 26 Feb 91 15:27:43 CST "John M. Kelsey" said: >> One thing I've always done, but have seldom seen other programmers do, >> is to use some character to separate the assembly language instructions and >> operands from the line comments by some character--in my case, a semicolon. >> >> LOOPTOP L R4,0(R5) ; Get ARR1(I) integer >> >> Does anyone else do anything similar? > >At our shop we use the vertical or bar (|) for the same purpose: > LOOPTOP L R4,0(R5) | Get ARR1(I) integer >This makes a nice even line separating the code from the comments. And I >agree, it does make the code easier to follow. Hi John and Philip, The history behind, why the special character, includes the following. The MACRO assembler for DOS had a comment placement problem. When code was expanded, comments would float according to the variables pluged in. The solution was to place a "special character" preceeding the comment. This made the comments align properly. If you look at some old IBM code you'll see a "." in front of some generated code. Now on to my personal preferance. I don't use a special character in front of my comments. I do, however, have another ideosyncracy. When the code is to branch somewhere I comment it with a ">". e.i. *--------------------------------------------------------------------* * R O U T I N E T O D O S O M T H I N G * *--------------------------------------------------------------------* ROUTINE EQU * LA R2,45 SET REG.2 TO 45. LA R3,TABLE POINT REG.3 TO TABLE. LOOP EQU * CLI 0(R3),X'FF' CHECK FOR END OF TABLE. BE ENDROUT >YES, BRANCH. ... LA R3,8(,R3) BUMP TO NEXT TABLE ENTRY. BCT R2,LOOP >GO LOOP UNTIL DONE. ENDROUT EQU * We all have personal preferances in the way we code, of course I think my code is the best and only way to code assembler. Which losely translates to don't try to teach this old dog any new tricks, I hate change. Enough for now, Steve