
C165UTAH
Architectural Overview
Data Sheet
32
2001-02-23
No special instructions are required to perform loops, and loops are automatically
detected during execution of branch instructions.
The second loop enhancement allows the detection of the end of a table and avoids
the use of two compare instructions embedded in loops. One simply places the lowest
negative number at the end of the specific table, and specifies branching if neither this
value nor the compared value have been found. Otherwise the loop is terminated if
either condition has been met. The terminating condition can then be tested.
The third loop enhancement provides a more flexible solution than the Decrement and
Skip on Zero instruction which is found in other microcontrollers. Through the use of
Compare and Increment or Decrement instructions, the user can make comparisons
to any value. This allows loop counters to cover any range. This is particularly
advantageous in table searching.
Saving of system state is automatically performed on the internal system stack avoiding
the use of instructions to preserve state upon entry and exit of interrupt or trap routines.
Call instructions push the value of the IP on the system stack, and require the same
execution time as branch instructions.
Instructions have also been provided to support indirect branch and call instructions.
This supports implementation of multiple CASE statement branching in assembler
macros and high level languages.
Consistent and Optimized Instruction Formats
To obtain optimum performance in a pipelined design, an instruction set has been
designed which incorporates concepts from Reduced Instruction Set Computing (RISC).
These concepts primarily allow fast decoding of the instructions and operands while
reducing pipeline holds. These concepts, however, do not preclude the use of complex
instructions, which are required by microcontroller users. The following goals were used
to design the instruction set:
1. Provide powerful instructions to perform operations which currently require
sequences of instructions and are frequently used. Avoid transfer into and out of
temporary registers such as accumulators and carry bits. Perform tasks in parallel
such as saving state upon entry into interrupt routines or subroutines.
2. Avoid complex encoding schemes by placing operands in consistent fields for each
instruction. Also avoid complex addressing modes which are not frequently used. This
decreases the instruction decode time while also simplifying the development of
compilers and assemblers.
3. Provide most frequently used instructions with one-word instruction formats. All other
instructions are placed into two-word formats. This allows all instructions to be placed
on word boundaries, which alleviates the need for complex alignment hardware. It
also has the benefit of increasing the range for relative branching instructions.