>> I've been writing a fair bit of assembly over the last few weeks or so >> and it's starting to look rather bad - not so much 'cos it doesn't work >> as because it just looks messy - and therefore is hard for others to >> figure out. So, is there a style guide out there that seems reasonably >> standard (and concise !) like say, the Indian Hill style guide for C, >> only for assembly ? >> What are people using ? I find when writing assembler, experiment and try to figure out what is the format that works best for you. John Payson wrote a some comments and I wanted to add my $.02 >The following is a brief description of my personal taste; others' may vary. >Labels: > I haven't 100% settled on a convention here, though I tend to use 6-10 > characters, lowercase, with underscores for code and data labels, and > allcaps with underscores for Microchip-defined I/O definitions or const- > ants, and LeadingCaps for custom I/O definitons. > > Other than data or constant definitions, I almost always put labels on > a line by themself; this makes it much easier if I'm cutting and pasting > a section of code whose first line includes a label and seems to pose no > real disadvantage. I usually put the acronym of the current subroutine first. ie SendChar movlw n movwf Count SC_Loop : decfsz Count goto SC_Loop This allows you to use basic labels easily. >Hexadecimal numbers > The one proper format for hex numbers is $ABCD. Unfortunately, Microchip > doesn't support that in their MPASM assembler. But maybe if people bug > them enough they will [I don't think "$" is used for anything else]. I > personally generally prefer ASPIC by Don Lekei [does anyone know if the > address in the .DOC is current? I need to send him his shareware fee > since I've increasingly decided I like ASPIC] which does accomodate the > proper "$" notation. Boy, the first sentence of this paragraph is just begging to be flamed! John, I think you have to be more tolerant of other people's preferences. I started out with Motorola Assembly and the '$' format, so I know where you're coming from. Actually, some time ago Andy Warren made this statement and I couldn't honestly remember *ever* using '$'. Most of my programming since then has been with "C" and Intel Processors. I think you'll get at least as many (if not more) people who think that "0x0" is the "correct" format. I'm sure that there are people out there that are lost if they don't see in a number in the format "h'xx'". Unfortunately, number format preferences are just that, preferences. There is no "one proper format" although if there was, it would be "0x0". ;-) myke "One must invoke enough raw truth to punch a hole in the world" - Darl Af