
ML51/ML54/ML56
Sep. 01, 2020
Page
698
of 719
Rev 2.00
ML
51
/ML
54
/ML
5
6 S
E
RI
E
S
TECHNI
CA
L
RE
F
E
R
E
NC
E
M
A
NU
A
L
ML51/M
L54
/M
L56
Series
Tec
hnical Reference
Manual
6.20.2 Read-Modify-Write Instructions
Instructions that read a byte from SFR or internal RAM, modify it, and rewrite it back, are called “Read-
Modify-
Write” instructions. When the destination is an I/O port or a port bit, these instructions read the
internal output latch rather than the external pin state. This kind of instructions read the port SFR
value, modify it and write back to the port SFR. All “Read-Modify-Write” instructions are listed as
follows.
Instruction
Description
ANL
Logical AND. (ANL direct, A and ANL direct, #data)
ORL
Logical OR. (ORL direct, A and ORL direct, #data)
XRL
Logical exclusive OR. (XRL direct, A and XRL direct,
#data)
JBC
Jump if bit = 1 and clear it. (JBC bit, rel)
CPL
Complement bit. (CPL bit)
INC
Increment. (INC direct)
DEC
Decrement. (DEC direct)
DJNZ
Decrement and jump if not zero. (DJNZ direct, rel)
MOV
bit, C Move carry to bit. (MOV bit, C)
CLR
bit Clear bit. (CLR bit)
SETB
bit Set bit. (SETB bit)
The last three seem not obviously “Read-Modify-Write” instructions but actually they are. They read
the entire port latch value, modify the changed bit, and then write the new value back to the port latch.
6.20.3 Instruction Set
Instruction
OPCODE
Bytes
Clock Cycles
ML51/ML54/ML56 Series VS.
Tradition 80C51 Speed Ratio
NOP
00
1
1
12
ADD
A, Rn
28~2F
1
2
6
ADD
A, direct
25
2
3
4
ADD
A, @Ri
26, 27
1
4
3
ADD
A, #data
24
2
2
6
ADDC A, Rn
38~3F
1
2
6
ADDC A, direct
35
2
3
4
ADDC A, @Ri
36, 37
1
4
3
ADDC A, #data
34
2
2
6
SUBB A, Rn
98~9F
1
2
6
SUBB A, direct
95
2
3
4
SUBB A, @Ri
96, 97
1
4
3
SUBB A, #data
94
2
2
6