Boolean Variable Manipulation Instructions
Boolean Variable Manipulation Instructions
Boolean Variable Manipulation Instructions
INSTRUCTIONS
BOOLEAN VARIABLE MANIPULATION
MNEMONIC MNEMONIC
CLR C
CLR bit
CLR C
Clear carry
The carry bit is cleared (reset to zero).
No other flags are affected.
One byte
12 pulses
EXAMPLE: CLR C Executing
Executed
Before
CY Execution
AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW A 1 0
78h 0 0 0A 0 78h0 0 D0H
12
11
10
9
8
7
6
5
4
3
2
1
BITPSWD7 D6
80h D5 D4 D3 D2 00h
PSW D1 D0
Address
Clear the carry flag SFR
SFR
FFH FFH
CY 1
0
E0H 78H A E0H 78H A
D0H CY AC
80H F0 RS1 RS0
DOH 0V 00H- P
80H 80H
0
PSW General 0purpose0RAM 0 0 0 purpose
General 0 0
RAMD0H
7FH 7FH
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address
80H 80H
0
PSW General 0purpose0RAM 0 0 0 purpose
General 0 0
RAMD0H
7FH 7FH
BIT 0F 0E 0D 0C 0B 0A 09 08
Address 00H
21H 80H 21H
MNEMONIC
SETB C
SETB bit
SETB C
SET carry
The carry bit is set(set to one).
No other flags are affected.
One byte
12 pulses
EXAMPLE: CLR C Executing
Executed
Before
CY Execution
AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW A 0 0
78h 0 0 0A 0 78h0 0 D0H
12
11
10
9
8
7
6
5
4
3
2
1
BITPSWD7 D6
00h D5 D4 D3 D2 80h
PSW D1 D0
Address
Set the carry flag
SFR SFR
FFH FFH
CY 0
1
E0H 78H A E0H 78H A
D0H CY AC
00H F0 RS1 RS0
DOH 0V 80H- P
80H 80H
1
PSW General 0purpose0RAM 0 0 0 purpose
General 0 0
RAMD0H
7FH 7FH
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address
21H A 0 0
78h 0 0 0A 0 78h0 0
12
11
10
9
8
7
6
5
4
3
2
1
BIT21H0F 0E
00h 0D 0C 0B
21H 0A 80h09 08
Address
Set the bit
SFR SFR
FFH FFH
0FH 0
1
E0H 78H A E0H 78H A
80H 80H
21H 1 0 0
General purpose RAM
0 0 0 purpose
General 0 0
RAM
7FH 7FH
BIT 0F 0E 0D 0C 0B 0A 09 08
Address
21H 00H 21H 80H
CPL C
CPL bit
CPL C
Compliment carry
The carry bit is complimented
No other flags are affected.
One byte
12 pulses
EXAMPLE: CPL C Executing
Executed
Before
CY Execution
AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW A 0 0
78h 0 0 0A 0 78h0 0 D0H
12
11
10
9
8
7
6
5
4
3
2
1
BITPSWD7 D6
00h D5 D4 D3 D2 80h
PSW D1 D0
Address
Compliment the carry SFR
SFR flag
FFH FFH
CY 0
1
E0H 78H A E0H 78H A
D0H CY AC
00H F0 RS1 RS0
DOH 0V 80H- P
80H 80H
1
PSW General 0purpose0RAM 0 0 0 purpose
General 0 0
RAMD0H
7FH 7FH
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address
21H A 0 0
78h 0 0 0A 0 78h0 0
12
11
10
9
8
7
6
5
4
3
2
1
BIT21H0F 0E
00h 0D 0C 0B
21H 0A 80h09 08
Address
Compliment the direct SFR
SFR bit
FFH FFH
0FH 0
1
E0H 78H A E0H 78H A
80H 80H
21H 1 0 0
General purpose RAM
0 0 0 purpose
General 0 0
RAM
7FH 7FH
BIT 0F 0E 0D 0C 0B 0A 09 08
Address
21H 00H 21H 80H
ANL C,bit
ANL C,/bit
ANL C,bit
AND direct bit to carry
No other flags are affected.
Two byte instruction
24 pulses
EXAMPLE: ANL C,bit Executing
Executed
CYExecution
Before AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW 1 0 0 0 0 0 0 0 D0H
21H D7 00h 21H 00hD1
BIT
Address
D6 D5 D4 D3 D2 D0 24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
PSW0 80h
0 0 0 PSW
0 0 00h0 0
21H
BIT
Address
0F 0E
SFR
0D 0C 0B 0A
SFR
09 08
FFH Perform logical ANDFFH
operation on bit
CY A
0FHE0H CY A
D0H 1 80H AND PSW 0 DOH = 0 80H PSW
80H 80H
CY AC
General F0RAMRS1
purpose RS0 General
0V purpose
- PRAM
7FH 0
PSW 0 0 0 0
7FH 0 0 0 D0H
BIT D7 D6 D5 D4 D3 D2 D1 D0
21H
Address 00H 21H 00H
CYExecution
Before AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW 1 0 0 0 0 0 0 0 D0H
21H D7 00h 21H 00hD1
BIT
Address
D6 D5 D4 D3 D2 D0 24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
PSW0 80h
0 0 0 PSW
0 0 80h0 0
21H
BIT
Address
0F 0E
SFR
0D 0C 0B 0A
SFR
09 08
FFH Perform logical ANDFFH
operation on bit
CY A
/0FH
E0H
CY A
D0H 1 80H AND PSW /0 DOH= 0 80H PSW
80H 80H
CY AC
General F0RAMRS1
purpose RS0 General
0V purpose
- PRAM
7FH 0
PSW 0 0 0 0
7FH 0 0 0 D0H
BIT D7 D6 D5 D4 D3 D2 D1 D0
21H
Address 00H 21H 00H
ORL C,bit
ORL C,/bit
ORL C,bit
OR direct bit to carry
No other flags are affected.
Two byte instruction
24 pulses
EXAMPLE:ORL C,bit Executing
Executed
CYExecution
Before AC F0 RS1 After
RS0 Execution
0V - P TIME
PSW 1 0 0 0 0 0 0 0 D0H
21H 00h 21H 80h
BIT D7 D6 D5 D4 D3 D2 D1 D0 24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
Address
PSW 80h PSW 80h
21H 0 0 0 0 0 0 0 0
BIT 0F
SFR
0E 0D 0C 0B 0A SFR
09 08
Address
FFH FFH
Perform logical OR operation on bit
CY A 0FHE0H CY A
PSW
D0H
80H
1 80H OR PSW 0 DOH = 1 80H
80H
CY AC
General F0RAMRS1
purpose RS0 General
0V purpose
- PRAM
7FH 1
PSW 0 0 0 0
7FH 0 0 0 D0H
BIT D7 D6
00H D5 D4 D3 D2 D1 D0
21H
Address 21H 80H
MNEMONIC
JC rel
JNC rel
JB Bit,rel
JNB Bit,rel
JBC bit,rel
JC reladdr
RELATIVE ADDRESS
Signed (two's complement) 8-bit offset
byte.
Range is -128 to +127 bytes relative to
first byte of the following instruction.
The branch destination is computed by
adding the signed relative-displacement in
the second instruction byte to the PC, after
incrementing the PC twice to point to the
next instruction.
JC reladdr
INSTRUCTIONS
ADDRESS MNEMONICS
INSTRUCTIONS
ADDRESS MNEMONICS
INSTRUCTIONS
ADDRESS MNEMONICS
INSTRUCTIONS
ADDRESS MNEMONICS
INSTRUCTIONS
ADDRESS MNEMONICS
(01H) ← 0
20H 1 0 0 0 0 0 0 0
BIT 07 06 05 04 03 02 01 00
Address
JBC bit,reladdr
INSTRUCTIONS
ADDRESS MNEMONICS
21H 0 0 0 0 0 0 0 0
BIT 0F 0E 0D 0C 0B 0A 09 08
Address
Perform logical AND operation on bit
CY /0FH CY
1 AND /0 = 1
CY AC F0 RS1 RS0 0V - P
PSW 1 0 0 0 0 0 0 0 D0H
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address
CY AC F0 RS1 RS0 0V - P
PSW 1 0 0 0 0 0 0 0 D0H
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address
Clear the carry flag
CY 10
CY AC F0 RS1 RS0 0V - P
PSW 0 0 0 0 0 0 0 0 D0H
BIT D7 D6 D5 D4 D3 D2 D1 D0
Address