Assembly (What if - 2) -- The effect of the missing "-m" assembler option

Click here to see the listing generated from the assembler command without the -m option

as68000 -V68020 -L -o e1v1.o e1v1.s


The meaning of the lines in the listing file when the "-m" assembler option is missing

Most of the errors are the same whether you use or don't use the -m assembler option.

  1. The assembler has accepted that the "word" (or label) C has the "meaning" (value) of hexadecimal 00202200.

    C EQU $202200

  2. The SDS assembler does not recognize the HVZ standard Motorola assembler directive ORG
    			ORG	$201150
    ----ERROR----> unknown instruction 'ORG' 
  3. 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 
  4. 000002 FF29	       	B	DC.W	-215    

    This line is correct.Note that the hex value FF29 ($FF29 or 0xFF29) is the 16 bit equivalent of the negative decimal value -215 .

  5. The next three lines were unexpectedly tagged as containing an error now that the -m option is missing
        				MOVE	A, D0
    ----ERROR----> invalid operand
           				ADD	B, D0
    ----ERROR----> invalid operand
           				MOVE	D0, C
    ----ERROR----> invalid operand    

These are three new errors not present when the -m assembler option is used.


Your choice

Using standard Motorola syntax

Turns out that spaces after commas are not standard Motorola 68K assembly syntax. With standard Motorola syntax, the code should have been written as

			MOVE	A,D0
       			ADD	B,D0
			MOVE	D0,C

The trouble is -- one additional space as a typo, such as in the code

			MOVE	A,D0
       			ADD	B, D0
			MOVE	D0,C

and a "standard" Motorola assembler will give you "an error message". You'll have to modify your code and assemble it again. It is worth using the -m option simply to avoid this time wasting.

Using a non-standard syntax that allows 'white spaces'

I use a lot of white space when developing my "C" code to make the code easier to use and debug. The amount of effort to put spaces between "words", or blank lines between "ideas", in a source file is small. Transferring the white space concept to assembler programming makes good software engineering sense in my mind. White space makes the final file so much easier to check now, and modify later.

On either account

It is worth using the SDS as68000 option -m to allow a freer coding style.

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



Last modified: July 08, 1996 03:36 PM by M. Smith.
Copyright -- M. R. Smith