XCH是eXCHange的缩写。
XCH A,Rn ;(A)<->(Rn),n=0~7
XCH A,direct ;(A)<->(direct)
XCH A,@Ri ;(A)<->((Ri)),i=0,1
将累加器A的内容和源操作数的内容相互交换。
(A)=80H,(R7)=08H,(40H)=F0H
(R0)=30H,(30H)=0FH
执行下列指令
XCH A,R7 ;(A)<->(R7)
XCH A,40H ;(A)<->(40H)
XCH A,@R0 ;(A)<->((R0))
结果:(A)=0FH,(R7)=80H,(40H)=08H,(30H)=F0H