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
Definition of isn't : is not.
used for emphasizing that you completely agree with what someone has just said, especially a criticism. 'That man loves the sound of his own voice. ' 'Doesn't he just? '
: I will : I shall.
ain't | American Dictionary contraction of am not, is not, are not, has not, or have not: "Is Terry here?" "No, he ain't coming in today."
#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).
Typically dc.(b/w/l) is used for hardcoded data being put into a table in ROM. E.g. if you wanted to create a table of four bytes, it'd look like the following:
EITHER ONE WILL WORK:
OR
They both mean the same thing, as they are declaring 4 bytes of data. Now, using MOVE is a little bit different, in that it is moving data to a data register, or a location in RAM. This data can be from... say, the table we created above, from a data register, or a simple number value starting with this '#', like so:
This moved the value $11 to the RAM address I specified. Hope that clears this up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With