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
Most of the errors are the same whether you use or don't use the -m assembler option.
C EQU $202200
ORG $201150 ----ERROR----> unknown instruction 'ORG'
000000 A DC.W 639
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 .
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.
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.
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.
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