Allowable "COMMENTS" with the SDS assembler -- as68000

The following "comment markers" are possible with a number of different compilers and assemblers


SDS as68000 acceptable comment markers

Comment markers are "assembler directives" and are software tool dependent. I therefore put the following simple file through the SDS as68000 tool with my favourite comment markers and "watched for smoke".

* Comments starting with *
; Comments starting with ;
// C++ style Comments starting with //
! Comments starting with !

	* Comments starting with * but indented
	; Comments starting with ; but indented
	// C++ style Comments starting with // but indented
	! Comments starting with ! but indented

The results in the listing file were informative

	       	* Comments starting with *
	       	; Comments starting with ;
		       	 
	       	! Comments starting with !
----ERROR----> expected label or instruction
		       	
	       		* Comments starting with * but indented
----ERROR----> expected label or instruction
	       		; Comments starting with ; but indented
		       		 
	       		! Comments starting with ! but indented
----ERROR----> expected label or instruction
  1. C++ comments, //, do not cause errors during assembly, but the comments vanish from the listing file. The same will occur with the C comments, /* ... */, but I don't like using them any way.
  2. Starting a comment with a star, *, in the first place on a line is acceptable, BUT the star is not acceptable in the middle of a line.
  3. A semicolon, ;, is acceptable everywhere to indicate the start of the comment field.
  4. My favourite comment field marker the exclaimation mark, !, is not acceptable anywhere.

It is your choice of what comment field marker you would like to use. I tend to use the ; (semicolon) simply because it is valid everywhere. The fact that it is accepted is useful as I often, unintentionally, add ";" after statements, especially if I have recently been doing a lot of "C" and "C++" programming!

However I also like using // comment markers as they looks "nicer" in my source files (.s extension). The fact that the comments don't appear in the listing files (.lst extension) does not matter. I only use my listing files when I have errors to find in my code. My code is planned so perfectly that I never have to look in the listing files any way!

I do use the * (star) comment field marker for marking different sections of the code. However, that's often an "after-thought" after I have got the code running and I'm preparing the file for archiving or as a teaching example.


Last modified: July 13, 1996 05:36 AM by M. Smith. Copyright -- M. R. Smith