clr
Clear
Sets all bits of the destination operand to 0 at the given size (byte, word or long).
Sizes .b .w .l, .w by default
Used in
- Sum of an arrayM68K assembly
- The largest elementM68K assembly
- Length of a stringM68K assembly
- Even or odd, count the set bits, multiply by shiftingM68K assembly
- Binary searchM68K assembly
- A 2D arrayM68K assembly
- Print a number in any base without helpM68K assembly
- Move a square with the keyboardM68K assembly
- The snake gameM68K assembly
- Flappy birdM68K assembly
XNZVC –0100
- 0 always 0
- 1 always 1
- – not changed
Forms
Operands
<ea>- An operand using one of the instruction’s supported addressing modes, such as
d0,(a0)+or4(a1). It may name a register, memory or an immediate value. More
* --- Only clears the portion specified by size ---
move.l #$FFFFFFFF, d0
clr.b d0 ; d0 = $FFFFFF00
move.l #$FFFFFFFF, d1
clr.w d1 ; d1 = $FFFF0000
move.l #$FFFFFFFF, d2
clr.l d2 ; d2 = $00000000