C161U
System Programming
Preliminary Data Sheet
412
02.2000
PRELIMINARY
PRE
LI
M
INAR
Y
- E
XC
ER
PT
-
MOV
R0, #BASE
;Move table base into R0
LOOP:
CMP
R1, [R0+]
;Compare target to table entry
JMPR
cc_SGT, LOOP
;Test whether target has not been found
Note: The last entry in the table must be greater than the largest possible target.
MOV
R0, #BASE
;Move table base into R0
LOOP:
CMP
R1, [R0+]
;Compare target to table entry
JMPR
cc_NET, LOOP
;Test whether target is not found AND..
;..the end of table has not been reached.
Note: The last entry in the table must be equal to the lowest signed integer (8000
H).
21.5
Peripheral Control and Interface
All communication between peripherals and the CPU is performed either by PEC
transfers to and from internal memory, or by explicitly addressing the SFRs associated
with the specific peripherals. After resetting the C161U all peripherals (except the
watchdog timer) are disabled and initialized to default values. A desired configuration of
a specific peripheral is programmed using MOV instructions of either constants or
memory values to specific SFRs. Specific control flags may also be altered via bit
instructions.
Once in operation, the peripheral operates autonomously until an end condition is
reached at which time it requests a PEC transfer or requests CPU servicing through an
interrupt routine. Information may also be polled from peripherals through read accesses
to SFRs or bit operations including branch tests on specific control bits in SFRs. To
ensure proper allocation of peripherals among multiple tasks, a portion of the internal
memory has been made bit addressable to allow user semaphores. Instructions have
also been provided to lock out tasks via software by setting or clearing user specific bits
and conditionally branching based on these specific bits.
It is recommended that bit fields in control SFRs are updated using the BFLDH and
BFLDL instructions or a MOV instruction to avoid undesired intermediate modes of
operation which can occur, when BCLR/BSET or AND/OR instruction sequences are
used.
21.6
Floating Point Support
All floating point operations are performed using software. Standard multiple precision
instructions are used to perform calculations on data types that exceed the size of the