Samsung KS57C2308 Manual page 28

Single-chip cmos microcontroller
Table of Contents

Advertisement

ADDRESS SPACES
SKIP CONDITION FLAGS (SC2, SC1, SC0)
The skip condition flags SC2, SC1, and SC0 in the PSW indicate the current program skip conditions and are set
and reset automatically during program execution. Skip condition flags can only be addressed by 8-bit read
instructions. Direct manipulation of the SC2, SC1, and SC0 bits is not allowed.
CARRY FLAG (C)
The carry flag is used to save the result of an overflow or borrow when executing arithmetic instructions involving
a carry (ADC, SBC). The carry flag can also be used as a 1-bit accumulator for performing Boolean operations
involving bit-addressed data memory.
If an overflow or borrow condition occurs when executing arithmetic instructions with carry (ADC, SBC), the carry
flag is set to "1". Otherwise, its value is "0". When a
during power-down mode, but when normal operating mode resumes, its value is undefined.
The carry flag can be directly manipulated by predefined set of 1-bit read/write instructions, independent of other
bits in the PSW. Only the ADC and SBC instructions, and the instructions listed in Table 2-7, affect the carry flag.
Operation Type
Direct manipulation
Bit transfer
Boolean manipulation
Interrupt routine
Return from interrupt
NOTES:
1.
The operand has three bit addressing formats: mema.a, memb.@L, and @H + DA.b.
2.
"INTn" refers to the specific interrupt being executed and is not an instruction.
2-20
Table 2-7. Valid Carry Flag Manipulation Instructions
Instructions
SCF
RCF
CCF
BTST C
(1)
LDB (operand)
,C
(1)
LDB C,(operand)
(1)
BAND C,(operand)
(1)
BOR C,(operand)
(1)
BXOR C,(operand)
(2)
INTn
IRET
occurs, the current value of the carry flag is retained
RESET
Carry Flag Manipulation
Set carry flag to "1"
Clear carry flag to "0" (reset carry flag)
Invert carry flag value (complement carry flag)
Test carry and skip if C = "1"
Load carry flag value to the specified bit
Load contents of the specified bit to carry flag
AND the specified bit with contents of carry flag and save
the result to the carry flag
OR the specified bit with contents of carry flag and save
the result to the carry flag
XOR the specified bit with contents of carry flag and save
the result to the carry flag
Save carry flag to stack with other PSW bits
Restore carry flag from stack with other PSW bits
KS57C2308/P2308/C2316/P2316

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents