Why isn't # needed before numbers with DC.W (Define Constant), only instructions?

dynamic picture dynamic · Apr 29, 2012 · Viewed 8.1k times · Source

I have this line of code:

X   DC.W    5   

This means basically X = 5 But shouldn't be X DC.W #5 ?

When using MOVE I need always #

MOVE.B  #1,VAR

Answer

Igor F. picture Igor F. · Apr 29, 2012

#1 means immediate value, i.e. the value 1. Without the #, it would mean the contents of the memory location 1.

With DC.* you place values (I guess you can call them "immediate" values) into memory locations specified by X. It is not a processor instruction, but the instruction for the assembler to reserve memory and fill it with specified value(s).