
C165H
Central Processor Unit
Data Sheet
68
2001-04-19
PRELMNARY
N-Flag:
For most of the ALU operations, the N-flag is set to '1', if the most significant
bit of the result contains a '1', otherwise it is cleared. In the case of integer operations the
N-flag can be interpreted as the sign bit of the result (negative: N=’1’, positive: N=’0’).
Negative numbers are always represented as the 2's complement of the corresponding
positive number. The range of signed numbers extends from '–8000
H
' to '+7FFF
H
' for the
word data type, or from '–80
H
' to '+7F
H
' for the byte data type.For Boolean bit operations
with only one operand the N-flag represents the previous state of the specified bit. For
Boolean bit operations with two operands the N-flag represents the logical XORing of the
two specified bits.
-EXCERPT-
System Stack Size (STKSZ)
This bitfield defines the size of the physical system stack, which is located in the internal
RAM of the C165H. An area of 32...512 words or all of the internal RAM may be
dedicated to the system stack. A so-called “circular stack” mechanism allows to use a
bigger virtual stack than this dedicated RAM area.
in chapter “System Programming”.
The Processor Status Word PSW
This bit-addressable register reflects the current state of the microcontroller. Two groups
of bits represent the current ALU status, and the current CPU interrupt status. A separate
bit (USR0) within register PSW is provided as a general purpose user flag.
PSW (FF10
H
/ 88
H
)
15
14
SFR
Reset Value: 0000
H
3
2
ALU Status (N, C, V, Z, E, MULIP)
The condition flags (N, C, V, Z, E) within the PSW indicate the ALU status due to the last
recently performed ALU operation. They are set by most of the instructions due to
specific rules, which depend on the ALU or data movement operation performed by an
instruction.
After execution of an instruction which explicitly updates the PSW register, the condition
flags cannot be interpreted as described in the following, because any explicit write to
the PSW register supersedes the condition flag values, which are implicitly generated by
the CPU. Explicitly reading the PSW register supplies a read value which represents the
state of the PSW register after execution of the immediately preceding instruction.
Note:
After reset, all of the ALU status bits are cleared.
HLD
EN
MUL
IP
USR0
-
N
Z
C
V
E
5
4
1
0
11
10
9
8
7
6
13
12
rw
rw
rw
rw
-
rw
rw
rw
-
rw
-
rw
IEN
-
-
ILVL
rw