1.单操作数逻辑运算指令

(1)累加器清零

1
CLR A	;A<-0

(2)累加器取反

1
CPL A	;A<-(/A)

(3)累加器循环左移

1
RL A

(4)累加器循环右移

1
RR A

(5)累加器带进位 CY 循环左移

1
RLC A	;An+1<-An,CY<-A7,A0=CY

(6)累加器带进位 CY 循环右移

1
RRC A	;A0->CY,CY->A7,An+1->An

2.双逻辑数逻辑运算指令

(1)逻辑与

1
2
3
4
5
6
ANL A,#data	;A<-(A)&data
ANL A,Rn ;A<-(A)&(Rn) n=0~7
ANL A,direct ;A<-(A)&(direct)
ANL A,@Ri ;A<-(A)&((Ri))
ANL direct,A ;direct<-(direct)&(A)
ANL direct,#data ;direct<-(direct)&data

(2)逻辑或

1
2
3
4
5
6
ORL A,#data	;A<-(A)|data
ORL A,Rn ;A<-(A)|Rn n=0~7
ORL A,direct ;A<-(A)|(direct)
ORL A,@Ri ;A<-(A)|((Ri)),i=0,1
ORL direct,A ;direct<-(direct)|(A)
ORL direct,#data ;direct<-(direct |(data)

(3)逻辑异或

1
2
3
4
5
6
XRL A,#data	;A<-(A)⊕data
XRL A,Rn ;A<-(A)⊕(Rn),n=0~7
XRL A,direct ;A<-(A)⊕(direct)
XRL A,@Ri ;A<-(A)⊕((Ri)) i=0,1
XRL direct,A ;direct<-(direct)⊕(A)
XRL direct,#data ;direct<-(direct)⊕data