Category:68000 Assembly: Difference between revisions

Line 22:
 
This difference isn't usually relevant in the majority of situations, so don't concern yourself too much. It's much more important when doing [[6502 Assembly]] where registers are smaller than the address space.
 
===Notation Conventions===
How you write the source code depends on your assembler and the syntax it uses. This page is written using Motorola syntax but there is also Milo syntax which has different conventions.
 
The following represent the Motorola syntax rules for code statements only (data blocks follow different rules than these, so don't be surprised that there's a difference.
 
 
* A number with a # in front represents a constant, literal value. For example, the 3 in <code>MOVE.B #3,D0</code> represents the number 3.
 
 
* A number without a # in front represents a memory location. For example, the 3 in <code>MOVE.B 3,D0</code> represents <i>the byte stored at memory address <code>$00000003</code></i>.
 
 
* A number that doesn't have a $ or % prefix is a decimal (base 10) value.
 
 
* A number that begins with a $ is a hexadecimal value.
 
 
* A number that begins with a % is a binary value.
 
 
* The operand of <code>BTST</code>,<code>BTST</code>,<code>BTST</code>, or <code>BTST</code> represents a bit position, starting at the rightmost binary digit as 0 and counting up from right to left. For example, <code>BCLR #3,D0</code> performs the same bitwise operation that you would get from doing <code>AND.B #%11110111,D0</code>.
 
 
===Data Registers===
1,489

edits