Search code examples
assembly68000

What Does # Mean in Assembly?


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.


Solution

  • 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 */