
User Manual
C166S V2
Central Processing Unit
User Manual
2-71
V 1.7, 2001-01
C166S V2 CPU features instructions that provide direct access to two operands in the
bit addressable space without requiring them to be moved to temporary locations.
The same logical instructions that are available for words and bytes can also be used for
bits. The user can compare and modify a control bit for a peripheral in one instruction.
Multiple bit shift instructions have been included to avoid long instruction streams of
single bit shift operations. These instruction require a single CPU cycle. Additionally, bit
field instructions enable are able
to modify the multiple bits in one operand in a single
instruction.
All instructions that manipulate single bits or bit groups internally use a read-modify-write
sequence that accesses the whole word containing the specified bit(s).
This method has several consequences:
Bits can be modified only within the internal address areas, i.e. internal RAM and
SFRs. External locations cannot be used with bit instructions.
The upper 256 bytes of the SFR area, the ESFR area, and the internal RAM are bit
addressable, i.e. those register bits located within the respective sections can be directly
manipulated using bit instructions. The other SFRs must be accessed byte/word wise.
Note: All GPRs are bit addressable independent of the allocation of the register bank via
the Context Pointer (CP). Even GPRs allocated to not bit addressable RAM
locations provide this feature.
The read-modify-write approach may be critical with hardware-effected bits. In such
cases, the hardware may change specific bits while the read-modify-write operation is
in progress, where the write back would overwrite the new bit value generated by the
hardware. The solution is either the implemented hardware protection (see below) or
realized through special programming (see
Section 4.1
).
Protected bits
are not changed during the read-modify-write sequence, that is, when
hardware sets something like an interrupt request flag between the read and the write of
the read-modify-write sequence. The hardware protection logic guarantees that only the
intended bit(s) is/are effected by the write-back operation.
Note: If a conflict occurs between a bit manipulation generated by hardware and an
intended software access, the software access has priority and determines the
final value of the respective bit.
2.6.5
Multiply and Divide Unit
The C166S V2 CPU multiply and divide unit has two separated parts. One is the fast
16x16-bit multiplier that executes a multiplication in one CPU cycle. The other one is a
division sub-unit which performs the division algorithm in 21 CPU cycles maximum.
According to the data and division types, the division length varies between 18 and 21
cycles. The divide instruction requires four CPU cycles to be executed. For performance
reasons, the rest of the division algorithm runs in the background during the following