8
The 68000's Instruction Set
Application: ANDI is used to clear selected bits of the CCR. For example,
ANDI #$FA,CCR clears the Z- and C-bits, i.e., XNZVC = X N 0 V 0.
Condition codes: X N Z V C
* * * * *
X: cleared if bit 4 of data is zero
N: cleared if bit 3 of data is zero
Z: cleared if bit 2 of data is zero
V: cleared if bit 1 of data is zero
C: cleared if bit 0 of data is zero
ANDI to SR AND immediate to status register
Operation: IF [S] = 1
THEN
[SR]
← <literal>.[SR]
ELSE TRAP
Syntax: ANDI #<data>,SR
Attributes: Size = word
Description: AND the immediate data to the status register and store the
result in the status register. All bits of the SR are affected.
Application: This instruction is used to clear the interrupt mask, the S-bit, and
the T-bit of the SR. ANDI #<data>,SR affects both the status byte
of the SR and the CCR. For example, ANDI #$7FFF,SR clears the
trace bit of the status register, while ANDI #$7FFE,SR clears the
trace bit and also clears the carry bit of the CCR.
Condition codes: X N Z V C
* * * * *
ASL, ASR Arithmetic shift left/right
Operation: [destination] ← [destination] shifted by <count>
Syntax: ASL Dx,Dy
ASR Dx,Dy
ASL #<data>,Dy
ASR #<data>,Dy
ASL <ea>
ASR <ea>