Assembly (What if -- 1) -- Missing the assembler comment markers

The effect of missing comment markers is easy to demonstrate simply by assembling the original HVZ syntax file e1v0.s. Click here to see e1v0.lst, the listing generated from the command

as68000 -V68020 -L -m -o e1v0.o e1v0.s


The meaning of the lines in the listing file "e1v0.lst"

We get many errors if we simply "stick comments" at the start of the "e1v0.s" source file without the semicolon (;) to mark the start of each comment.

		Code from HVZ Computer Organization
---- ERROR ---> Unknown instruction from
		Chapter 2 -- Figure 2.26  -- page 67
---- ERROR ---> expected label or instruction
		A 68000 routine for C <- [A] + [B]
---- ERROR ---> expected label or instruction 

The strange thing about these errors is that they all arrive from missing comment (;) markers but yet


The meaning of the error messages from the "comment lines"

The error messages can be interpreted in terms of the various fields the assembler expects for each instruction. Being able to interprete the messages in this manner often clarifies the syntax (typo) error you have made in the source code. It also allows you to distinguish between actual assembler errors you have made and the errors that result from a common problem found with assembly programming, and other languages such as "C". One error, early in the code, can lead to correct lines later in the source code being considered invalid.

The SDS assembler is expecting from each line

LABEL(optional) INSTRUCTION OPERANDS COMMENTS(optional) 

We therefore have the following interpretation of the error messages associated with the first 3 lines:-

Later in the listing we see that the SDS assembler has recognized the need to set aside storage for the word-length (16 bits) value 639, storing it as the hexadecimal value 027F.

000000 		       	A	DC.W	639
----ERROR----> symbol 'A' already defined
000000 027F    

How ever, the assembler did not recognize that the "name" for the memory location specified by this "correct" instruction could be A, believing that this "name" or "symbol" was already defined, is in use, else where in the file. In fact, the label A was accidentally generated by the third comment line "A 68000 routine ..."



Last modified: July 22, 1996 12:00 PM MST 1996
by M. Smith. Copyright -- M. R. Smith