TMP47C990E TOSHIBA [Toshiba Semiconductor], TMP47C990E Datasheet - Page 11

no-image

TMP47C990E

Manufacturer Part Number
TMP47C990E
Description
CMOS 4-bit Microcontroller
Manufacturer
TOSHIBA [Toshiba Semiconductor]
Datasheet
TOSHIBA CORPORATION
(2)
2.5.2 Accumulator (Acc)
The accumulator is a 4-bit register used to hold source data or
results of the operations and data manipulations.
Zero detect information (Z)
This information is “1” when the operation result or the
data to be transferred to the accumulator/data mem-
ory is “0000
Example:
Operation
Operation
4 + 2 =
7 + 9 =
9 + 9 =
8 - 1 =
2 - 2 =
5 - 8 =
Figure 2-12. Accumulator
information for 4-bit additions and subtrac-
tions.
The carry information and zero detect
B
”.
Figure 2-13. Flags
3 (1101
Figure 2-11. ALU
Result
Result
6
0
2
7
0
B
)
C
C
0
1
1
1
1
0
0
Z
0
1
0
Z
0
1
2.6 Flags
There is a carry flag (CF), a zero flag (ZF), a status flag (SF), and
a general flag (GF), each consisting of 1 bit. These flags are set
or cleared according to the condition specified by an instruc-
tion. When an interrupt is accepted, the flags are saved on the
stack along with the program counter. When the [RETI]
instruction is executed, the flags are restored from the stack to
the states set before interrupt acceptance.
(1)
(2)
(3)
Carry flag (CF)
The carry flag holds the carry information received from
the ALU at the execution of an addition/subtraction
with carry instruction, a compare instruction, or a
rotate instruction. With a carry flag test instruction, the
CF holds the value specified by it.
Zero flag (ZF)
The zero flag holds the zero detect information (Z)
received from the ALU at the execution of an opera-
tional instruction, a rotate instruction, an input instruc-
tion, or a transfer-to-accumulator instruction.
Status flag (SF)
The status flag provides the branch condition for a
branch instruction. Branch is performed when this flag
is set to “1”. Normally the SF is set to “1”, so that any
branch instruction can be regarded as an uncondi-
tional branch instruction. When a branch instruction is
executed upon set or clear of the SF according to the
condition specified by an instruction, this instruction
becomes a conditional branch instruction. During
reset, the SF is initialized to “1”, other flags are not
affected.
Addition/subtraction with carry instructions [ADDC A,
@HL], [SUBRC A, @HL]
The CF becomes the input (C
carry information.
Compare instructions [CMPR A, @HL], [CMPR A, #k]
The CF holds the carry information (non-borrow).
Rotate instructions [ROLC A], [RORC A]
The CF is shifted into the accumulator to hold the car-
ry information (the data shifted out from the accumu-
lator).
Carry flag test instructions [TESTP CF], [TEST CF]
With [TESTP CF] instruction, the content of the CF is
transferred to the SF then the CF is set to “1”.
With [TEST CF] instruction, the value obtained by in-
verting the content of the CF is transferred to the SF
then the CF is cleared to “0”.
in
) to the ALU to hold the
TMP47C101/201
11/32

Related parts for TMP47C990E