Status Register
-
STATUS
This 8-bit register contains the zero flag (Z), carry flag (C), auxiliary carry flag (AC), overflow flag
(OV), power down flag (PDF), and watchdog time-out flag (TO). These arithmetic/logical operation
and system management flags are used to record the status and operation of the microcontroller.
With the exception of the TO and PDF flags, bits in the status register can be altered by instructions like
most other registers. Any data written into the status register will not change the TO or PDF flag. In
addition, operations related to the status register may give different results due to the different
instruction operations. The TO flag can be affected only by a system power-up, a WDT time-out or by
executing the
²
CLR WDT
²
or
²
HALT
²
instruction. The PDF flag is affected only by executing the
²
HALT
²
or
²
CLR WDT
²
instruction or during a system power-up.
The Z, OV, AC and C flags generally reflect the status of the latest operations.
·
C
is set if an operation results in a carry during an addition operation or if a borrow does not take
place during a subtraction operation; otherwise C is cleared. C is also affected by a rotate through
carry instruction.
·
AC
is set if an operation results in a carry out of the low nibbles in addition, or no borrow from the
high nibble into the low nibble in subtraction; otherwise AC is cleared.
·
Z
is set if the result of an arithmetic or logical operation is zero; otherwise Z is cleared.
·
OV
is set if an operation results in a carry into the highest-order bit but not a carry out of the
highest-order bit, or vice versa; otherwise OV is cleared.
·
is cleared by a system power-up or executing the
²
CLR WDT
²
instruction. PDF is set by
executing the
²
HALT
²
instruction.
·
TO
is cleared by a system power-up or executing the
²
CLR WDT
²
or
²
HALT
²
instruction. TO is set
by a WDT time-out.
In addition, on entering an interrupt sequence or executing a subroutine call, the status register will not
be pushed onto the stack automatically. If the contents of the status registers are important and if the
subroutine can corrupt the status register, precautions must be taken to correctly save it.
STATUS Register
Bit
7
6
5
4
3
2
1
0
Name
¾
¾
TO
OV
Z
AC
C
R/W
¾
¾
R
R
R/W
R/W
R/W
R/W
POR
¾
¾
0
0
x
x
x
x
²
x
²
unknown
Bit 7, 6
unimplemented, read as
²
0
²
Bit 5
TO
: watchdog time-out flag
0: After power up or executing the
²
CLR WDT
²
or
²
HALT
²
instruction
1: A watchdog time-out occurred.
Bit 4
: power down flag
0: After power up or executing the
²
CLR WDT
²
instruction
1: By executing the
²
HALT
²
instruction
Bit 3
OV
: Overflow flag
0: no overflow
1: an operation results in a carry into the highest-order bit but not a carry out of the
highest-order bit or vice versa.
Bit 2
Z
: Zero flag
0: The result of an arithmetic or logical operation is not zero
1: The result of an arithmetic or logical operation is zero
Rev. 1.50
30
April 28, 2020
BS83B08-3/B12-3/B16-3/B16G-3/C24-3
8-Bit Touch Key Flash MCU