For example, what would be the difference between, MOVE 8,D2 and MOVE #8,D2? Just wondering what the # represents and what would happen without it.
In GNU AS, if you use the # before anything else on a given line, the line will be ignored (comment). If use # before a value after an instruction, the value will be considered an immediate. If you want to use in-line comments at that point on the same line, you have to use C-style (i.e., /* comment here */) comments. For example:
# Write the palette to CRAM
lea Palette, a0 /* Move palette address to a0 */
move.w #size_palette_w-1, d0 /* Loop counter = 8 words in palette */
in 68k assembly, the # sign denotes immediate constants. Everything else is normally considered an address:
move.w #6,d0
will load the constant immediate value 6 into register d0, while
move.w 6,d0
will do something entirely different: It will fetch the word at the constant address 6 into register d0
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