
M68HC11
REFERENCE MANUAL
CENTRAL PROCESSING UNIT
MOTOROLA
6-17
6.3.3 Condition Code Register Instructions
These instructions allow a programmer to manipulate bits in the CCR.
Initially, it may appear that there should be a set and a clear instruction for each of the
eight bits in the CCR; however, these instructions are present for only three of the eight
bits (C, I, and V). Upon closer consideration, good reasons exist for not including the
set and clear instructions for the other five bits. The stop disable (S) bit is an unusual
case because this bit is intended to lock out the STOP instruction for those who view
it as an undesirable function in their application. Providing set and clear instructions
for this bit would make it easier to enable STOP when it was not wanted or disable
STOP when it was wanted. The TAP instruction provides a way to change the S bit but
reduces the chance of an undesirable change to S because the value of accumulator
A at the time the TAP instruction is executed determines whether the S bit will actually
change.
The XIRQ mask (X bit) is another unusual case. The definition of this bit specifically
states that software shall not be allowed to change X from zero to one; in fact, this
change is even prohibited by hardware logic. This feature immediately eliminates a
need for a set X instruction. For arguments similar to those used for the S bit, the TAP
instruction is preferred over a clear X instruction to clear X because TAP makes it a
little less likely that X will become cleared before the programmer intended.
The half-carry (H) bit needs no set or clear instructions because this condition code bit
is only used by the DAA instruction to adjust the result of a BCD add or subtract. Since
the H bit is not used as a test condition for any branches, it would not be useful to be
able to set or clear this bit.
This leaves only the negative (N) and zero (Z) condition code bits. In contrast to S, X,
and H, it is often useful to be able to easily set or clear these flag bits. A clear accu-
mulator instruction, such as CLRB, will clear the N and set the Z condition code bits.
The load instruction, ;LDAA#$80, causes N to be set and Z to be cleared. Since there
are so many simple instructions that can set or clear N and Z, it is not necessary to
provide specific set and clear instructions for N and Z in this group.
6.3.4 Program Control Instructions
This group of instructions, which is used to control the flow of a program rather than to
Function
Clear Carry Bit
Clear Interrupt Mask Bit
Clear Overflow Bit
Set Carry Bit
Set Interrupt Mask Bit
Set Overflow Bit
Transfer A to CCR
Transfer CCR to A
Mnemonic
CLC
CLI
CLV
SEC
SEI
SEV
TAP
TPA
INH
X
X
X
X
X
X
X
X