Infineon Technologies C166S V2 User Manual page 75

16-bit microcontroller
Table of Contents

Advertisement

Field
MULIP
E
Z
V
C
N
ALU Status (N, C, V, Z, E, MULIP)
The condition flags (N, C, V, Z, E) within the PSW indicate the ALU status resulting from
the last performed ALU operation. They are set by the majority of instructions according
to the specific rules depending on the ALU operation or data movement.
After execution of an instruction which explicitly updates the PSW register, the condition
flags may no longer represent an actual CPU status. An explicit write operation to the
PSW register supersedes the condition flag values implicitly generated by the CPU. An
explicit read access to the PSW register returns the value of the PSW register after
execution of the immediately preceding instruction.
Note: After reset, all of the ALU status bits are cleared.
• N-Flag: For the majority of 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 2s complement of the
corresponding positive number. The range of signed numbers extends from '–8000
to '+7FFF
' for the word data type, or from '–80
H
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.
User Manual
Bits
Type Description
[5]
r
Multiplication/Division in progress
Always set to 0
[4]
rwh
End of Table Flag
0
1
[3]
rwh
Zero Flag
0
1
[2]
rwh
Overflow Flag
0
0
[1]
rwh
Carry Flag
0
1
[0]
rwh
Negative Result
0
1
Source operand is neither 8000
Source operand is 8000
ALU result is not zero
ALU result is zero
No Overflow produced
Overflow produced
No carry/borrow bit produced
Carry/borrow bit produced
ALU result is not negative
ALU result is negative
' to '+7F
H
H
2-75
User Manual
C166S V2
Central Processing Unit
nor 80
h
or 80
h
h
' for the byte data type. For
V 1.7, 2001-01
h
'
H

Advertisement

Table of Contents
loading

Table of Contents