
C165H
System Programming
Data Sheet
433
2001-04-19
PRELMNARY
memory architecture and its on-chip hardware automatically detects accesses to internal
RAM, GPRs, and SFRs.
-EXCERPT-
20
System Programming
To aid in software development, a number of features has been incorporated into the
instruction set of the C165H, including constructs for modularity, loops, and context
switching. In many cases commonly used instruction sequences have been simplified
while providing greater flexibility. The following programming features help to fully utilize
this instruction set.
Instructions Provided as Subsets of Instructions
In many cases, instructions found in other microcontrollers are provided as subsets of
more powerful instructions in the C165H. This allows the same functionality to be
provided while decreasing the hardware required and decreasing decode complexity. In
order to aid assembly programming, these instructions, familiar from other
microcontrollers, can be built in macros, thus providing the same names.
Directly Substitutable Instructions
are instructions known from other microcontrollers
that can be replaced by the following instructions of the C165H:
Modification of System Flags
is performed using bit set or bit clear instructions (BSET,
BCLR ). All bit and word instructions can access the PSW register, so no instructions like
CLEAR CARRY or ENABLE INTERRUPTS are required.
External Memory Data Access
does not require special instructions to load data
pointers or explicitly load and store external data. The C165H provides a Von-Neumann
Multiplication and Division
Multiplication and division of words and double words is provided through multiple cycle
instructions implementing a Booth algorithm. Each instruction implicitly uses the 32-bit
register MD (MDL = lower 16 bits, MDH = upper 16 bits). The MDRIU flag (Multiply or
Divide Register In Use) in register MDC is set whenever either half of this register is
written to or when a multiply/divide instruction is started. It is cleared whenever the MDL
Substituted Instruction
C165H Instruction
Function
CLR
Rn
AND
Rn, #0
H
Bit, Bit
Clear register
CPLB
Bit
BMOVN
Complement bit
DEC
Rn
SUB
Rn, #1
H
Rn, #1
H
Rn, #8
H
Decrement register
INC
Rn
ADD
Increment register
SWAPB
Rn
ROR
Swap bytes within word