Gotchas: Difference between revisions

Content added Content deleted
Line 101: Line 101:
=={{header|68000 Assembly}}==
=={{header|68000 Assembly}}==
===Numeric Literals===
===Numeric Literals===
Integer literals used in instruction operands need to begin with a #, otherwise, the CPU considers them to be a pointer to memory. This applies to any integer representation, even ASCII.
Integer literals used in instruction operands need to begin with a #, otherwise, the CPU considers them to be a pointer to memory that will be dereferenced. This applies to any integer representation, even ASCII.
<syntaxhighlight lang="68000devpac">MOVE.L $12345678,D0 ;move the 32-bit value stored at memory address $12345678 into D0
<syntaxhighlight lang="68000devpac">MOVE.L $12345678,D0 ;move the 32-bit value stored at memory address $12345678 into D0
MOVE.L #$12345678,D0 ;load the D0 register with the constant value $12345678</syntaxhighlight>
MOVE.L #$12345678,D0 ;load the D0 register with the constant value $12345678</syntaxhighlight>